<?php

namespace app\admin\validate\medical;

use support\Validate;

class ReservationServiceValidate extends Validate
{
    protected $rule = [
        'service_id' => 'require|integer',
        'service_category_id' => 'require|integer',
        'service_shop_id' => 'require|integer',
        'service_name|名称' => 'require',
        'service_price|价格' => 'require|float',
        'service_avatar|头像' => 'regex:/^[0-9a-zA-Z\.\/]+$/',
        'service_type|是否支持多次预约' => 'in:0,1',
        'service_hour_count|每小时可预约人数' => 'integer',
        'service_audit' => 'in:0,1,2',
        'service_status' => 'require|in:0,1'
    ];

    protected $message = [];

    protected $scene = [
        'add' => ['service_category_id', 'service_shop_id', 'service_name', 'service_price', 'service_avatar', 'service_type',
            'service_hour_count', 'service_audit', 'service_status'],
        'update' => ['service_id', 'service_category_id', 'service_shop_id', 'service_name', 'service_price', 'service_avatar', 'service_type',
            'service_hour_count', 'service_audit', 'service_status'],
    ];
}