Business Rule Candidates: OrderFee Module
[!WARNING] Unverified Interpretation - These rules were extracted via Code Archaeology and require USER validation before promotion to
specs/current/.
Candidate List
| ID | Title | Status | Evidence |
|---|---|---|---|
| BR-OMGT-010 | Group Medical Insurance Propagation | 🔍 To Verify | OrderFeeComponentService.cs:L573-610 |
| BR-OMGT-011 | Cancel Insurance Percentage Calculation | 🔍 To Verify | OrderFeeComponentService.cs:L508-532 |
| BR-OMGT-012 | Deferred Discount Invoicing | 🔍 To Verify | OrderFeeComponentService.cs:L897-913 |
| BR-OMGT-013 | Travel Insurance Type Change on Supplement | 🔍 To Verify | OrderFeeComponentService.cs:L1006-1056 |
| BR-OMGT-014 | Status Change Email Notifications | 🔍 To Verify | OrderFeeComponentService.cs:L742-776 |
| BR-OMGT-015 | Delete Fee Group Propagation | 🔍 To Verify | OrderFeeComponentService.cs:L1260-1281 |
| BR-OMGT-016 | Travel Insurance Extension Availability | 🔍 To Verify | OrderFeeComponentService.cs:L1823-1836 |
| BR-OMGT-017 | Order Price Recalculation After Fee Change | 🔍 To Verify | OrderFeeComponentService.cs:L1169-1174 |
Detailed Definitions
BR-OMGT-010: Group Medical Insurance Propagation
- Context: Group order fee management
- Constraint: When adding/deleting a Travel Insurance supplement to a group order where
IsMedicalInsuranceProcessSameForAll = TRUE, the operation MUST be applied to ALL orders in the group. - Exception: Orders with
ExcludeAccounting = TRUEonly receive process updates, not the fee itself. - Logic:
IF (fee is TravelInsuranceSupplement OR TravelInsuranceDiscount)
AND order.IsGroup
AND group.IsMedicalInsuranceProcessSameForAll
THEN propagate to all group orders
BR-OMGT-011: Cancel Insurance Percentage Calculation
- Context: Fee proposal with linked cancel insurance
- Constraint: When proposing a fee with
ProposalCancelInsuranceFeeOMGTId, if the country uses percentage-based calculation, a linked CancelInsurance fee is auto-created. - Formula:
CancelInsAmount = EndUserPrice * CancelInsRate / 100 - Logic:
IF TypeOfFee.ProposalCancelInsuranceFeeOMGTId IS SET
AND country.HasCancelInsurance()
AND country.IsCancelInsCalculationInPercentage(programId)
THEN auto-create linked CancelInsurance fee
BR-OMGT-012: Deferred Discount Invoicing
- Context: Discount invoicing timing
- Constraint: Discounts are NOT immediately invoiced. They are marked
ToInvoice = TRUEand invoiced only afterAcceptanceInvoiceRequestedOnis set. - Exception:
forceInvoicing = TRUEbypasses this rule. - Logic:
IF fee.type == Discount
AND NOT order.AcceptanceInvoiceRequestedOn.HasValue
AND NOT forceInvoicing
THEN set ToInvoice = TRUE, defer invoicing
BR-OMGT-013: Travel Insurance Type Change on Supplement
- Context: Travel insurance process management
- Constraint: Validating a TravelInsurance supplement fee triggers automatic insurance type transitions.
- Transitions:
N/AorPARTICIPANT→WEPPARTNER(Inbound) → Replace withWEPPARTNER(Outbound) → Create newWEPrequest (keep PARTNER)WEP(if booked) → Set status toTO_EXTEND
BR-OMGT-014: Status Change Email Notifications
- Context: Fee proposal acceptance workflow
- Constraint: When
sendEmails = TRUEand status changes fromPROPOSEDtoVALIDATED, send notifications to both PAX/LG and Staff. - Templates:
NOTIFY_PAX_PROPOSAL_ACCEPTED_BY_PAX,NOTIFY_STAFF_PROPOSAL_ACCEPTED_BY_PAX
BR-OMGT-015: Delete Fee Group Propagation
- Context: Group order fee deletion
- Constraint: Mirrors BR-OMGT-010 for deletions. Deleting a TravelInsurance fee propagates to all group orders.
- Logic: Same as BR-OMGT-010 but for deletion operation.
BR-OMGT-016: Travel Insurance Extension Availability
- Context: Available fee filtering
- Constraint: Medical insurance extensions are only available when base insurance is booked. Base insurance is unavailable after booking.
- Rules:
BookedOn = NULL→ Exclude Extension feesBookedOn IS SET→ Exclude Base fees, Allow Extensions
BR-OMGT-017: Order Price Recalculation After Fee Change
- Context: Order pricing integrity
- Constraint: ANY fee add/edit/delete operation MUST trigger
HandleChangePricing()on all OrderHeaders andHandleChangeInAccounting()on the OrderOMGT. - Atomic: This is a mandatory post-operation step.
Next Steps
- Validation: Creator reviews each rule for correctness.
- Promotion: Validated rules move to
specs/current/and are registered inbusiness_rules_index.md. - Expand: Rules with complex logic get full Gherkin coverage.