From 77f2ef2cd5652a6454d7fef0abfd69486638e44f Mon Sep 17 00:00:00 2001 From: chpark Date: Sun, 31 May 2026 22:53:17 +0900 Subject: [PATCH] =?UTF-8?q?feat(orders):=20=EB=AA=A8=EB=93=A0=20=ED=92=88?= =?UTF-8?q?=EB=AA=A9=20=EC=9E=AC=EA=B3=A0=20=EB=AC=B4=EA=B4=80=20=EC=B6=9C?= =?UTF-8?q?=EA=B3=A0=EC=9A=94=EC=B2=AD=20=E2=80=94=20=EC=9D=8C=EC=88=98=20?= =?UTF-8?q?=EC=9E=AC=EA=B3=A0=EB=8A=94=20=EB=A7=A4=EC=9E=85/=EC=9E=85?= =?UTF-8?q?=EA=B3=A0=EC=97=90=EC=84=9C=20=EB=B0=9C=EC=A3=BC=20=ED=8A=B8?= =?UTF-8?q?=EB=A6=AC=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 핵심 정책 변경: - 기존: 택배전용 품목만 재고 무관 출고요청 가능 / 일반 품목은 재고 ≥ 요청 강제 - 신규: 모든 품목 재고 무관 출고요청 가능. 권한 체크는 sale_start/end_date, is_hidden(+view_hidden), max_order_qty(+unlimited_qty) 만 적용 API (재고 체크 제거 — 한도/숨김/판매기간만 유지): - orders/save: ITEM 재고 초과 검증 제거. needsDelivery 자동 추가는 유지 - orders/items/add: 재고 초과 검증 제거 - orders/items/update: 재고 초과 검증 + stock_qty 조회 자체 제거 - items/list: onlyAvailable 재고 필터 제거(옵션은 호환 위해 no-op로 유지) 사용자 화면 — 재고 표시/품절 제거 (재고 없어도 출고 가능): - /m/orders/new: 카드/리스트에서 STOCK_QTY 컬럼 + '품절' 배지 제거. 한도 체크는 MAX_ORDER_QTY(권한자 무제한) 만 적용 - /m/orders 주문 상세 ItemPickerModal: 재고 컬럼 + max=stock 제거, stockFilter:'AVAILABLE' → forSale:true 로 교체 관리자 화면 — 현재고 표시 유지하되 음수 강조: - /m/admin/orders 거래명세표: 현재고 음수면 bg-rose-50 + extrabold, '재고 부족' 경고를 '음수 재고가 됩니다' 안내로 톤 변경 - /m/admin/inventory(매입/입고): 재고 매트릭스 음수 셀 bg-rose-50 + extrabold (approve API의 음수 재고 허용 정책은 이전부터 적용되어 있어 변경 없음) Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/(main)/m/admin/inventory/page.tsx | 21 +++++- src/app/(main)/m/admin/orders/page.tsx | 27 ++++--- src/app/(main)/m/orders/new/page.tsx | 87 ++++++---------------- src/app/(main)/m/orders/page.tsx | 13 ++-- src/app/api/m/items/list/route.ts | 10 +-- src/app/api/m/orders/items/add/route.ts | 8 +- src/app/api/m/orders/items/update/route.ts | 9 +-- src/app/api/m/orders/save/route.ts | 16 +--- 8 files changed, 69 insertions(+), 122 deletions(-) diff --git a/src/app/(main)/m/admin/inventory/page.tsx b/src/app/(main)/m/admin/inventory/page.tsx index ee412e0..f3cc91c 100644 --- a/src/app/(main)/m/admin/inventory/page.tsx +++ b/src/app/(main)/m/admin/inventory/page.tsx @@ -229,8 +229,13 @@ export default function InventoryPage() { const total = matrix.warehouses.reduce( (sum, w) => sum + (matrix.cell[it.OBJID]?.[w.OBJID]?.qty ?? 0), 0 ); + const cls = total < 0 + ? "text-rose-700 font-extrabold bg-rose-50" + : total === 0 + ? "text-emerald-300" + : "text-emerald-800 font-bold"; return ( - + {total === 0 ? "-" : `${fmt(total)} ${it.UNIT}`} ); @@ -247,8 +252,13 @@ export default function InventoryPage() { {matrix.items.map((it) => { const c = matrix.cell[it.OBJID]?.[w.OBJID]; const qty = c ? c.qty : 0; + const cls = qty < 0 + ? "text-rose-700 font-extrabold bg-rose-50" + : qty === 0 + ? "text-slate-300" + : "text-slate-800 font-semibold"; return ( - + {qty === 0 ? "-" : (