Skip to content Skip to main navigation Skip to footer

Parcel Order in Crossdesk360

Step:1 After Scanning the barcode the details of the order will be displayed as below image.

Step:2 You can change the printer configuration by clicking on the printer option to print the receipt on the respective printer.

Step:3 After that click on the complete order option to finish the parceling and to print the receipt on the printer.

Congratulations! Your order is processed.

Backend Flow for Completing an Order (Finish Parceling)

Upon clicking the Complete Order button on the frontend, a request is made to the backend to finalize the order and complete the parceling process. Below is the step-by-step flow of the backend service call:

  1. Frontend Initiates the API Call
    The frontend triggers an HTTP POST request to the endpoint:
    • API Endpoint: POST /finish-parceling
    • This request includes necessary data, such as the FinishParcelingCommand, which contains the parceling details and order information.
  2. Backend API Endpoint (FinishParceling)
    The finish-parceling API endpoint in the backend receives the request and proceeds with the following actions:
    • It first extracts the FinishParcelingCommand and any required authToken from the incoming request.
    • The backend calls the FinishParcelingAsync service method to process the parceling logic.
  3. Service Layer: Calling the FinishParceling Method
    The FinishParcelingAsync method, located within the service layer, handles the core logic for completing the parceling:
    • It interacts with an external service via a Refit client to call the old warehouse API:
      • API Endpoint: POST /Parceling/FinishParceling360
      • The Refit client asynchronously calls this API with the required data from the FinishParcelingCommand.
  4. Processing the Response from Warehouse
    After the service sends the request to the warehouse API (FinishParceling360), the response is handled:
    • If the response is successful (HTTP status code 2xx), the service returns a success result with a message indicating that the parceling is complete.
    • If the response is unsuccessful (HTTP error or failure), the service logs the error details, including the exception message, and returns a failure result with an internal server error (HTTP 500) along with the error message.
  5. Return the Result to Frontend
    Based on the outcome of the FinishParcelingAsync service call:
    • Success: A success message and any relevant data (such as the finished parcel details) are returned to the frontend.
    • Failure: An error message and status code are returned to the frontend, indicating that the parceling process could not be completed.

Example Flow:

  1. Frontend sends a request to /finish-parceling.
  2. Backend API calls FinishParcelingAsync.
  3. Service Layer makes a request to /Parceling/FinishParceling360 in the warehouse.
  4. Warehouse API processes the request and responds with a success or failure.
  5. Backend processes the warehouse API response, logging any errors or returning a success message.
  6. Frontend receives the response and updates the UI accordingly.

Estimated Time Taken by Service Breakout (Local):

Time taken by the GetWsShipmentCarrierParcel method 0 
Time taken by the Havelock method 648 
Time taken by the GetProductDifferedCount method 2379 
Time taken by the GetCountryId method 216 
Time taken by the GetProductCrossdockingCount method 1296
Time taken by the GetProductLinePrice method 216 
Time taken by the GetPackageType method 216 
Time taken by the BuildTransportPlanEvaluatedEntity method 1513 
Time taken by the UpdateOrderCarrier method 867 
Time taken by the CreateParcelWhiteLabel method 2707 
Time taken by the GenerateOrderDocument method 15552 
Time taken by the UpdateDocumentPrinted method 432 
Time taken by the CreatePackDocument method 4786 
Time taken by the UpdateOrderPrepareSpecificProduct method 433 
Time taken by the CreateOrderEVent method 866 
Time taken by the GetWsDynamicDocument method 869 
Time taken by the GenerateCustomer method 661 
Time taken by the PrintParcel method 2240 
Time taken by the GetPackDocumentsContent method 1943