From 441f4d53bb31885ff8177776c65be2c278d560d9 Mon Sep 17 00:00:00 2001 From: Michael de Oliveira Ferreira Date: Sat, 21 Oct 2023 01:53:59 -0300 Subject: [PATCH] fix: fix billet validation rules --- src/Rules/BAAS/Billet.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Rules/BAAS/Billet.php b/src/Rules/BAAS/Billet.php index 3d6cb16..7085aac 100644 --- a/src/Rules/BAAS/Billet.php +++ b/src/Rules/BAAS/Billet.php @@ -2,8 +2,6 @@ namespace WeDevBr\Celcoin\Rules\BAAS; -use WeDevBr\Celcoin\Enums\ClientFinalityEnum; - class Billet { public static function rules(): array @@ -11,21 +9,21 @@ public static function rules(): array return [ 'externalId' => ['required'], 'merchantCategoryCode' => ['sometimes', 'required'], - 'expirationAfterPayment' => ['boolean'], + 'expirationAfterPayment' => ['required', 'numeric', 'min:1'], 'duedate' => ['required', 'date'], 'amount' => ['required', 'decimal:0,2'], 'key' => ['required'], 'debtor' => ['required', 'array'], - 'debtor.name' => ['required'], - 'debtor.document' => ['required', 'numeric'], + 'debtor.name' => ['required', 'string', 'max: 25'], + 'debtor.document' => ['required'], 'debtor.postalCode' => ['required', 'numeric'], 'debtor.publicArea' => ['required'], - 'debtor.number' => ['required', 'numeric'], + 'debtor.number' => ['required'], 'debtor.complement' => ['nullable'], 'debtor.neighborhood' => ['required'], 'debtor.city' => ['required'], 'debtor.state' => ['required'], - 'receiver.document' => ['required','numeric'], + 'receiver.document' => ['required'], 'receiver.account' => ['required','numeric'], 'instructions' => ['sometimes', 'array', 'nullable'], 'instructions.discount' => ['required_with:instructions','array'], @@ -36,7 +34,7 @@ public static function rules(): array 'instructions.interest' => ['nullable','decimal:0,2'], 'split' => ['sometimes', 'array'], 'split.*.account' => ['nullable', 'numeric'], - 'split.*.document' => ['nullable', 'numeric'], + 'split.*.document' => ['nullable'], 'split.*.percent' => ['nullable', 'decimal:0,2'], 'split.*.amount' => ['nullable', 'decimal:0,2'], 'split.*.aggregatePayment' => ['nullable', 'boolean'],