<?php

namespace  App\Http\Requests\OpenWork\External;

use App\Http\Requests\BaseRequest;

/**
 * 客户继承接口校验规则
 * @author  唐远望
 * @date    2025-04-03
 * */
class Contact extends BaseRequest
{

    /**
     *
     * @return  array
     */
    public  function  rules()
    {
        // 规则
        return [
            'corpid'              => 'required',
            'handover_userid'     => 'required',
            'takeover_userid'     => 'required',
            'external_userid'     => 'required',
            'chat_id_list'        => 'required',
            'new_owner'           => 'required',
        ];
    }

    // 场景列表
    protected   $scenes         = [
        'assignStaffCustomers'                      => ['corpid', 'handover_userid', 'takeover_userid', 'external_userid'],
        'assignStaffCustomersBatch'                      => ['corpid', 'handover_userid', 'takeover_userid', 'external_userid'],
        'queryTransferStatus'                      => ['corpid', 'handover_userid', 'takeover_userid', 'cursor'],
        'get_external_contact_list'                => ['corpid'],
        'query_resignation_handover_status'                => ['corpid', 'handover_userid', 'takeover_userid', 'cursor'],
        'assign_external_contact_to_staff_groups'  => ['corpid', 'chat_id_list', 'new_owner'],
        'assignStaffCustomerGroups'                => ['corpid', 'chat_id_list', 'new_owner'],
        'assign_external_contact_to_staff'      => ['corpid', 'handover_userid', 'takeover_userid', 'external_userid'],
        'assignStaffCustomerGroups'                => ['corpid', 'chat_id_list', 'new_owner'],
        'assign_external_contact_to_staff_batch'         =>  ['corpid', 'handover_userid', 'takeover_userid', 'external_userid'],
    ];

    /**
     *
     * @return  array
     */
    public  function  messages()
    {
        return [
            'corpid.required'           => '企业ID不能为空',
            'handover_userid.required'  => '接手人不能为空',
            'takeover_userid.required'  => '接管人不能为空',
            'external_userid.required'  => '外部联系人不能为空',
            'chat_id_list.required'     => '群聊ID不能为空',
            'new_owner.required'        => '新群主不能为空',
            'corpid.required'           => '授权方企业微信id不能为空',
            'handover_userid.required'  => '原跟进成员的userid不能为空',
            'takeover_userid.required'  => '接替成员的userid不能为空',
            'external_userid.required'  => '客户的external_userid列表不能为空',
            'chat_id_list.required'     => '需要转群主的客户群ID列表不能为空',
            'new_owner.required'        => '新群主ID不能为空',
        ];
    }
}
