fix: 🐛 set brand id from service in claim call #52

This commit is contained in:
Alexis Gousseau 2026-04-15 12:22:56 +02:00
parent c5cb57d88a
commit 6ceb32fdca
No known key found for this signature in database
GPG key ID: 7F3C786EE12DBB72
3 changed files with 3 additions and 4 deletions

View file

@ -32,6 +32,9 @@ class ClaimController extends Controller
);
}
// Add brand id from service.
$claimModel->brand_id = $service->brand->getKey();
// Add customer relation if exist.
$crmCustomer = CustomerInfo::getFromEmail($claimModel->brand, $claimModel->email)->first();
if (!is_null($crmCustomer)) {

View file

@ -80,7 +80,6 @@ class SendClaimRequest extends BaseApiRequest
}
],
'message' => 'required|string|min:3',
'brand_id' => 'required|integer|exists:brands,id',
'subject_id' => 'required|integer|exists:claim_subjects,id',
];
}

View file

@ -26,7 +26,6 @@ class CrmClientClaimTest extends CrmClientTester
'claim@hotmail.fr',
'Ceci est un message.',
1,
1,
'10 rue des totos',
'Le Mans',
'72100',
@ -55,7 +54,6 @@ class CrmClientClaimTest extends CrmClientTester
'claim@hotmail.fr',
'Ceci est un message.',
1,
1,
));
$this->assertTrue(ModelsClaim::query()->where('email', 'claim@hotmail.fr')->exists());
}
@ -74,7 +72,6 @@ class CrmClientClaimTest extends CrmClientTester
'claim@hotmail.fr',
'Ceci est un message.',
0,
0,
);
$this->assertSame(0, ModelsClaim::count());
}