Files
sam-api/app/Http/Requests/Quote/QuoteIndexRequest.php
hskwon 40ca8b8697 feat: [quote] 견적 API Phase 2-3 완료 (Service + Controller Layer)
Phase 2 - Service Layer:
- QuoteService: 견적 CRUD + 상태관리 (확정/전환)
- QuoteNumberService: 견적번호 채번 (KD-{PREFIX}-YYMMDD-SEQ)
- FormulaEvaluatorService: 수식 평가 엔진 (SUM, IF, ROUND 등)
- QuoteCalculationService: 자동산출 (스크린/철재 제품)
- QuoteDocumentService: PDF 생성 및 이메일/카카오 발송

Phase 3 - Controller Layer:
- QuoteController: 16개 엔드포인트
- FormRequest 7개: Index, Store, Update, BulkDelete, Calculate, SendEmail, SendKakao
- QuoteApi.php: Swagger 문서 (12개 스키마, 16개 엔드포인트)
- routes/api.php: 16개 라우트 등록

i18n 키 추가:
- error.php: quote_not_found, formula_* 등
- message.php: quote.* 성공 메시지
2025-12-04 22:03:40 +09:00

38 lines
1.2 KiB
PHP

<?php
namespace App\Http\Requests\Quote;
use App\Models\Quote\Quote;
use Illuminate\Foundation\Http\FormRequest;
class QuoteIndexRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'page' => 'nullable|integer|min:1',
'size' => 'nullable|integer|min:1|max:100',
'q' => 'nullable|string|max:100',
'status' => 'nullable|in:'.implode(',', [
Quote::STATUS_DRAFT,
Quote::STATUS_SENT,
Quote::STATUS_APPROVED,
Quote::STATUS_REJECTED,
Quote::STATUS_FINALIZED,
Quote::STATUS_CONVERTED,
]),
'product_category' => 'nullable|in:'.Quote::CATEGORY_SCREEN.','.Quote::CATEGORY_STEEL,
'client_id' => 'nullable|integer',
'date_from' => 'nullable|date',
'date_to' => 'nullable|date|after_or_equal:date_from',
'sort_by' => 'nullable|in:registration_date,quote_number,client_name,total_amount,status,created_at',
'sort_order' => 'nullable|in:asc,desc',
];
}
}