Browse Source

feat(students): add company and profession to responsible

alvesantos 1 tuần trước cách đây
mục cha
commit
bbe529fe06

+ 4 - 0
app/Http/Requests/StudentResponsibleRequest.php

@@ -28,6 +28,8 @@ public function rules(): array
 
             'gender' => 'nullable|string|in:male,female,other,no_preference',
             'degree' => 'required|string|max:255',
+            'company' => 'required|string|max:255',
+            'profession' => 'required|string|max:255',
 
             'email' => [
                 'required',
@@ -59,6 +61,8 @@ public function messages(): array
             'birth_date.required'   => 'A data de nascimento é obrigatória.',
             'cpf.required'          => 'O CPF é obrigatório.',
             'degree.required'       => 'O grau de parentesco é obrigatório.',
+            'company.required'      => 'A empresa é obrigatória.',
+            'profession.required'   => 'A profissão é obrigatória.',
             'email.required'        => 'O e-mail é obrigatório.',
             'email.email'           => 'Informe um e-mail válido.',
             'phone.required'        => 'O telefone é obrigatório.',

+ 2 - 0
app/Http/Resources/StudentResponsibleResource.php

@@ -25,6 +25,8 @@ public function toArray(Request $request): array
             'cpf'            => $this->cpf,
             'gender'         => $this->gender,
             'degree'         => $this->degree,
+            'company'        => $this->company,
+            'profession'     => $this->profession,
             'email'          => $this->email,
             'phone'          => $this->phone,
             'street'         => $this->street,

+ 29 - 0
database/migrations/2026_09_01_115425_add_company_and_profession_to_student_responsibles_table.php

@@ -0,0 +1,29 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     */
+    public function up(): void
+    {
+        Schema::table('student_responsibles', function (Blueprint $table) {
+            $table->string('company')->nullable();
+            $table->string('profession')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     */
+    public function down(): void
+    {
+        Schema::table('student_responsibles', function (Blueprint $table) {
+            $table->dropColumn(['company', 'profession']);
+        });
+    }
+};

+ 2 - 2
resources/views/student-contracts/contract.blade.php

@@ -168,7 +168,7 @@
             <div class="line"><strong>CONTRATANTE:</strong> {{ $contractor?->name }}</div>
             <div class="line"><strong>PARENTESCO:</strong> {{ $responsible?->degree }}</div>
             <div class="line"><strong>DATA NASC.:</strong> {{ $date($contractor?->birth_date) }}</div>
-            <div class="line"><strong>PROFISSÃO:</strong></div>
+            <div class="line"><strong>PROFISSÃO:</strong> {{ $contractor?->profession }}</div>
             <div class="line"><strong>ENDEREÇO:</strong> {{ $address($contractor) }}</div>
             <div class="line"><strong>BAIRRO:</strong> {{ $contractor?->neighborhood }}</div>
             <div class="line"><strong>CELULAR:</strong> {{ $formatPhone($contractor?->phone) }}</div>
@@ -177,7 +177,7 @@
             <div class="line"><strong>CPF:</strong> {{ $formatDocument($responsible?->cpf ?: $student?->document_number) }}</div>
             <div class="line"><strong>RG:</strong></div>
             <div class="line"><strong>E-MAIL:</strong> {{ $contractor?->email }}</div>
-            <div class="line"><strong>EMPRESA:</strong></div>
+            <div class="line"><strong>EMPRESA:</strong> {{ $contractor?->company }}</div>
             <div class="line"><strong>COMPLEMENTO:</strong> {{ $contractor?->complement }}</div>
             <div class="line"><strong>CEP:</strong> {{ $formatPostalCode($contractor?->postal_code) }}</div>
         </td>