Mapping: Order Close
Context
- Controller: OrderController.cs
- Service: OrderService.cs
- Entity: OrderOMGT.cs
- DTO: OrderCloseDto.cs
Step Definitions
Background
- Given an Order exists...: Prerequisite state in DB.
- And I am logged in...:
WepSessioncontext.
Actions
-
I am on the Close Order page:
OrderController.Close (GET)- Logic: Calls
OrderService.GetOrderOMGT(..., "OMGT_CLOSE_ORDER"). - View: Returns
View(new OrderCloseDto(...)).
- Logic: Calls
-
I select Status ...: Sets
OrderCloseDto.OrderStatus -
I submit the form:
OrderController.Close (POST)
Validations using Entity Logic (OrderOMGT.CloseOrder)
- Operator Mandatory: If
CancelWithReorientation, checkschangeStatus.COMOperator. - Status Integrity: Checks if status is
ARCHIVEDorCANCELED.
Outcomes
-
Order Status Updated: Calls
OrderService.CloseOrder.- Updates
OrderOMGTentity (ClosedOn,ClosedReasonId,ClosedUnderWepGuarantee).
- Updates
-
Gherkin Step:
the same status is automatically cascaded to all associated products -
Code Location:
OrderOMGT.CloseOrder(Loop overOrderTravelProductOMGTs) -
Gherkin Step:
a new fee/discount line ... is added to the order -
Code Location:
OrderService.CloseOrderProgramBalance->OrderFeeComponentService.AddFeeToOrder -
Gherkin Step:
a request for a credit note or correction invoice is generated -
Code Location:
OrderService.CloseOrderInvoiceBalance->IWepInvoiceRequestHandler.RequestFeeInvoicingAsync -
Gherkin Step:
a new "AdminReasonHistoryOMGT" record is created -
Code Location:
WepOMGTLogItemNotificationSubscriber.HandleEITEvent(Triggered byCLOSE_ORDER) -
Gherkin Step:
the "DesactivateAppForm" service is called -
Code Location:
OrderService.CloseOrder->MyWepComponentService.DesactivateAppForm- Cascade Update: Updates Status of all child
OrderTravelProductOMGTsto match order status. - Financial Flags: Sets
IsMissingCreditNoteif invoice exists without credit note. - Updates
IsNotOKForAutomatedProcessesbased on Prospect contact.
- Cascade Update: Updates Status of all child
-
Prospect Updates:
ProspectCRM.DisableForContact/EnableForContact. -
Zoho Sync:
ZohoApiSDKManager.UpdateRecordandSetOptOut. -
Emails Sent:
OrderService.HandleCommunication- Accounting: Template
OMGT_ACCOUNTING_CANCEL_ARCHIVE_ORDER. - Operator: Template
OMGT_NOTIFY_OPERATOR_REORIENTATION.
- Accounting: Template
-
Redirect: Returns
RedirectToAction("Overview")orRedirectToAction("Manage", "FinancialTransactionOMGTs").