WuYongJie 2b6c4030e5
Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
chore: 补充财务与支付模块源码
2026-07-20 18:40:05 +08:00

36 lines
1.1 KiB
PHP

<?php
namespace Modules\EcommerceFinance\Http\Requests;
use App\Abstracts\Http\FormRequest;
use Illuminate\Validation\Rule;
class Store extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'channel_id' => ['required', 'integer', Rule::exists('ec_channels', 'id')->where('company_id', company_id())],
'name' => ['required', 'string', 'max:255'],
'external_id' => [
'required',
'string',
'max:128',
Rule::unique('ec_stores', 'external_id')
->where('company_id', company_id())
->where('channel_id', $this->input('channel_id'))
->ignore($this->route('store')),
],
'settlement_account_id' => ['nullable', 'integer', Rule::exists('accounts', 'id')->where('company_id', company_id())],
'timezone' => ['sometimes', 'timezone'],
'currency_code' => ['sometimes', 'string', 'size:3'],
'enabled' => ['sometimes', 'boolean'],
];
}
}