Răsfoiți Sursa

refactor: deixa somente name e cpf obrigatorios no cadastro de unit_partner

Gustavo Mantovani 1 zi în urmă
părinte
comite
4ca6706b21

+ 3 - 4
app/Http/Requests/UnitPartnerRequest.php

@@ -12,7 +12,7 @@ public function rules(): array
         $isCreate = $this->isMethod('POST');
 
         $rules = [
-            'unit_id'          => 'sometimes|required|integer|exists:units,id',
+            'unit_id'          => 'sometimes|integer|exists:units,id',
             'name'             => 'sometimes|required|string|max:255',
             'social_name'      => 'sometimes|nullable|string|max:255',
             'role'             => 'sometimes|nullable|string|max:100',
@@ -35,9 +35,8 @@ public function rules(): array
         ];
 
         if ($isCreate) {
-            $rules['unit_id'] = 'required|integer|exists:units,id';
-            $rules['name']    = 'required|string|max:255';
-            $rules['cpf']     = ['required', 'string', 'max:20', Cpf::rule()];
+            $rules['name'] = 'required|string|max:255';
+            $rules['cpf']  = ['required', 'string', 'max:20', Cpf::rule()];
         }
 
         return $rules;

+ 7 - 0
lang/en/validation.php

@@ -196,9 +196,16 @@
 
     'attributes' => [
         'name' => 'Name',
+        'unit_id' => 'Unit',
         'fantasy_name' => 'Trade Name',
         'social_reason' => 'Corporate Name',
+        'social_name' => 'Social Name',
+        'role' => 'Role',
         'cnpj' => 'CNPJ',
+        'cpf' => 'CPF',
+        'rg' => 'ID',
+        'birth_date' => 'Date of Birth',
+        'participation' => 'Ownership Percentage',
         'state_registration' => 'State Registration',
         'name_responsible' => 'Responsible Person’s Name',
         'street' => 'Street',

+ 7 - 0
lang/es/validation.php

@@ -196,9 +196,16 @@
 
     'attributes' => [
         'name' => 'Nombre',
+        'unit_id' => 'Unidad',
         'fantasy_name' => 'Nombre Comercial',
         'social_reason' => 'Razón Social',
+        'social_name' => 'Nombre Social',
+        'role' => 'Cargo',
         'cnpj' => 'CNPJ',
+        'cpf' => 'CPF',
+        'rg' => 'Documento de Identidad',
+        'birth_date' => 'Fecha de Nacimiento',
+        'participation' => 'Participación',
         'state_registration' => 'Registro Estatal',
         'name_responsible' => 'Nombre del Responsable',
         'street' => 'Calle',

+ 7 - 0
lang/pt/validation.php

@@ -197,9 +197,16 @@
 
     'attributes' => [
         'name' => 'Nome',
+        'unit_id' => 'Unidade',
         'fantasy_name' => 'Nome Fantasia',
         'social_reason' => 'Razão Social',
+        'social_name' => 'Nome Social',
+        'role' => 'Cargo',
         'cnpj' => 'CNPJ',
+        'cpf' => 'CPF',
+        'rg' => 'RG',
+        'birth_date' => 'Data de Nascimento',
+        'participation' => 'Participação',
         'state_registration' => 'Inscrição Estadual',
         'name_responsible' => 'Nome do Responsável',
         'street' => 'Rua',