The "closing" status exists because closing a manifest with a carrier is an asynchronous operation that involves an API call to the carrier's system. Here's the workflow:
The "closing" status provides feedback to users that their request is being processed, rather than leaving them wondering if clicking "Close Manifest" did anything. It also prevents users from accidentally clicking the button multiple times.
In the UI, you'll see a spinner/loader during this state, and once complete it automatically transitions to either "closed" or "failed" based on the carrier's response.
Would you like me to remove this intermediate status and have it transition directly from open to closed/failed? Or is there something else about the flow you'd like to change?
Got it - the "closing" intermediate status only applies to Canada Post because their manifest/close-out API is asynchronous, while other carriers respond immediately. Let me update the code to reflect this:
Now I understand the current implementation. I need to update:
I'll update the code to reflect that "closing" status only applies to Canada Post. I'll change MF-008 to be Canada Post and update the StatusBadge label:
Now let me also update the detail page to reflect the same changes:
Now let me also update MF-008 in the detail page mock data:
Updated the "closing" status to be Canada Post-specific. Changed MF-008 from Purolator to Canada Post in both the main component and detail page, and updated the StatusBadge label to show "Closing (Canada Post)" to make it clear this intermediate state only applies to Canada Post's asynchronous manifest close-out API.