fix(WEB): 입고 등록 검증 실패 수정 - Store 규칙 보완 및 상태값 정합성
- StoreReceivingRequest에 receiving_qty, receiving_date, lot_no 규칙 추가 - UpdateReceivingRequest status에 inspection_completed 허용 추가 - ReceivingService store()에 receiving_qty/date/lot_no 저장 처리 - order_qty null 안전 처리, 기본 status를 receiving_pending으로 변경 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,9 @@ public function rules(): array
|
|||||||
'order_qty' => ['nullable', 'numeric', 'min:0'],
|
'order_qty' => ['nullable', 'numeric', 'min:0'],
|
||||||
'order_unit' => ['nullable', 'string', 'max:20'],
|
'order_unit' => ['nullable', 'string', 'max:20'],
|
||||||
'due_date' => ['nullable', 'date'],
|
'due_date' => ['nullable', 'date'],
|
||||||
|
'receiving_qty' => ['nullable', 'numeric', 'min:0'],
|
||||||
|
'receiving_date' => ['nullable', 'date'],
|
||||||
|
'lot_no' => ['nullable', 'string', 'max:50'],
|
||||||
'status' => ['nullable', 'string', 'in:order_completed,shipping,inspection_pending,receiving_pending'],
|
'status' => ['nullable', 'string', 'in:order_completed,shipping,inspection_pending,receiving_pending'],
|
||||||
'remark' => ['nullable', 'string', 'max:1000'],
|
'remark' => ['nullable', 'string', 'max:1000'],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public function rules(): array
|
|||||||
'order_qty' => ['sometimes', 'numeric', 'min:0'],
|
'order_qty' => ['sometimes', 'numeric', 'min:0'],
|
||||||
'order_unit' => ['nullable', 'string', 'max:20'],
|
'order_unit' => ['nullable', 'string', 'max:20'],
|
||||||
'due_date' => ['nullable', 'date'],
|
'due_date' => ['nullable', 'date'],
|
||||||
'status' => ['sometimes', 'string', 'in:order_completed,shipping,inspection_pending,receiving_pending,completed'],
|
'status' => ['sometimes', 'string', 'in:order_completed,shipping,inspection_pending,receiving_pending,completed,inspection_completed'],
|
||||||
'remark' => ['nullable', 'string', 'max:1000'],
|
'remark' => ['nullable', 'string', 'max:1000'],
|
||||||
'receiving_qty' => ['nullable', 'numeric', 'min:0'],
|
'receiving_qty' => ['nullable', 'numeric', 'min:0'],
|
||||||
'receiving_date' => ['nullable', 'date'],
|
'receiving_date' => ['nullable', 'date'],
|
||||||
|
|||||||
@@ -194,10 +194,13 @@ public function store(array $data): Receiving
|
|||||||
$receiving->item_name = $data['item_name'];
|
$receiving->item_name = $data['item_name'];
|
||||||
$receiving->specification = $data['specification'] ?? null;
|
$receiving->specification = $data['specification'] ?? null;
|
||||||
$receiving->supplier = $data['supplier'];
|
$receiving->supplier = $data['supplier'];
|
||||||
$receiving->order_qty = $data['order_qty'];
|
$receiving->order_qty = $data['order_qty'] ?? null;
|
||||||
$receiving->order_unit = $data['order_unit'] ?? 'EA';
|
$receiving->order_unit = $data['order_unit'] ?? 'EA';
|
||||||
$receiving->due_date = $data['due_date'] ?? null;
|
$receiving->due_date = $data['due_date'] ?? null;
|
||||||
$receiving->status = $data['status'] ?? 'order_completed';
|
$receiving->receiving_qty = $data['receiving_qty'] ?? null;
|
||||||
|
$receiving->receiving_date = $data['receiving_date'] ?? null;
|
||||||
|
$receiving->lot_no = $data['lot_no'] ?? null;
|
||||||
|
$receiving->status = $data['status'] ?? 'receiving_pending';
|
||||||
$receiving->remark = $data['remark'] ?? null;
|
$receiving->remark = $data['remark'] ?? null;
|
||||||
|
|
||||||
// options 필드 처리 (제조사, 수입검사 등 확장 필드)
|
// options 필드 처리 (제조사, 수입검사 등 확장 필드)
|
||||||
|
|||||||
Reference in New Issue
Block a user