<?php

namespace App\Http\Requests\QuestionBank\QuestionBackend;

use App\Http\Requests\BaseRequest;

/**
 * 奖金流程配置管理接口验证
 * @author 唐远望
 * @version 1.0
 * @date 2025-06-26
 * 
 */
class BonusDeclarationProcess 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',
            'process_title'     => 'required',
            'process_status'    => 'required|integer|in:1,2,3',
            'start_time'        => 'required',
            'end_time'          => 'required',
            'process_prompt'    => 'required',
            'submit_prompt'     => 'required',
        ];
    }


    // 场景列表
    protected   $scenes         = [
        'detail'             => [],
        'list'               => ['page', 'limit'],
        'add'                      => ['process_title', 'process_status', 'start_time', 'end_time', 'process_prompt', 'submit_prompt'],
        'edit'                  => ['id', 'process_title', 'process_status', 'start_time', 'process_prompt', 'submit_prompt'],
        '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'         => '每页数量格式错误',
            'process_title.required'     => '流程标题必填',
            'process_status.required'    => '流程状态必填',
            'process_status.integer'     => '流程状态格式错误',
            'process_status.in'          => '流程状态格式错误',
            'start_time.required'        => '开始时间必填',
            'end_time.required'          => '结束时间必填',
            'process_prompt.required'    => '流程提示必填',
            'submit_prompt.required'     => '提交提示必填',
        ];
    }
}
