- Plan/Subscription/Payment 모델에 상태 상수, 스코프, 헬퍼 메서드 추가 - PlanService, SubscriptionService, PaymentService 생성 - PlanController, SubscriptionController, PaymentController 생성 - FormRequest 9개 생성 (Plan 3개, Subscription 3개, Payment 3개) - Swagger 문서 3개 생성 (PlanApi, SubscriptionApi, PaymentApi) - API 라우트 22개 등록 (Plan 7개, Subscription 8개, Payment 7개) - Pint 코드 스타일 정리
30 lines
926 B
PHP
30 lines
926 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V1\Payment;
|
|
|
|
use App\Models\Tenants\Payment;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class PaymentIndexRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'status' => ['nullable', 'string', Rule::in(Payment::STATUSES)],
|
|
'payment_method' => ['nullable', 'string', Rule::in(Payment::PAYMENT_METHODS)],
|
|
'start_date' => ['nullable', 'date'],
|
|
'end_date' => ['nullable', 'date', 'after_or_equal:start_date'],
|
|
'search' => ['nullable', 'string', 'max:100'],
|
|
'sort_by' => ['nullable', 'string', 'in:created_at,paid_at,amount'],
|
|
'sort_dir' => ['nullable', 'string', 'in:asc,desc'],
|
|
'per_page' => ['nullable', 'integer', 'min:1', 'max:100'],
|
|
];
|
|
}
|
|
}
|