Updated validation

This commit is contained in:
mathiaspalmqvist committed 2025-06-30 11:29:29 +02:00
1 parent a80c9e5a2f
commit 4a0857f642
3 files changed
+25 -2

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ class CustomerValidator
{
$validator = Validator::make($data, [
'name' => 'required|string',
'type' => 'required|string',
'type' => 'required|string|in:company,private',
'vatNumber' => 'nullable|string',
'orgNumber' => 'nullable|string',
'paymentTerms' => 'nullable|string',
-1
View File
@@ -35,7 +35,6 @@ beforeEach(function () {
it('can fetch a list of customers from Bokio', function () {
$response = (new Customer($this->client))->all();
expect($response->items)->toHaveCount(1);
expect($response->items[0]->name)->toBe('customer 1');
});
+24
View File
@@ -26,6 +26,30 @@
"country": "SE"
},
"language": "sv"
},
{
"id": "55c899c5-82b2-47fa-9c51-e35fc9b26443",
"name": "customer 2",
"type": "private",
"vatNumber": null,
"orgNumber": "123456-7890",
"paymentTerms": "30",
"contactsDetails": [
{
"name": "John Doe",
"email": "john@email.com",
"phone": "0927-5631505",
"isDefault": true
}
],
"address": {
"line1": "Älvsborgsvägen 10",
"line2": null,
"city": "Göteborg",
"postalCode": "123 45",
"country": "SE"
},
"language": "sv"
}
]
}