<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台（PHP版）
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码，建议反馈是我们前进的动力
// | 开源版本可自由商用，可去除界面版权logo
// | gitee下载：https://gitee.com/likeshop_gitee/likeadmin
// | github下载：https://github.com/likeshop-github/likeadmin
// | 访问官网：https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------

namespace app\adminapi\validate\works;


use app\common\validate\BaseValidate;


/**
 * ServiceWork验证器
 * Class ServiceWorkValidate
 * @package app\adminapi\validate\works
 */
class ServiceWorkValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'work_sn' => 'require',
        'mobile' => 'require',
        'address' => 'require',
        'title' => 'require',
        'category_type' => 'require',
        'goods_category_ids' => 'require',
        'goods_category_id' => 'require',
        'base_service_fee' => 'require',
        'service_fee' => 'require',
        'work_status' => 'require',
        'service_status' => 'require',
        'dispatch_time' => 'require',
        'receive_time' => 'require',
        'appointment_time' => 'require',
        'finished_time' => 'require',
        'master_worker_id' => 'require',

    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'work_sn' => '工单编号',
        'mobile' => '手机号',
        'address' => '客户地址',
        'title' => '工单名称',
        'category_type' => '服务类别',
        'goods_category_ids' => '服务类目',
        'goods_category_id' => '服务产品',
        'base_service_fee' => '基础服务费',
        'service_fee' => '服务费用',
        'work_status' => '工单状态',
        'service_status' => '订单服务状态',
        'dispatch_time' => '派单时间',
        'receive_time' => '领单时间',
        'appointment_time' => '预约上门时间',
        'finished_time' => '结单时间',
        'master_worker_id' => '工程师',

    ];


    /**
     * @notes 添加场景
     * @return ServiceWorkValidate
     * @author likeadmin
     * @date 2024/07/10 15:06
     */
    public function sceneAdd()
    {
        return $this->only(['work_sn','mobile','address','title','category_type','goods_category_ids','goods_category_id','base_service_fee','service_fee','work_status','service_status','dispatch_time','receive_time','appointment_time','finished_time','master_worker_id']);
    }


    /**
     * @notes 编辑场景
     * @return ServiceWorkValidate
     * @author likeadmin
     * @date 2024/07/10 15:06
     */
    public function sceneEdit()
    {
        return $this->only(['id','address','appointment_time','lon','lat']);
    }


    /**
     * @notes 删除场景
     * @return ServiceWorkValidate
     * @author likeadmin
     * @date 2024/07/10 15:06
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


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

    /**
     * 分配工程师场景
     * @return ServiceWorkValidate
     * @author 林海涛
     * @date 2024/7/16 下午4:38
     */
    public function sceneAllocateWorker()
    {
        return $this->only(['id','master_worker_id']);
    }
}