diff --git a/app/modules/cupang/router.py b/app/modules/cupang/router.py index 82e909b..4d3e1bf 100644 --- a/app/modules/cupang/router.py +++ b/app/modules/cupang/router.py @@ -425,6 +425,23 @@ async def delete( return RedirectResponse(url=f"/cupang/{shipment_id}", status_code=303) +@router.post("/{shipment_id:int}/hard-delete") +async def hard_delete( + request: Request, + shipment_id: int, + user: dict[str, Any] = Depends(_require_user), +) -> RedirectResponse: + """완전 삭제(헤더+라인 CASCADE). 달력으로 복귀.""" + store = _store(request) + if store is None: + raise HTTPException(status_code=503, detail="cupang_db 미설정") + try: + store.hard_delete(shipment_id=shipment_id) + except KeyError: + raise HTTPException(status_code=404, detail="출고 묶음을 찾을 수 없습니다.") + return RedirectResponse(url="/cupang/", status_code=303) + + # ════════════════════════════════════════════════════════════ # 입고센터 관리 # ════════════════════════════════════════════════════════════ diff --git a/app/modules/cupang/templates/cupang/box_rules.html b/app/modules/cupang/templates/cupang/box_rules.html index 9469075..5061cc8 100644 --- a/app/modules/cupang/templates/cupang/box_rules.html +++ b/app/modules/cupang/templates/cupang/box_rules.html @@ -15,18 +15,22 @@
| 센터명 | 정렬 | 상태 | 사용중 | 동작 |
|---|---|---|---|---|
| - - | -{{ c.sort_order }} | -- {% if c.active %}활성 - {% else %}비활성{% endif %} - | -{% if c.in_use %}사용중{% else %}—{% endif %} | -
-
- {% if c.active %}
-
- {% else %}
-
- {% endif %}
-
-
- |
-
※ 출고 데이터에서 사용 중인 센터는 삭제 시 hard delete 되지 않고 비활성화됩니다.