Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Validation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
merobal committed Jun 16, 2022
1 parent dea0ec5 commit b361750
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Internal/Support/InvoiceValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function validationRulesForSavingInvoice()
// The language of invoice (and email)
'invoiceLanguage' => ['required', Rule::in(Invoice::$supportedLanguages)],
// Currency used in invoice. Make sure all related prices, costs appear in the specified currency
'currency' => ['required'],
'currency' => ['required', 'string'],
// Datetime fields
'createdAt' => ['required', 'date'],
'fulfillmentAt' => ['required', 'date'],
Expand All @@ -69,7 +69,7 @@ public function validationRulesForSavingInvoice()
// This is usually the locally stored incremental identifier of order.
// It is important to be specified because the common invoice can be
// obtained from proforma invoice only if it is specified.
'orderNumber' => ['required', 'alpha_num'],
'orderNumber' => ['required', 'alpha_dash'],

'isImprestInvoice' => ['required', 'boolean'],
'isFinalInvoice' => ['required', 'boolean'],
Expand Down Expand Up @@ -117,7 +117,7 @@ public function validationRulesForSavingInvoice()
* -------------------------------------------------------- */
'items' => ['required', 'array', 'min:1'],
'items.*.name' => ['required', 'string'],
'items.*.quantity' => ['required', 'integer', 'min:1'],
'items.*.quantity' => ['required', 'numeric', 'min:1'],
'items.*.quantityUnit' => ['required', 'string'],
'items.*.netUnitPrice' => ['required', 'numeric'],
'items.*.taxRate' => ['required'],
Expand Down

0 comments on commit b361750

Please sign in to comment.