{"id":3267,"date":"2025-02-24T07:03:01","date_gmt":"2025-02-24T07:03:01","guid":{"rendered":"https:\/\/crosslog.com\/wiki\/?post_type=lsvr_kba&#038;p=3267"},"modified":"2025-02-24T07:05:37","modified_gmt":"2025-02-24T07:05:37","slug":"parcel-order-in-crossdesk360","status":"publish","type":"lsvr_kba","link":"https:\/\/crosslog.com\/wiki\/wiki-base\/parcel-order-in-crossdesk360\/","title":{"rendered":"Parcel Order in Crossdesk360"},"content":{"rendered":"\n<p>Step:1 After Scanning the barcode the details of the order will be displayed as below image.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXckl5VyIJ5HOZPbJGiKZTWM5PQJODoZfih4Y-anXNY4p9VLQblsb6Uhav58KFe1jmn16T6lLdQlMHdoFoPw-MxRXO6Kq7anzkuQXJYkM8swFEsdaOoIaNpCZQN4by1xEAHlbaHLLQ?key=0IYnfnINjfzOVjSBdpJjkL79\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n<p>Step:2 You can change the printer configuration by clicking on the printer option to print the receipt on the respective printer.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcxLFd-OL4wvJ11t_F-e5_hq3w2V_UdONvXsTQoTCRnUsF4qMYF9Ctg0R1BtQ8IvL_sZ1M52N95_j9URQTswfJYCeBBdyfM0AYRObfLW11kluivX402kJm9qhHGGHH6VZwV29Bzqg?key=0IYnfnINjfzOVjSBdpJjkL79\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n<p>Step:3 After that click on the complete order option to finish the parceling and to print the receipt on the printer.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcdtdhGc1WEhNmUJAokzI6WXaUfTUQmN6Xn9uk6wSKN2oL4ztoTIh5QuU2jrdAo-hnhLeRG0OKNUgbCVnas38T8HwWGB4yHd09mxKJXhJscM721jOHxQBrVvLQASUaft3V1VElOXg?key=0IYnfnINjfzOVjSBdpJjkL79\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n<p>Congratulations! Your order is processed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Backend Flow for Completing an Order (Finish Parceling)<\/strong><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Upon clicking the <strong>Complete Order<\/strong> 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:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Frontend Initiates the API Call<\/strong><strong><br><\/strong>The frontend triggers an HTTP POST request to the endpoint:\n<ul class=\"wp-block-list\">\n<li><strong>API Endpoint:<\/strong> POST \/finish-parceling<\/li>\n\n\n\n<li>This request includes necessary data, such as the FinishParcelingCommand, which contains the parceling details and order information.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Backend API Endpoint (<\/strong><strong>FinishParceling<\/strong><strong>)<\/strong><strong><br><\/strong>The finish-parceling API endpoint in the backend receives the request and proceeds with the following actions:\n<ul class=\"wp-block-list\">\n<li>It first extracts the FinishParcelingCommand and any required authToken from the incoming request.<\/li>\n\n\n\n<li>The backend calls the FinishParcelingAsync service method to process the parceling logic.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Service Layer: Calling the FinishParceling Method<\/strong><strong><br><\/strong>The <strong>FinishParcelingAsync<\/strong> method, located within the service layer, handles the core logic for completing the parceling:\n<ul class=\"wp-block-list\">\n<li>It interacts with an external service via a Refit client to call the old warehouse API:\n<ul class=\"wp-block-list\">\n<li><strong>API Endpoint:<\/strong> POST \/Parceling\/FinishParceling360<\/li>\n\n\n\n<li>The Refit client asynchronously calls this API with the required data from the FinishParcelingCommand.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Processing the Response from Warehouse<\/strong><strong><br><\/strong>After the service sends the request to the warehouse API (FinishParceling360), the response is handled:\n<ul class=\"wp-block-list\">\n<li>If the response is successful (HTTP status code 2xx), the service returns a success result with a message indicating that the parceling is complete.<\/li>\n\n\n\n<li>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.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Return the Result to Frontend<\/strong><strong><br><\/strong>Based on the outcome of the FinishParcelingAsync service call:\n<ul class=\"wp-block-list\">\n<li><strong>Success:<\/strong> A success message and any relevant data (such as the finished parcel details) are returned to the frontend.<\/li>\n\n\n\n<li><strong>Failure:<\/strong> An error message and status code are returned to the frontend, indicating that the parceling process could not be completed.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example Flow:<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Frontend<\/strong> sends a request to \/finish-parceling.<\/li>\n\n\n\n<li><strong>Backend API<\/strong> calls FinishParcelingAsync.<\/li>\n\n\n\n<li><strong>Service Layer<\/strong> makes a request to \/Parceling\/FinishParceling360 in the warehouse.<\/li>\n\n\n\n<li><strong>Warehouse API<\/strong> processes the request and responds with a success or failure.<\/li>\n\n\n\n<li><strong>Backend<\/strong> processes the warehouse API response, logging any errors or returning a success message.<\/li>\n\n\n\n<li><strong>Frontend<\/strong> receives the response and updates the UI accordingly.<\/li>\n<\/ol>\n\n\n\n<p><strong>Estimated Time Taken by Service Breakout (Local):<\/strong><\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GetWsShipmentCarrierParcel method 0&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the Havelock method 648&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GetProductDifferedCount method 2379&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GetCountryId method 216&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GetProductCrossdockingCount method 1296<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GetProductLinePrice method 216&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GetPackageType method 216&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the BuildTransportPlanEvaluatedEntity method 1513&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the UpdateOrderCarrier method 867&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the CreateParcelWhiteLabel method 2707&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GenerateOrderDocument method 15552&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the UpdateDocumentPrinted method 432&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the CreatePackDocument method 4786&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the UpdateOrderPrepareSpecificProduct method 433&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the CreateOrderEVent method 866&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GetWsDynamicDocument method 869&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GenerateCustomer method 661&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the PrintParcel method 2240&nbsp;<\/h6>\n\n\n\n<h6 class=\"wp-block-heading\">Time taken by the GetPackDocumentsContent method 1943<\/h6>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"lsvr_kba_cat":[80],"lsvr_kba_tag":[],"class_list":["post-3267","lsvr_kba","type-lsvr_kba","status-publish","format-standard","hentry","lsvr_kba_cat-crossdesk-360"],"_links":{"self":[{"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/lsvr_kba\/3267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/comments?post=3267"}],"version-history":[{"count":1,"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/lsvr_kba\/3267\/revisions"}],"predecessor-version":[{"id":3268,"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/lsvr_kba\/3267\/revisions\/3268"}],"wp:attachment":[{"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/media?parent=3267"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/lsvr_kba_cat?post=3267"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/crosslog.com\/wiki\/wp-json\/wp\/v2\/lsvr_kba_tag?post=3267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}