- 마이그레이션: deposits, withdrawals 테이블 생성 - 모델: Deposit, Withdrawal (BelongsToTenant, SoftDeletes) - 서비스: DepositService, WithdrawalService (CRUD + summary) - 컨트롤러: DepositController, WithdrawalController - FormRequest: Store/Update 검증 클래스 - Swagger: 입금/출금 API 문서 (12개 엔드포인트) - 라우트: /v1/deposits, /v1/withdrawals 등록
44 lines
1.6 KiB
PHP
44 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V1\Withdrawal;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateWithdrawalRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'withdrawal_date' => ['sometimes', 'date'],
|
|
'client_id' => ['nullable', 'integer', 'exists:clients,id'],
|
|
'client_name' => ['nullable', 'string', 'max:100'],
|
|
'bank_account_id' => ['nullable', 'integer', 'exists:bank_accounts,id'],
|
|
'amount' => ['sometimes', 'numeric', 'min:0'],
|
|
'payment_method' => ['sometimes', 'string', 'in:cash,transfer,card,check'],
|
|
'account_code' => ['nullable', 'string', 'max:20'],
|
|
'description' => ['nullable', 'string', 'max:1000'],
|
|
'reference_type' => ['nullable', 'string', 'max:50'],
|
|
'reference_id' => ['nullable', 'integer'],
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'withdrawal_date' => __('validation.attributes.withdrawal_date'),
|
|
'client_id' => __('validation.attributes.client_id'),
|
|
'client_name' => __('validation.attributes.client_name'),
|
|
'bank_account_id' => __('validation.attributes.bank_account_id'),
|
|
'amount' => __('validation.attributes.amount'),
|
|
'payment_method' => __('validation.attributes.payment_method'),
|
|
'account_code' => __('validation.attributes.account_code'),
|
|
'description' => __('validation.attributes.description'),
|
|
];
|
|
}
|
|
}
|