<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\dice\validate\reward_config;

use plugin\saiadmin\basic\BaseValidate;

/**
 * 奖励配置验证器（DiceRewardConfig；BIGWIN 的 weight 存本表，0-10000）
 */
class DiceRewardConfigValidate extends BaseValidate
{
    /** 色子点数范围：5～30 共 26 个点数 */
    public const GRID_NUMBER_MIN = 5;
    public const GRID_NUMBER_MAX = 30;

    protected $rule = [
        'grid_number'   => 'require|integer|between:5,30',
        'ui_text'       => 'require',
        'ui_text_en'    => 'max:255',
        'real_ev'       => 'require',
        'tier'          => 'require',
        'type'          => 'number',
        'weight'        => 'number|between:0,10000', // BIGWIN 大奖权重，仅档位为 BIGWIN 时使用
        'remark'        => 'max:500',
    ];

    protected $message = [
        'grid_number'   => '色子点数必须为 5～30 之间的整数（共26个点数）',
        'ui_text'       => '前端显示文本必须填写',
        'real_ev'       => '真实资金结算必须填写',
        'tier'          => '所属档位必须填写',
        'type'          => '奖励类型须为数字',
    ];

    protected $scene = [
        'save'          => ['grid_number', 'ui_text', 'ui_text_en', 'real_ev', 'tier', 'type'],
        'update'        => ['grid_number', 'ui_text', 'ui_text_en', 'real_ev', 'tier', 'type', 'weight', 'remark'],
        'batch_update'  => ['grid_number', 'ui_text', 'ui_text_en', 'real_ev', 'tier', 'remark'],
    ];
}
