<?php
namespace app\workerapi\validate;


use app\common\validate\BaseValidate;


/**
 * ReturnWork验证器
 * Class ReturnWorkValidate
 * @package app\workerapi\validate\works
 */
class ReturnWorkValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'work_sn' => 'require',
        'return_work_status' => 'require',
        'dispatch_time' => 'require',
        'appointment_time' => 'require|dateFormat:Y/m/d H:i:s',
        'finished_time' => 'require',
        'master_worker_id' => 'require',

    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'work_sn' => '工单编号',
        'return_work_status' => '返修工单状态',
        'dispatch_time' => '派单时间',
        'appointment_time' => '预约上门时间',
        'finished_time' => '结单时间',
        'master_worker_id' => '工程师',

    ];

    /**
     * @notes 详情场景
     * @return ReturnWorkValidate
     * @author whitef
     * @date 2024/07/10 15:06
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }

    public function sceneUpdate()
    {
        return $this->only(['id','finished_images']);
    }

    public function sceneAppointWork()
    {
        return $this->only(['id','appointment_time']);
    }

    public function sceneConfirmDoor()
    {
        return $this->only(['work_sn']);
    }
}