feat: 2.3 카드/계좌 관리 API 구현
- cards, bank_accounts 테이블 마이그레이션 - Card, BankAccount 모델 (카드번호 암호화) - CardService, BankAccountService - CardController, BankAccountController + FormRequest 4개 - API 엔드포인트 15개 (카드 7개, 계좌 8개) - Swagger 문서 (CardApi.php, BankAccountApi.php)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\BankAccount;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateBankAccountRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'bank_code' => ['sometimes', 'string', 'max:10'],
|
||||
'bank_name' => ['sometimes', 'string', 'max:50'],
|
||||
'account_number' => ['sometimes', 'string', 'max:30', 'regex:/^[\d-]+$/'],
|
||||
'account_holder' => ['sometimes', 'string', 'max:50'],
|
||||
'account_name' => ['sometimes', 'string', 'max:100'],
|
||||
'status' => ['sometimes', 'string', 'in:active,inactive'],
|
||||
'assigned_user_id' => ['nullable', 'integer', 'exists:users,id'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'account_number.regex' => __('validation.account_number_format'),
|
||||
];
|
||||
}
|
||||
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'bank_code' => __('validation.attributes.bank_code'),
|
||||
'bank_name' => __('validation.attributes.bank_name'),
|
||||
'account_number' => __('validation.attributes.account_number'),
|
||||
'account_holder' => __('validation.attributes.account_holder'),
|
||||
'account_name' => __('validation.attributes.account_name'),
|
||||
'status' => __('validation.attributes.status'),
|
||||
'assigned_user_id' => __('validation.attributes.assigned_user_id'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user