<?php
namespace app\workerapi\validate;


use app\common\validate\BaseValidate;


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

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'work_sn' => 'require',
        'mobile' => 'require',
        'address' => 'require',
        'work_status' => 'require',
        'service_status' => 'require',
        'appointment_time' => 'require|dateFormat:Y/m/d H:i:s',
        'finished_images'=>'require',
        'work_images'=>'require',
        'code' => 'require',
    ];

    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'work_sn' => '工单编号',
        'mobile' => '手机号',
        'address' => '客户地址',
        'work_status' => '工单状态',
        'service_status' => '订单服务状态',
        'appointment_time' => '预约上门时间',
        'finished_time' => '结单时间',
        'finished_images'=>'完结服务拍照',
        'work_images'=>'工作拍照',
        'code' => '工单验证码'
    ];

    /**
     * 领取场景
     * @return ServiceWorkValidate
     */
    public function sceneDetail()
    {
        return $this->only(['*']);
    }

    /**
     * 确认上门场景
     * @return ServiceWorkValidate
     */
    public function sceneDoor()
    {
        return $this->only(['work_sn','work_images']);
    }

    public function sceneFinished()
    {
        return $this->only(['work_sn','finished_images','code']);
    }

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