<?php

namespace App\Http\Requests\QuestionBank\QuestionReception;

use App\Http\Requests\BaseRequest;

/**
 * 奖金申报管理接口验证
 * @author 唐远望
 * @version 1.0
 * @date 2025-06-09
 * 
 */
class BonusDeclaration extends BaseRequest
{
    /**
     * 获取应用于请求的规则
     *
     * @return array
     */
    public function rules()
    {
        // 返回结果
        return      [
            'name'                 => 'required',
            'id'                => 'required|integer|gt:0',
            'status'            => 'required|integer|in:0,1',
            'page'              => 'integer|min:1',
            'limit'             => 'integer|min:1',
            'admission_ticket_image' => 'required',
            'registration_area'  => 'required',
            'candidate_name'     => 'required',
            'id_number'          => 'required',
            'major_name'         => 'required',
            'contact_number'     => 'required',
            'score_screenshot'   => 'required',
            'qualification_certificate'   => 'required',
        ];
    }


    // 场景列表
    protected   $scenes         = [
        'detail'             => [],
        'list'               => ['page', 'limit'],
        'add'                      => ['admission_ticket_image', 'registration_area', 'candidate_name', 'id_number', 'major_name', 'contact_number'],
        'edit_one'                  => ['score_screenshot'],
        'edit_two'                  => ['qualification_certificate'],
        'set_status'              => ['id', 'status'],
        'delete'                  => ['id'],
    ];

    /**
     * 获取已定义验证规则的错误消息
     *
     * @return array
     */
    public function messages()
    {
        return [
            'name.required'     => '名称必填',
            'id.required'       => 'ID未知',
            'id.integer'        => 'ID格式错误',
            'id.gt'               => 'ID格式错误',
            'status.required'   => '状态未知',
            'status.integer'    => '状态格式错误',
            'status.in'         => '状态格式错误',
            'page.integer'      => '页码格式错误',
            'page.min'          => '页码格式错误',
            'limit.integer'     => '每页数量格式错误',
            'limit.min'         => '每页数量格式错误',
            'admission_ticket_image.required' => '准考证图片未上传',
            'registration_area.required' => '报考地区未选择',
            'candidate_name.required' => '考生姓名未填写',
            'id_number.required' => '身份证号码未填写',
            'major_name.required' => '专业名称未填写',
            'contact_number.required' => '联系电话未填写',
            'score_screenshot.required' => '成绩单未上传',
            'qualification_certificate.required' => '资格证书未上传',
        ];
    }
}
