feat(quote-formulas): 견적수식 관리 기능 구현
## 구현 내용 ### 모델 (5개) - QuoteFormulaCategory: 수식 카테고리 - QuoteFormula: 수식 정의 (input/calculation/range/mapping) - QuoteFormulaRange: 범위별 값 정의 - QuoteFormulaMapping: 매핑 테이블 - QuoteFormulaItem: 수식-품목 연결 ### 서비스 (3개) - QuoteFormulaCategoryService: 카테고리 CRUD - QuoteFormulaService: 수식 CRUD, 복제, 재정렬 - FormulaEvaluatorService: 수식 계산 엔진 - 지원 함수: SUM, ROUND, CEIL, FLOOR, ABS, MIN, MAX, IF, AND, OR, NOT ### API Controller (2개) - QuoteFormulaCategoryController: 카테고리 API (11개 엔드포인트) - QuoteFormulaController: 수식 API (16개 엔드포인트) ### FormRequest (4개) - Store/Update QuoteFormulaCategoryRequest - Store/Update QuoteFormulaRequest ### Blade Views (8개) - 수식 목록/추가/수정/시뮬레이터 - 카테고리 목록/추가/수정 - HTMX 테이블 partial ### 라우트 - API: 27개 엔드포인트 - Web: 7개 라우트
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Quote;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateQuoteFormulaCategoryRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'code' => 'sometimes|required|string|max:50|regex:/^[A-Z][A-Z0-9_]*$/',
|
||||
'name' => 'sometimes|required|string|max:100',
|
||||
'description' => 'nullable|string|max:500',
|
||||
'sort_order' => 'nullable|integer|min:1',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'code.required' => '카테고리 코드는 필수입니다.',
|
||||
'code.regex' => '카테고리 코드는 대문자로 시작하고 대문자, 숫자, 언더스코어만 사용할 수 있습니다.',
|
||||
'code.max' => '카테고리 코드는 50자 이하로 입력해주세요.',
|
||||
'name.required' => '카테고리 이름은 필수입니다.',
|
||||
'name.max' => '카테고리 이름은 100자 이하로 입력해주세요.',
|
||||
'description.max' => '설명은 500자 이하로 입력해주세요.',
|
||||
'sort_order.integer' => '정렬 순서는 숫자로 입력해주세요.',
|
||||
'sort_order.min' => '정렬 순서는 1 이상이어야 합니다.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user