<?php

namespace App\Http\Requests\OpenWork\External;

use App\Http\Requests\BaseRequest;

/**
 * 成员继承记录接口验证
 * @author 唐远望
 * @version 1.0
 * @date 2025-07-01
 * 
 */
class AllocationRecords 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',
            'corpid'            => 'required',
            'external_userid'   => 'required',
            'original_followup_person'   => 'required',
            'current_followup_person'   => 'required',
            'operator_userid'   => 'required',
            'inherit_type'      => 'required',
            'status'    => 'required',
            'follow_userid' => 'required',
        ];
    }


    // 场景列表
    protected   $scenes         = [
        'detail'             => [],
        'list'               => ['page', 'limit'],
        'add'                      => ['corpid', 'external_userid', 'original_followup_person', 'current_followup_person', 'operator_userid', 'inherit_type','status'],
        'edit_one'                  => ['score_screenshot'],
        'edit_two'                  => ['qualification_certificate'],
        'set_status'              => ['id', 'status'],
        'delete'                  => ['id'],
        'user_list'              => ['corpid','page','limit','follow_userid']
    ];

    /**
     * 获取已定义验证规则的错误消息
     *
     * @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'         => '每页数量格式错误',
            'corpid.required'   => '企业ID未知',
            'external_userid.required'   => '外部联系人ID未知',
            'original_followup_person.required'   => '原跟进人未知',
            'current_followup_person.required'   => '当前跟进人未知',
            'operator_userid.required'   => '操作人未知',
            'inherit_type.required'   => '继承类型未知',
            'status.required'   => '转移状态未知',
            'follow_userid.required'   => '跟进人未知',
        ];
    }
}
