<?php
namespace app\finance\validate;

use think\Validate;

class CreditWriteoffValidate extends Validate
{
    protected $rule = [
        'customer_id'     => 'require|max:100',
        'trade_scene'     => 'require|max:255',
        'daily_trade_vol' => 'require|max:100',
        'credit_amount'   => 'require|max:50',
        'return_date'     => 'require|date',
    ];

    protected $message = [
        'customer_id.require'     => '客户ID不能为空',
        'trade_scene.require'     => '客户交易场景不能为空',
        'daily_trade_vol.require' => '客户日交易量不能为空',
        'credit_amount.require'   => '申请授信金额不能为空',
        'return_date.require'     => '请选择归还日期',
        'return_date.date'        => '归还日期格式不正确',
    ];

    protected $scene = [
        'add'  => ['customer_id', 'trade_scene', 'daily_trade_vol', 'credit_amount', 'return_date'],
        'edit' => ['customer_id', 'trade_scene', 'daily_trade_vol', 'credit_amount', 'return_date'],
    ];
}
