feat(orders): add resync and delete order buttons
Resync soft-deletes from Oracle then re-imports from GoMag with fresh article data. Delete soft-deletes and marks DELETED_IN_ROA. Both have invoice safety gates (refuse if invoiced or Oracle unavailable). UI: split modal footer (Delete left, Resync+Close right), inline confirm pattern (no native confirm()), dashboard row hover action icons, disabled+tooltip for invoiced orders. 8 unit tests for safety gates and happy paths. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -476,6 +476,23 @@ async def retry_order(order_number: str):
|
||||
return result
|
||||
|
||||
|
||||
@router.post("/api/orders/{order_number}/resync")
|
||||
async def resync_order(order_number: str):
|
||||
"""Resync an imported order: soft-delete from Oracle then re-import from GoMag."""
|
||||
from ..services import retry_service
|
||||
app_settings = await sqlite_service.get_app_settings()
|
||||
result = await retry_service.resync_single_order(order_number, app_settings)
|
||||
return result
|
||||
|
||||
|
||||
@router.post("/api/orders/{order_number}/delete")
|
||||
async def delete_order(order_number: str):
|
||||
"""Delete an imported order from Oracle (soft-delete)."""
|
||||
from ..services import retry_service
|
||||
result = await retry_service.delete_single_order(order_number)
|
||||
return result
|
||||
|
||||
|
||||
@router.post("/api/orders/{order_number}/resync-partner")
|
||||
async def resync_partner(order_number: str):
|
||||
"""Manual partner resync for invoiced orders with partner_mismatch=1.
|
||||
|
||||
Reference in New Issue
Block a user