StudentContractRequest.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class StudentContractRequest extends FormRequest
  5. {
  6. public function rules(): array
  7. {
  8. return [
  9. 'student_id' => 'required|exists:students,id',
  10. 'protocol' => 'sometimes|nullable|string|max:255',
  11. 'signature_date' => 'sometimes|nullable|date_format:Y-m-d',
  12. 'end_date' => 'sometimes|nullable|date_format:Y-m-d',
  13. 'class_package_unit_id' => 'sometimes|nullable|exists:class_package_units,id',
  14. 'class_quantity' => 'sometimes|nullable|integer|min:1',
  15. 'weekday' => 'sometimes|nullable|integer|min:0|max:6',
  16. 'start_time' => 'sometimes|nullable|date_format:H:i',
  17. 'end_time' => 'sometimes|nullable|date_format:H:i',
  18. 'second_weekday' => 'sometimes|nullable|integer|min:0|max:6',
  19. 'second_start_time' => 'sometimes|nullable|date_format:H:i',
  20. 'second_end_time' => 'sometimes|nullable|date_format:H:i',
  21. 'due_date' => 'sometimes|nullable|date_format:Y-m-d',
  22. 'tax_register' => 'sometimes|nullable|numeric|min:0',
  23. 'down_payment' => 'sometimes|nullable|numeric|min:0',
  24. 'installments' => 'sometimes|nullable|integer|min:1|max:12',
  25. 'early_payment_discount' => 'sometimes|nullable|numeric|min:0|max:100',
  26. 'material_value' => 'sometimes|nullable|numeric|min:0',
  27. 'material_installments' => 'sometimes|nullable|integer|min:1|max:12',
  28. 'interest_rate' => 'sometimes|nullable|numeric|min:0',
  29. 'payment_method' => 'sometimes|nullable|string|in:pix,credit_card,debit_card',
  30. 'fine_cancelled' => 'sometimes|nullable|numeric|min:0|max:100',
  31. ];
  32. }
  33. }