refactor: 하드코딩된 validation을 common_codes 기반으로 변경
- item_type_code: 기존 PRODUCT,MATERIAL 고정값 → common_codes 조회 - margin_rate: max:100 제한 제거 (100% 초과 마진 허용) - client_type: 매입/매출/매입매출 common_codes로 이동 - bad_debt_progress: 협의중/소송중/회수완료/대손처리 common_codes로 이동 - product_category: 스크린/스틸 common_codes로 이동 - 마이그레이션 추가: client_type, bad_debt_progress, product_category 코드 그룹 수정 파일: - PriceStoreRequest, PriceUpdateRequest - ClientStoreRequest, ClientUpdateRequest - QuoteStoreRequest, QuoteUpdateRequest 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Http\Requests\Quote;
|
||||
|
||||
use App\Models\Quote\Quote;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class QuoteStoreRequest extends FormRequest
|
||||
{
|
||||
@@ -33,7 +33,10 @@ public function rules(): array
|
||||
'site_code' => 'nullable|string|max:50',
|
||||
|
||||
// 제품 정보
|
||||
'product_category' => 'nullable|in:'.Quote::CATEGORY_SCREEN.','.Quote::CATEGORY_STEEL,
|
||||
'product_category' => [
|
||||
'nullable',
|
||||
Rule::exists('common_codes', 'code')->where('code_group', 'product_category'),
|
||||
],
|
||||
'product_id' => 'nullable|integer',
|
||||
'product_code' => 'nullable|string|max:50',
|
||||
'product_name' => 'nullable|string|max:100',
|
||||
|
||||
Reference in New Issue
Block a user