<?php

namespace app\admin\validate\member;

use support\Validate;

class RoleValidate extends Validate
{
    protected $rule = [
        'member_role_id|ID' => 'require|alphaDash',
        'join_member_role_category_id|系统分类' => 'integer',
//        'join_member_role_rule_pricing_id|计价规则' => 'alphaDash',
        'member_role_status|状态' => 'in:ACTIVED,DISABLED',
        'member_role_category|等级分类' => 'max:32',
        'member_role_name|等级名称' => 'require|max:64',
        'member_role_range_begin|区间起始' => 'float',
        'member_role_range_end|区间截止' => 'float',
        'member_role_sort|排序' => 'integer',
        'member_role_groupby|分组' => 'max:32',
    ];

    protected $message = [];

    protected $scene = [
        'add' => ['join_member_role_category_id', 'member_role_status', 'member_role_category',
            'member_role_name', 'member_role_range_begin', 'member_role_range_end', 'member_role_sort', 'member_role_groupby'],
        'update' => ['member_role_id', 'join_member_role_category_id', 'member_role_status', 'member_role_category',
            'member_role_name', 'member_role_range_begin', 'member_role_range_end', 'member_role_sort', 'member_role_groupby'],
    ];
}