@mj-biz-apps/orders-core-entities-server 0.0.1 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/LICENSE +183 -0
  2. package/README.md +141 -2
  3. package/dist/AccountingBridge.d.ts +65 -0
  4. package/dist/AccountingBridge.d.ts.map +1 -0
  5. package/dist/AccountingBridge.js +102 -0
  6. package/dist/AccountingBridge.js.map +1 -0
  7. package/dist/AdvanceOrderStateOperation.d.ts +80 -0
  8. package/dist/AdvanceOrderStateOperation.d.ts.map +1 -0
  9. package/dist/AdvanceOrderStateOperation.js +267 -0
  10. package/dist/AdvanceOrderStateOperation.js.map +1 -0
  11. package/dist/ApplyAccountCreditOperation.d.ts +97 -0
  12. package/dist/ApplyAccountCreditOperation.d.ts.map +1 -0
  13. package/dist/ApplyAccountCreditOperation.js +275 -0
  14. package/dist/ApplyAccountCreditOperation.js.map +1 -0
  15. package/dist/BaseDeliveryChannel.d.ts +106 -0
  16. package/dist/BaseDeliveryChannel.d.ts.map +1 -0
  17. package/dist/BaseDeliveryChannel.js +36 -0
  18. package/dist/BaseDeliveryChannel.js.map +1 -0
  19. package/dist/BasePaymentProvider.d.ts +239 -0
  20. package/dist/BasePaymentProvider.d.ts.map +1 -0
  21. package/dist/BasePaymentProvider.js +91 -0
  22. package/dist/BasePaymentProvider.js.map +1 -0
  23. package/dist/BundleBehavior.d.ts +139 -0
  24. package/dist/BundleBehavior.d.ts.map +1 -0
  25. package/dist/BundleBehavior.js +173 -0
  26. package/dist/BundleBehavior.js.map +1 -0
  27. package/dist/BundleEngine.d.ts +60 -0
  28. package/dist/BundleEngine.d.ts.map +1 -0
  29. package/dist/BundleEngine.js +197 -0
  30. package/dist/BundleEngine.js.map +1 -0
  31. package/dist/CancelSubscriptionOperation.d.ts +98 -0
  32. package/dist/CancelSubscriptionOperation.d.ts.map +1 -0
  33. package/dist/CancelSubscriptionOperation.js +317 -0
  34. package/dist/CancelSubscriptionOperation.js.map +1 -0
  35. package/dist/CapturePaymentOperation.d.ts +62 -0
  36. package/dist/CapturePaymentOperation.d.ts.map +1 -0
  37. package/dist/CapturePaymentOperation.js +463 -0
  38. package/dist/CapturePaymentOperation.js.map +1 -0
  39. package/dist/CheckEntitlementOperation.d.ts +27 -0
  40. package/dist/CheckEntitlementOperation.d.ts.map +1 -0
  41. package/dist/CheckEntitlementOperation.js +45 -0
  42. package/dist/CheckEntitlementOperation.js.map +1 -0
  43. package/dist/CheckoutSessionService.d.ts +258 -0
  44. package/dist/CheckoutSessionService.d.ts.map +1 -0
  45. package/dist/CheckoutSessionService.js +1557 -0
  46. package/dist/CheckoutSessionService.js.map +1 -0
  47. package/dist/DeliveryBehavior.d.ts +121 -0
  48. package/dist/DeliveryBehavior.d.ts.map +1 -0
  49. package/dist/DeliveryBehavior.js +145 -0
  50. package/dist/DeliveryBehavior.js.map +1 -0
  51. package/dist/DeliveryRecipientResolver.d.ts +38 -0
  52. package/dist/DeliveryRecipientResolver.d.ts.map +1 -0
  53. package/dist/DeliveryRecipientResolver.js +93 -0
  54. package/dist/DeliveryRecipientResolver.js.map +1 -0
  55. package/dist/DeliveryResolver.d.ts +14 -0
  56. package/dist/DeliveryResolver.d.ts.map +1 -0
  57. package/dist/DeliveryResolver.js +45 -0
  58. package/dist/DeliveryResolver.js.map +1 -0
  59. package/dist/EmailDeliveryChannel.d.ts +31 -0
  60. package/dist/EmailDeliveryChannel.d.ts.map +1 -0
  61. package/dist/EmailDeliveryChannel.js +158 -0
  62. package/dist/EmailDeliveryChannel.js.map +1 -0
  63. package/dist/EntitlementBehavior.d.ts +235 -0
  64. package/dist/EntitlementBehavior.d.ts.map +1 -0
  65. package/dist/EntitlementBehavior.js +330 -0
  66. package/dist/EntitlementBehavior.js.map +1 -0
  67. package/dist/EntitlementEngine.d.ts +97 -0
  68. package/dist/EntitlementEngine.d.ts.map +1 -0
  69. package/dist/EntitlementEngine.js +338 -0
  70. package/dist/EntitlementEngine.js.map +1 -0
  71. package/dist/EntitlementGrantClaimDriver.d.ts +42 -0
  72. package/dist/EntitlementGrantClaimDriver.d.ts.map +1 -0
  73. package/dist/EntitlementGrantClaimDriver.js +158 -0
  74. package/dist/EntitlementGrantClaimDriver.js.map +1 -0
  75. package/dist/EntitlementRead.d.ts +82 -0
  76. package/dist/EntitlementRead.d.ts.map +1 -0
  77. package/dist/EntitlementRead.js +368 -0
  78. package/dist/EntitlementRead.js.map +1 -0
  79. package/dist/FulfillOrderLinesOperation.d.ts +34 -0
  80. package/dist/FulfillOrderLinesOperation.d.ts.map +1 -0
  81. package/dist/FulfillOrderLinesOperation.js +208 -0
  82. package/dist/FulfillOrderLinesOperation.js.map +1 -0
  83. package/dist/FulfillmentBehavior.d.ts +101 -0
  84. package/dist/FulfillmentBehavior.d.ts.map +1 -0
  85. package/dist/FulfillmentBehavior.js +145 -0
  86. package/dist/FulfillmentBehavior.js.map +1 -0
  87. package/dist/GLAccountResolver.d.ts +123 -0
  88. package/dist/GLAccountResolver.d.ts.map +1 -0
  89. package/dist/GLAccountResolver.js +175 -0
  90. package/dist/GLAccountResolver.js.map +1 -0
  91. package/dist/GetFulfillmentQueueOperation.d.ts +35 -0
  92. package/dist/GetFulfillmentQueueOperation.d.ts.map +1 -0
  93. package/dist/GetFulfillmentQueueOperation.js +221 -0
  94. package/dist/GetFulfillmentQueueOperation.js.map +1 -0
  95. package/dist/GetOverdueWorklistOperation.d.ts +41 -0
  96. package/dist/GetOverdueWorklistOperation.d.ts.map +1 -0
  97. package/dist/GetOverdueWorklistOperation.js +210 -0
  98. package/dist/GetOverdueWorklistOperation.js.map +1 -0
  99. package/dist/GiftCardBehavior.d.ts +97 -0
  100. package/dist/GiftCardBehavior.d.ts.map +1 -0
  101. package/dist/GiftCardBehavior.js +121 -0
  102. package/dist/GiftCardBehavior.js.map +1 -0
  103. package/dist/GiftCardEngine.d.ts +59 -0
  104. package/dist/GiftCardEngine.d.ts.map +1 -0
  105. package/dist/GiftCardEngine.js +197 -0
  106. package/dist/GiftCardEngine.js.map +1 -0
  107. package/dist/GuestOrderClaimDriver.d.ts +36 -0
  108. package/dist/GuestOrderClaimDriver.d.ts.map +1 -0
  109. package/dist/GuestOrderClaimDriver.js +161 -0
  110. package/dist/GuestOrderClaimDriver.js.map +1 -0
  111. package/dist/InvoiceBehavior.d.ts +394 -0
  112. package/dist/InvoiceBehavior.d.ts.map +1 -0
  113. package/dist/InvoiceBehavior.js +496 -0
  114. package/dist/InvoiceBehavior.js.map +1 -0
  115. package/dist/InvoiceBuilder.d.ts +48 -0
  116. package/dist/InvoiceBuilder.d.ts.map +1 -0
  117. package/dist/InvoiceBuilder.js +352 -0
  118. package/dist/InvoiceBuilder.js.map +1 -0
  119. package/dist/InvoiceDisplay.d.ts +96 -0
  120. package/dist/InvoiceDisplay.d.ts.map +1 -0
  121. package/dist/InvoiceDisplay.js +121 -0
  122. package/dist/InvoiceDisplay.js.map +1 -0
  123. package/dist/ListEntitlementsOperation.d.ts +21 -0
  124. package/dist/ListEntitlementsOperation.d.ts.map +1 -0
  125. package/dist/ListEntitlementsOperation.js +39 -0
  126. package/dist/ListEntitlementsOperation.js.map +1 -0
  127. package/dist/ManualPaymentProvider.d.ts +19 -0
  128. package/dist/ManualPaymentProvider.d.ts.map +1 -0
  129. package/dist/ManualPaymentProvider.js +92 -0
  130. package/dist/ManualPaymentProvider.js.map +1 -0
  131. package/dist/OrderEntityServer.d.ts +542 -0
  132. package/dist/OrderEntityServer.d.ts.map +1 -0
  133. package/dist/OrderEntityServer.js +2100 -0
  134. package/dist/OrderEntityServer.js.map +1 -0
  135. package/dist/OrderJournalEntryFactory.d.ts +140 -0
  136. package/dist/OrderJournalEntryFactory.d.ts.map +1 -0
  137. package/dist/OrderJournalEntryFactory.js +466 -0
  138. package/dist/OrderJournalEntryFactory.js.map +1 -0
  139. package/dist/OrderLineEntityServer.d.ts +90 -0
  140. package/dist/OrderLineEntityServer.d.ts.map +1 -0
  141. package/dist/OrderLineEntityServer.js +260 -0
  142. package/dist/OrderLineEntityServer.js.map +1 -0
  143. package/dist/OrdersSettings.d.ts +36 -0
  144. package/dist/OrdersSettings.d.ts.map +1 -0
  145. package/dist/OrdersSettings.js +147 -0
  146. package/dist/OrdersSettings.js.map +1 -0
  147. package/dist/PaymentAllocationFactory.d.ts +128 -0
  148. package/dist/PaymentAllocationFactory.d.ts.map +1 -0
  149. package/dist/PaymentAllocationFactory.js +235 -0
  150. package/dist/PaymentAllocationFactory.js.map +1 -0
  151. package/dist/PaymentHeaderEntityServer.d.ts +180 -0
  152. package/dist/PaymentHeaderEntityServer.d.ts.map +1 -0
  153. package/dist/PaymentHeaderEntityServer.js +656 -0
  154. package/dist/PaymentHeaderEntityServer.js.map +1 -0
  155. package/dist/PaymentIntentService.d.ts +101 -0
  156. package/dist/PaymentIntentService.d.ts.map +1 -0
  157. package/dist/PaymentIntentService.js +150 -0
  158. package/dist/PaymentIntentService.js.map +1 -0
  159. package/dist/PaymentJournalEntryFactory.d.ts +99 -0
  160. package/dist/PaymentJournalEntryFactory.d.ts.map +1 -0
  161. package/dist/PaymentJournalEntryFactory.js +127 -0
  162. package/dist/PaymentJournalEntryFactory.js.map +1 -0
  163. package/dist/PaymentLineEntityServer.d.ts +73 -0
  164. package/dist/PaymentLineEntityServer.d.ts.map +1 -0
  165. package/dist/PaymentLineEntityServer.js +303 -0
  166. package/dist/PaymentLineEntityServer.js.map +1 -0
  167. package/dist/PaymentProviderBehavior.d.ts +222 -0
  168. package/dist/PaymentProviderBehavior.d.ts.map +1 -0
  169. package/dist/PaymentProviderBehavior.js +368 -0
  170. package/dist/PaymentProviderBehavior.js.map +1 -0
  171. package/dist/PaymentProviderResolver.d.ts +84 -0
  172. package/dist/PaymentProviderResolver.d.ts.map +1 -0
  173. package/dist/PaymentProviderResolver.js +220 -0
  174. package/dist/PaymentProviderResolver.js.map +1 -0
  175. package/dist/PaymentReversalFactory.d.ts +107 -0
  176. package/dist/PaymentReversalFactory.d.ts.map +1 -0
  177. package/dist/PaymentReversalFactory.js +174 -0
  178. package/dist/PaymentReversalFactory.js.map +1 -0
  179. package/dist/PaymentSettlement.d.ts +56 -0
  180. package/dist/PaymentSettlement.d.ts.map +1 -0
  181. package/dist/PaymentSettlement.js +243 -0
  182. package/dist/PaymentSettlement.js.map +1 -0
  183. package/dist/PaymentTermsBehavior.d.ts +109 -0
  184. package/dist/PaymentTermsBehavior.d.ts.map +1 -0
  185. package/dist/PaymentTermsBehavior.js +172 -0
  186. package/dist/PaymentTermsBehavior.js.map +1 -0
  187. package/dist/PaymentWebhookHandler.d.ts +103 -0
  188. package/dist/PaymentWebhookHandler.d.ts.map +1 -0
  189. package/dist/PaymentWebhookHandler.js +246 -0
  190. package/dist/PaymentWebhookHandler.js.map +1 -0
  191. package/dist/PreviewPriceOperation.d.ts +62 -0
  192. package/dist/PreviewPriceOperation.d.ts.map +1 -0
  193. package/dist/PreviewPriceOperation.js +161 -0
  194. package/dist/PreviewPriceOperation.js.map +1 -0
  195. package/dist/PriceOrderOperation.d.ts +93 -0
  196. package/dist/PriceOrderOperation.d.ts.map +1 -0
  197. package/dist/PriceOrderOperation.js +146 -0
  198. package/dist/PriceOrderOperation.js.map +1 -0
  199. package/dist/ProductPriceEntityServer.d.ts +34 -0
  200. package/dist/ProductPriceEntityServer.d.ts.map +1 -0
  201. package/dist/ProductPriceEntityServer.js +97 -0
  202. package/dist/ProductPriceEntityServer.js.map +1 -0
  203. package/dist/RefundPaymentOperation.d.ts +61 -0
  204. package/dist/RefundPaymentOperation.d.ts.map +1 -0
  205. package/dist/RefundPaymentOperation.js +177 -0
  206. package/dist/RefundPaymentOperation.js.map +1 -0
  207. package/dist/RevenueRecognition.d.ts +76 -0
  208. package/dist/RevenueRecognition.d.ts.map +1 -0
  209. package/dist/RevenueRecognition.js +133 -0
  210. package/dist/RevenueRecognition.js.map +1 -0
  211. package/dist/ReversalBehavior.d.ts +82 -0
  212. package/dist/ReversalBehavior.d.ts.map +1 -0
  213. package/dist/ReversalBehavior.js +100 -0
  214. package/dist/ReversalBehavior.js.map +1 -0
  215. package/dist/ReversalResolver.d.ts +37 -0
  216. package/dist/ReversalResolver.d.ts.map +1 -0
  217. package/dist/ReversalResolver.js +96 -0
  218. package/dist/ReversalResolver.js.map +1 -0
  219. package/dist/SpawnRenewalsOperation.d.ts +109 -0
  220. package/dist/SpawnRenewalsOperation.d.ts.map +1 -0
  221. package/dist/SpawnRenewalsOperation.js +295 -0
  222. package/dist/SpawnRenewalsOperation.js.map +1 -0
  223. package/dist/StoredValuePaymentProvider.d.ts +52 -0
  224. package/dist/StoredValuePaymentProvider.d.ts.map +1 -0
  225. package/dist/StoredValuePaymentProvider.js +205 -0
  226. package/dist/StoredValuePaymentProvider.js.map +1 -0
  227. package/dist/StripeACHPaymentProvider.d.ts +50 -0
  228. package/dist/StripeACHPaymentProvider.d.ts.map +1 -0
  229. package/dist/StripeACHPaymentProvider.js +211 -0
  230. package/dist/StripeACHPaymentProvider.js.map +1 -0
  231. package/dist/StripePaymentProvider.d.ts +83 -0
  232. package/dist/StripePaymentProvider.d.ts.map +1 -0
  233. package/dist/StripePaymentProvider.js +442 -0
  234. package/dist/StripePaymentProvider.js.map +1 -0
  235. package/dist/SubscriptionBehavior.d.ts +197 -0
  236. package/dist/SubscriptionBehavior.d.ts.map +1 -0
  237. package/dist/SubscriptionBehavior.js +415 -0
  238. package/dist/SubscriptionBehavior.js.map +1 -0
  239. package/dist/checkoutCaptureAlert.d.ts +16 -0
  240. package/dist/checkoutCaptureAlert.d.ts.map +1 -0
  241. package/dist/checkoutCaptureAlert.js +55 -0
  242. package/dist/checkoutCaptureAlert.js.map +1 -0
  243. package/dist/checkoutCaptureRetry.d.ts +27 -0
  244. package/dist/checkoutCaptureRetry.d.ts.map +1 -0
  245. package/dist/checkoutCaptureRetry.js +50 -0
  246. package/dist/checkoutCaptureRetry.js.map +1 -0
  247. package/dist/claimDriverHelpers.d.ts +15 -0
  248. package/dist/claimDriverHelpers.d.ts.map +1 -0
  249. package/dist/claimDriverHelpers.js +34 -0
  250. package/dist/claimDriverHelpers.js.map +1 -0
  251. package/dist/entity-names.d.ts +15 -0
  252. package/dist/entity-names.d.ts.map +1 -0
  253. package/dist/entity-names.js +15 -0
  254. package/dist/entity-names.js.map +1 -0
  255. package/dist/identityClaimContracts.d.ts +118 -0
  256. package/dist/identityClaimContracts.d.ts.map +1 -0
  257. package/dist/identityClaimContracts.js +58 -0
  258. package/dist/identityClaimContracts.js.map +1 -0
  259. package/dist/index.d.ts +126 -0
  260. package/dist/index.d.ts.map +1 -0
  261. package/dist/index.js +115 -0
  262. package/dist/index.js.map +1 -0
  263. package/dist/sql-guards.d.ts +78 -0
  264. package/dist/sql-guards.d.ts.map +1 -0
  265. package/dist/sql-guards.js +115 -0
  266. package/dist/sql-guards.js.map +1 -0
  267. package/package.json +50 -5
@@ -0,0 +1,542 @@
1
+ /**
2
+ * OrderEntityServer — the server-only Order subclass that makes booking atomic (plan D12).
3
+ *
4
+ * On the FIRST transition into `Confirmed` (plan D8), one transaction covers:
5
+ *
6
+ * order header → its lines → one JE per line → each line's JournalEntryID stamp
7
+ *
8
+ * Any failure rolls the whole thing back. A confirmed order without its journal entries is
9
+ * invalid state, so there is deliberately no partial-success path and no compensation logic.
10
+ *
11
+ * The JE set is written by accounting's `Accounting.CreateJournalEntries`, whose own transaction
12
+ * NESTS inside ours as savepoints — so the single outer commit here covers the order row and
13
+ * every entry. (This is why no TransactionGroup plumbing is needed; nesting composes.)
14
+ *
15
+ * PROVIDER DISCIPLINE (plan D12): everything uses `this.ProviderToUse` — the entity's own
16
+ * provider — throughout. A fresh global `Metadata` inside the transaction path would open a
17
+ * SECOND connection that cannot see our uncommitted work, silently breaking atomicity.
18
+ *
19
+ * IDEMPOTENCY: booking keys off `ConfirmedAt`. Once set, re-saving a confirmed order updates the
20
+ * row normally and never re-books. `OrderLine.JournalEntryID` is additionally NULL→value-once at
21
+ * the database level (trigger 51008), so a double-book is refused by the DB even if this class
22
+ * were bypassed.
23
+ *
24
+ * CONNECTS TO:
25
+ * FACTORY: OrderJournalEntryFactory (./OrderJournalEntryFactory.ts)
26
+ * RESOLVER: GLAccountResolver (./GLAccountResolver.ts)
27
+ * OP: 'Accounting.CreateJournalEntries' (@mj-biz-apps/accounting-core-entities-server)
28
+ */
29
+ import { EntitySaveOptions, ValidationResult } from '@memberjunction/core';
30
+ import { OrderHeaderEntity } from '@mj-biz-apps/orders-entities';
31
+ import { type ManualDiscountRequest, type RequestedCharge } from '@mj-biz-apps/orders-entities';
32
+ export declare class OrderEntityServer extends OrderHeaderEntity {
33
+ /** Price decompositions produced during this save, written once the lines have IDs (D69). */
34
+ private _priceComponents;
35
+ /** Why a line owes no tax, by line index — written as a zero-amount component (D73). */
36
+ private _taxReasons;
37
+ private _manualDiscounts;
38
+ private _charges;
39
+ /**
40
+ * The total the CALLER was shown, if they want the confirm to refuse when it no longer matches.
41
+ *
42
+ * Between a user reading a total and pressing Confirm, a promotion can expire or a rate can
43
+ * change, and without a guard the order books at the new number in silence. `Orders.ConfirmOrder`
44
+ * accepted `ExpectedGrossTotal` for exactly this and then read it nowhere — a guard that reads as
45
+ * enforced and is not, which is the failure mode this codebase keeps finding.
46
+ *
47
+ * It was implemented once by running an ENTIRE second booking through a rolled-back transaction
48
+ * purely to learn the total, and removed because that cost was not acceptable. Its correct home
49
+ * was always inside the booking transaction, where the real gross exists anyway — which is where
50
+ * it now lives. Left null, nothing changes.
51
+ */
52
+ ExpectedGrossTotal: number | null;
53
+ /**
54
+ * Promotion and charge decisions made by `prepareLines` and consumed by `savePendingLines`.
55
+ *
56
+ * They are decided while the lines are still in memory — a Confirmed line is frozen by trigger
57
+ * 51003 — but the ROWS they produce need line keys, so writing them waits until after the
58
+ * inserts. The two halves used to be one method; they were split when companion validation
59
+ * moved the deadline for a complete line ahead of the header save.
60
+ */
61
+ private _pendingPromotions;
62
+ private _pendingCharges;
63
+ /** Codes that resolved to nothing usable, so the caller can tell the customer WHY. */
64
+ private _unusableCodes;
65
+ /**
66
+ * Ad-hoc discounts with a stated reason, each gated by the applying user's SalesAuthority.
67
+ *
68
+ * Named `Requested…` for the same reason as {@link RequestedCharges}: `Adjustments` is the
69
+ * collection holding what the engine decided, and a request is not that.
70
+ */
71
+ get RequestedDiscounts(): ManualDiscountRequest[];
72
+ set RequestedDiscounts(value: ManualDiscountRequest[]);
73
+ /**
74
+ * Charges to apply to this order (D71) — shipping, handling, tax layers. Computed AFTER
75
+ * promotions, because a charge's basis is the discounted line.
76
+ *
77
+ * NOT named `Charges`: that is now the related-record COLLECTION on the generated class, which
78
+ * holds the rows the engine wrote. This is the request channel a server-side caller uses — the
79
+ * two meet in `drainStagedPricingRequests`, which reads staged rows into exactly this shape. A
80
+ * browser has only the collection, because it cannot name a charge type by code.
81
+ */
82
+ get RequestedCharges(): RequestedCharge[];
83
+ set RequestedCharges(value: RequestedCharge[]);
84
+ /**
85
+ * Codes that did not apply, and why — 'no such code', 'not currently running', 'this customer
86
+ * does not qualify'. Silence is the wrong answer here: a customer who typed a code needs to be
87
+ * told it did nothing, and told what to do about it.
88
+ */
89
+ get UnusablePromotionCodes(): Array<{
90
+ Code: string;
91
+ Reason: string;
92
+ }>;
93
+ /**
94
+ * WITHOUT THIS, NOTHING BELOW RUNS.
95
+ *
96
+ * `BaseEntity.DefaultSkipAsyncValidation` returns **true** — `Save()` calls `Validate()` always
97
+ * but reaches `ValidateAsync()` only when a subclass opts in. This class never did, so its
98
+ * entire async validation block was dead code from the day it was written: the "an order
99
+ * entering the booked state must have something to book" rule never fired, and neither did the
100
+ * loop that surfaces each line's `ValidateAsync` failures against the order.
101
+ *
102
+ * That is not a theory. Saving an order straight to Confirmed with ZERO lines succeeded and
103
+ * produced ORD-000030 — a confirmed order with nothing on it. `ProductPriceEntityServer` is the
104
+ * only class in this package that got this right, and its comment says exactly why.
105
+ *
106
+ * The failure mode is the dangerous kind: the rule reads as enforced, reviews as enforced, and
107
+ * is not. If you add a `ValidateAsync` to any entity here, add this override with it.
108
+ */
109
+ get DefaultSkipAsyncValidation(): boolean;
110
+ /**
111
+ * The one order rule that CANNOT be decided without the database.
112
+ *
113
+ * The payer rule, the status-transition guard and the has-lines rule for a loaded collection all
114
+ * moved to `OrderHeaderEntity.Validate()`, so the browser now refuses those before a round trip.
115
+ * What is left here is the case the browser genuinely cannot answer: an order that is already
116
+ * saved, being confirmed, whose `Lines` collection was never loaded. In memory that is
117
+ * indistinguishable from an empty order — and answering "empty" would refuse a perfectly good
118
+ * confirm of an order whose lines are sitting on disk.
119
+ *
120
+ * Per-line validation is no longer fanned out by hand. `Lines` is a companion, and
121
+ * `BaseEntity.Save()` validates every companion — including pending removals — before the first
122
+ * row is written, attributing failures by position (`Lines[3].Quantity`).
123
+ */
124
+ ValidateAsync(): Promise<ValidationResult>;
125
+ Save(options?: EntitySaveOptions): Promise<boolean>;
126
+ /**
127
+ * Turn a thrown booking error into the `BaseEntityResult` a caller can read off `LatestResult`.
128
+ * The message is the error's own text — GLAccountResolver and SubscriptionBehavior both write
129
+ * messages meant for a human, so passing them through beats a generic "save failed".
130
+ */
131
+ private buildFailureResult;
132
+ /**
133
+ * Resolve and store this order's due date, walking the terms rungs (D83).
134
+ *
135
+ * A STATED DUE DATE IS LEFT ALONE. `PaymentTermsBehavior` reports whether the answer came from
136
+ * the caller, and a stated date is never recomputed — that is how a contracts app supplies terms
137
+ * Orders has no way to derive, and how a negotiated date survives the next save.
138
+ *
139
+ * The resolved TERMS are recorded alongside the date when the order did not name them, so the
140
+ * invoice can print "Net 30" rather than inferring it back out of an interval.
141
+ *
142
+ * A failure here does not fail the confirm. Booking is the irreversible step and money has
143
+ * already moved in the ledger; refusing it because a lookup could not be read would be a far
144
+ * worse outcome than an order that falls back to due-on-receipt and says so in the log.
145
+ */
146
+ private resolveDueDate;
147
+ /** This buyer's negotiated terms, joined to their net days. */
148
+ private customerPaymentTerms;
149
+ /**
150
+ * The selling company's default terms — the last step of the due-date walk before "due on
151
+ * receipt" (D83).
152
+ *
153
+ * Reads `OrderCompanyPolicy`, NOT accounting's `AccountingCompanyProfile`.
154
+ *
155
+ * It used to read the latter, and accounting removed that column (their issue #22) on grounds
156
+ * this codebase agrees with: accounting records what was owed and when, but deciding WHEN AN
157
+ * ORDER IS DUE is a selling decision, so the default belongs to the app that makes it. Orders
158
+ * kept reading the removed column, so every order whose customer had no negotiated terms failed
159
+ * the walk with `Invalid column name 'DefaultPaymentTermsTypeID'` — six integration checks, and
160
+ * in production the entire company-default step.
161
+ *
162
+ * `OrderCompanyPolicy` is the right home and needed no new table: it is already the per-company
163
+ * orders policy row, IS-A `__mj.Company` so its ID *is* the company ID, and a company with no
164
+ * row simply takes the defaults — which here means falling through to due on receipt.
165
+ */
166
+ private companyDefaultTerms;
167
+ /**
168
+ * Refuse an illegal status move BEFORE this save does anything, and say why.
169
+ *
170
+ * ONLY the lifecycle verdict is asked here, deliberately. `super.Save()` runs the full
171
+ * `Validate()` later, and that is the right place for the rest of it: `Validate()` includes the
172
+ * generated NOT NULL field checks, and `OrderNumber`, `Company` and every line's `UnitPrice` are
173
+ * populated BY this save — minted from the sequence, or resolved by the pricing walk below. An
174
+ * attempt to run all of `Validate()` up front refused every confirm in the suite with
175
+ * "Order Number cannot be null", on fields the save was about to fill in.
176
+ *
177
+ * The transition check has no such dependency: it reads the persisted `Status` against the new
178
+ * one, and both are known before anything runs. Asking it here is what makes integration check
179
+ * OS4 hold — a refused move must change nothing on disk and book nothing, and by the time
180
+ * control reaches `super.Save()` this method has already priced lines, decided promotions and
181
+ * charges, minted an order number and posted journal entries.
182
+ *
183
+ * The booking rules that DO need the full record — a payer, something to book — live on
184
+ * `OrderHeaderEntity.Validate()` and fire inside `super.Save()`, where `bookingInFlight` keeps
185
+ * `willBookOnThisSave()` answering true even though `ConfirmedAt` has just been stamped.
186
+ *
187
+ * Reports through `LatestResult`, the same shape every other refusal on this path uses, so a
188
+ * caller gets the reason rather than a bare `false`.
189
+ */
190
+ private passesStatusTransition;
191
+ /**
192
+ * Settle every line's money IN MEMORY. Writes nothing.
193
+ *
194
+ * EVERY in-memory decision happens before any row goes down. That ordering is forced rather
195
+ * than tidy: a Confirmed line is frozen by trigger 51003, and because the CRUD procs run under
196
+ * INSERT-EXEC, a trigger rollback raises 'Cannot use the ROLLBACK statement within an
197
+ * INSERT-EXEC statement' — an error naming neither the line nor the rule it broke. So anything
198
+ * that changes a line's money must be settled BEFORE the insert, not corrected after it.
199
+ *
200
+ * Split out of `savePendingLines` and hoisted ahead of the header save when `Lines` became a
201
+ * related-record collection: MJ validates companions from the parent's save, so a line has to be
202
+ * complete — `CompanyID` stamped, `UnitPrice` resolved, both NOT NULL and neither ever authored
203
+ * by a caller — before that save runs, not after it.
204
+ */
205
+ private prepareLines;
206
+ /**
207
+ * Write the lines that `prepareLines` settled, plus the adjustment rows that need their keys.
208
+ */
209
+ /**
210
+ * Write the adjustment and allocation rows once the lines have real IDs.
211
+ *
212
+ * These only ADD rows — the frozen line is never touched again, which is what keeps this clear
213
+ * of the immutability trigger.
214
+ */
215
+ private writePromotionRecords;
216
+ /** Net for a line that has not been saved yet — mirrors OrderLineEntityServer's own formula. */
217
+ private pendingLineNet;
218
+ /**
219
+ * The exact extended amount a price rule computed for this line, if one did.
220
+ *
221
+ * `_priceComponents` is populated by the pricing pass in this same save, so this
222
+ * is the authority while the line is still in flight; the line itself carries the
223
+ * same figure for its own totals hook, which runs outside this class.
224
+ */
225
+ private resolvedExtendedFor;
226
+ /** Persist priced lines and the component/charge rows that need their IDs. */
227
+ private persistPreparedLines;
228
+ private savePendingLines;
229
+ /** Write the charge and allocation rows once the lines have real IDs. */
230
+ private writeChargeRecords;
231
+ /**
232
+ * Create the grants this order's lines confer (D27/D76).
233
+ *
234
+ * Delegates entirely to `EntitlementEngine`; what lives here is the mapping from the order's own
235
+ * entities to the structural shape the engine takes, plus the balance the timing rule needs.
236
+ *
237
+ * `Balance` is re-read from the header rather than trusted from memory: `createInitialPayment`
238
+ * has just run, and the rollup triggers (D41) moved `AmountPaid`/`Balance` on the ROW without
239
+ * telling this object. An `OnPaidInFull` grant reading a stale balance would sit Suspended on an
240
+ * order that is already paid.
241
+ */
242
+ private grantEntitlements;
243
+ /**
244
+ * Turn any bundle line into a parent plus its component children (D32/D41/D45).
245
+ *
246
+ * Delegates to `BundleEngine`; what lives here is making a fresh line entity the way this class
247
+ * does, and giving the parent an ID before either row is written so the children can point at it
248
+ * at INSERT time rather than through a later update the immutability trigger would refuse.
249
+ */
250
+ /**
251
+ * Turn charge and adjustment rows a CLIENT staged into the engine's request arrays.
252
+ *
253
+ * ## Why this exists
254
+ *
255
+ * `Charges` and `Adjustments` are related-record collections so a browser can ask for a shipping
256
+ * charge or an ad-hoc discount and have it cross the wire with the order. Before them these were
257
+ * transient arrays only the server could fill, so once `OrderDraft` was deleted a promotion code
258
+ * or a manual discount typed on screen showed up in the PRICE PREVIEW and then vanished at
259
+ * confirm — the screen and the ledger disagreeing, silently, which is the one failure this app
260
+ * spends most of its guard rails preventing.
261
+ *
262
+ * ## Why the staged rows are CONSUMED rather than saved as they arrive
263
+ *
264
+ * A staged row is a REQUEST, and it is not the same object as the record the engine writes. A
265
+ * client can fill in three of a charge's fifteen fields — the type, an amount or rate, and a
266
+ * reason for an override. `BasisAmount`, the per-line allocations, the tax jurisdiction and the
267
+ * sequence are all decided by the pricing walk, and the allocations cannot even be written until
268
+ * the lines have IDs. Letting the graph write the row as it arrived would put a half-formed
269
+ * charge in the transaction and then need a second write to correct it — with a window in
270
+ * between where the order carries a charge with no basis.
271
+ *
272
+ * So the rows are read as requests and removed, and `WriteCharges` / the promotion writer produce
273
+ * the authoritative rows exactly as they always have. The engine is untouched by this change,
274
+ * which matters: it is the part with 373 integration checks against it.
275
+ *
276
+ * On the way OUT the collections mean what they say — `Charges.Load()` on a saved order returns
277
+ * what the engine decided. Request on the way in, record on the way out.
278
+ */
279
+ private drainStagedPricingRequests;
280
+ /** `ChargeType.ID` → `Code`, for the staged rows only. One read, not one per row. */
281
+ private chargeTypeCodesByID;
282
+ private expandBundles;
283
+ /**
284
+ * Mint the stored-value instruments this order's gift-card lines sell (D44).
285
+ *
286
+ * Delegates to `GiftCardEngine`; what lives here is the mapping from the order's entities to the
287
+ * shape the engine takes. The engine is idempotent against the database, so a re-save of an
288
+ * already confirmed order issues nothing — which matters because a second set of cards would be
289
+ * free money that reconciles perfectly, with the accounts present and the ledger balanced.
290
+ *
291
+ * `IssuingCompanyID` is the ORDER's company rather than any line's. A gift card is a claim on
292
+ * the entity that sold it, and on a multi-company order the seller is the header's company even
293
+ * where a line's product belongs to a sibling.
294
+ */
295
+ private issueGiftCards;
296
+ /** The header's rollup columns as the DATABASE now holds them, after the payment triggers ran. */
297
+ private readBalanceFromRow;
298
+ /**
299
+ * Take access away from what was sent back.
300
+ *
301
+ * A full return revokes; a partial return reduces the quantity proportionally. Uncountable grants
302
+ * — a Feature, an AccessLevel — survive a partial return, because the customer still holds some of
303
+ * the thing that conferred them.
304
+ *
305
+ * Runs on the REVERSAL order's lines, unwinding the grants that hang off each ORIGIN line. The
306
+ * origin's quantity is what the proportion is taken against, so it is read from the origin rather
307
+ * than inferred from the reversal.
308
+ */
309
+ private revokeEntitlementsForReversals;
310
+ /**
311
+ * Settle a reversal line from the line it unwinds (D16). Returns true when this line WAS a
312
+ * reversal, so the caller knows to skip ordinary pricing.
313
+ *
314
+ * THREE THINGS ONLY THE ORIGIN KNOWS, and each of them produces a balanced journal entry when
315
+ * it goes wrong — which is why they are refusals here rather than checks somewhere downstream:
316
+ *
317
+ * - **How much is left.** Returning 5 against a line that sold 2 refunds money never
318
+ * collected. The entry balances; nothing later in the pipeline can tell.
319
+ * - **What it cost.** Pricing a return against today's table refunds last year's purchase at
320
+ * this year's rate. A stated `UnitPrice` still wins — see `applyResolvedPrice` — because a
321
+ * stated price is a decision somebody made, and a negotiated return settlement is exactly
322
+ * that.
323
+ * - **Which product.** An ID copied from the wrong row credits another company's revenue.
324
+ *
325
+ * Runs on any line carrying `ReversesOrderLineID`, including a POSITIVE one: a line that points
326
+ * at an origin is making a claim about that origin, and the claim is checkable either way.
327
+ */
328
+ private applyReversalOrigin;
329
+ /**
330
+ * Record WHY a line owes no tax, as a zero-amount price component (D73).
331
+ *
332
+ * A zero tax line looks identical whether the product was untaxable, we had no nexus, or the
333
+ * buyer held a certificate — and those are different facts. An auditor asking "why was no tax
334
+ * charged on this line" needs the reason, not the total, and the component trail is where the
335
+ * rest of the line's reasoning already lives.
336
+ */
337
+ private saveTaxReasons;
338
+ /**
339
+ * Write the price decomposition for lines that were priced by the engine (D69).
340
+ *
341
+ * Runs AFTER the lines are saved, because a component points at a line that must already exist.
342
+ * Pricing disputes are inevitable and "the system computed it" is not an answer to a customer or
343
+ * an auditor, so the reasoning is stored rather than recomputed later against rules that may by
344
+ * then have changed.
345
+ */
346
+ private savePriceComponents;
347
+ /**
348
+ * Stamp an event line's service period from the EVENT's own dates (D-EVENT).
349
+ *
350
+ * WHY THIS IS NOT LEFT TO THE CALLER
351
+ * An event product is bought in advance and earned on the day it happens: the money is deferred
352
+ * revenue until then. That behaviour needs `ServicePeriodStart`/`End` — `AllBackEnd` recognizes
353
+ * 100% on the END date, and `RequireServicePeriod` refuses to run without one.
354
+ *
355
+ * Leaving those dates to whoever creates the line means the recognition date for a conference is
356
+ * hand-typed on every ticket sold, and a typo silently books revenue in the wrong period. The
357
+ * event already knows when it is. Reading it from `EventProduct` makes the correct answer the
358
+ * default and the ticket line carry no date at all.
359
+ *
360
+ * An explicitly-set period WINS and is never overwritten: a line covering only part of a
361
+ * multi-day event, or a deliberate override, is a legitimate thing to express. Subscription
362
+ * lines are untouched — their period comes from the term, which is decided later and is
363
+ * authoritative over anything typed (see `materializeSubscriptions`).
364
+ *
365
+ * A product with no `EventProduct` row is simply not an event; nothing happens.
366
+ */
367
+ private applyEventServicePeriod;
368
+ /**
369
+ * Build one draft per line, submit them as ONE set, then stamp each line with its entry.
370
+ * Every step is inside the caller's transaction.
371
+ */
372
+ private bookLines;
373
+ /**
374
+ * Invoke accounting's SET operation. Resolved through MJ's class factory by key so this
375
+ * package does not hard-depend on the accounting server package at build time.
376
+ */
377
+ private submitDrafts;
378
+ /**
379
+ * Stamp each line with its BOOKING entry (NULL→value-once; trigger 51008 enforces the same
380
+ * rule independently). Recognition entries are forward-dated releases — they belong to the
381
+ * schedule, not to the line's booking pointer, so they are skipped here.
382
+ */
383
+ private stampJournalEntryIDs;
384
+ /**
385
+ * Walk up the IS-A chain to the Order Line that owns `JournalEntryID`.
386
+ * Event Order Line / Subscription Order Line instances in `this.Lines` are
387
+ * children of that row; stamping on the parent and saving with
388
+ * `IsParentEntitySave` skips leaf delegation.
389
+ */
390
+ private resolveOrderLineForStamp;
391
+ /**
392
+ * For every subscription line, apply the type's rules and materialize the Subscription (find,
393
+ * extend, reactivate, or create) plus the SubscriptionTerm this purchase bought.
394
+ *
395
+ * Runs BEFORE booking so the recognition entries can anchor to the term and use its
396
+ * anchored/prorated window — a calendar-anchored membership bought in July does NOT recognize
397
+ * over July→July; it recognizes over July→Dec at a prorated amount.
398
+ *
399
+ * All rule evaluation is delegated to `SubscriptionBehavior`, which is pure. This method does
400
+ * the persistence, inside the caller's transaction.
401
+ */
402
+ private materializeSubscriptions;
403
+ /**
404
+ * Evaluate the subscription rules for every pending line, BEFORE any of them is inserted.
405
+ *
406
+ * Pure with respect to this app's tables — it reads the catalog and any existing subscription,
407
+ * then asks the behaviour what to do. Nothing is written, so a rules rejection aborts the
408
+ * confirm before a single line exists.
409
+ */
410
+ private decideSubscriptions;
411
+ /**
412
+ * WHO a line is for: the line's ship-to, falling back to the order header (D61).
413
+ *
414
+ * Ship-to on a line means "where this goes" for a physical product and "who this is for" when
415
+ * there is nothing to ship. A subscription line therefore reads its subscriber from the same
416
+ * fields a shipped line reads its destination from — one question, two kinds of answer.
417
+ *
418
+ * The fallback is per-side, not all-or-nothing: a line may name only a person (a seat bought
419
+ * under the order's customer organization) and still inherit that organization from the header.
420
+ */
421
+ private resolveSubscriber;
422
+ /**
423
+ * Fill in the organization from the person's affiliation, when it was left blank (D64).
424
+ *
425
+ * Only ever ADDS: an organization that was stated — on the line, the order's ship-to, or its
426
+ * customer — is never second-guessed. And it only runs when the setting says so, so a
427
+ * deployment that would rather not infer anything simply turns it off and blank stays blank.
428
+ */
429
+ private withInferredOrganization;
430
+ /**
431
+ * The organization a person belonged to AS OF the order date (D64).
432
+ *
433
+ * `Person` has no organization column — bizapps-common models affiliation as a dated
434
+ * `Relationship` (FromPersonID → ToOrganizationID, with StartDate/EndDate/Status). So this is a
435
+ * point-in-time question, and the answer legitimately changes when someone moves employer. That
436
+ * is exactly why the result is STAMPED onto the order rather than resolved on read: deriving it
437
+ * later would silently rewrite the history of an order that is otherwise immutable once booked.
438
+ *
439
+ * The rule, per Amith:
440
+ * zero qualifying affiliations → leave blank. That IS a personal order — no flag needed,
441
+ * because "person, no organization" already says it.
442
+ * exactly one → use it.
443
+ * more than one → the most recent by StartDate. A person can hold several at
444
+ * once (employee here, board member there), and Relationship
445
+ * has no uniqueness constraint, so this case is normal rather
446
+ * than exceptional and needs a stated rule instead of a guess.
447
+ *
448
+ * Which relationship types qualify is a SETTING, defaulting to `Employee` — being a `Vendor` to
449
+ * an organization must not make it your bill-to.
450
+ */
451
+ private organizationAsOf;
452
+ /** Lines whose product carries a subscription type, joined to their rules. */
453
+ private subscriptionLines;
454
+ /**
455
+ * The behaviour object: the base class when the type has no driver (the common case — the
456
+ * columns ARE the rules, D45), or a registered subclass when one is named.
457
+ */
458
+ private behaviorFor;
459
+ /**
460
+ * The subscription this purchase attaches to.
461
+ *
462
+ * A RENEWAL names its subscription outright (D55) — resolving by (customer, product) instead
463
+ * would be a guess, and would pick the wrong one whenever a customer holds two subscriptions to
464
+ * the same product under an `AllowMultiple` type.
465
+ */
466
+ private findExistingSubscription;
467
+ /** Load a subscription plus the end and number of its latest term, by whatever filter. */
468
+ private loadSubscriptionState;
469
+ private createSubscription;
470
+ /**
471
+ * Append to the subscription's immutable lifecycle log.
472
+ *
473
+ * The log is the answer to "what happened to this membership, and when" — the question support
474
+ * actually gets asked. Writing it at every transition is the only thing that makes the table
475
+ * worth having; a `SubscriptionEvent` table nobody writes to is just schema.
476
+ */
477
+ private logSubscriptionEvent;
478
+ /** Extension or reactivation — the term is what changes; the subscription just re-activates. */
479
+ private touchExistingSubscription;
480
+ /**
481
+ * Mint the next `SUB-{seq}` from the SubscriptionSequence singleton.
482
+ *
483
+ * A subscription number is member-facing — it is the "membership number" someone reads over the
484
+ * phone — so it gets its own counter rather than being derived from whichever order created it.
485
+ */
486
+ private assignSubscriptionNumber;
487
+ /**
488
+ * Mint the next `ORD-{seq}` from the OrderSequence singleton.
489
+ *
490
+ * The order IS the invoice (D2), so this is an A/R document number and auditors expect it to
491
+ * be gap-conscious. Taken with UPDLOCK+HOLDLOCK inside the caller's transaction so concurrent
492
+ * confirms serialize on the counter rather than colliding on the UNIQUE index.
493
+ *
494
+ * Currently a GLOBAL sequence per D30. Jeremy's global-vs-per-company call is still open; the
495
+ * change would be a WHERE clause here plus a CompanyID on the sequence table.
496
+ */
497
+ private assignOrderNumber;
498
+ /**
499
+ * Take the next value from one of the singleton counter tables.
500
+ *
501
+ * Taken with UPDLOCK+HOLDLOCK inside the CALLER'S transaction, so concurrent confirms serialize
502
+ * on the counter row rather than colliding on the UNIQUE index — and a confirm that rolls back
503
+ * releases its number rather than burning it.
504
+ *
505
+ * `OUTPUT ... INTO` (not a bare `OUTPUT`): CodeGen puts an `__mj_UpdatedAt` trigger on every
506
+ * table, and SQL Server forbids a bare OUTPUT clause on a table that has triggers.
507
+ */
508
+ private nextSequence;
509
+ /**
510
+ * Turn the order's captured payment INTENT into a real payment.
511
+ *
512
+ * `InitialPaymentTypeID`/`Amount`/`DetailID` are a convenience capture at order entry; on
513
+ * confirm they become a PaymentHeader plus a PaymentLine applied to this order. The rollup
514
+ * triggers then move AmountPaid/Balance/PaymentStatus on their own (D41) — nothing here
515
+ * touches those fields.
516
+ *
517
+ * The instrument is COPIED, never shared (D39): the order keeps its snapshot of what was
518
+ * intended, the payment gets its own record of what ran, and neither can rewrite the other.
519
+ */
520
+ /**
521
+ * Refuse the confirm when the initial tender needs a reference and none reached us.
522
+ *
523
+ * "None reached us" means no typed `InitialPaymentReference`, no `InitialPaymentDetailID`,
524
+ * or a detail whose `ReferenceNumber` is blank — an instrument row with an empty reference
525
+ * is the same failure wearing a foreign key.
526
+ */
527
+ private requireReferenceWhenTenderDemandsOne;
528
+ private createInitialPayment;
529
+ /** Mint a PaymentDetail from the typed check / wire / transfer number. */
530
+ private createPaymentDetailFromReference;
531
+ /** Duplicate a PaymentDetail so each host owns its own immutable snapshot (D39). */
532
+ private copyPaymentDetail;
533
+ private assignPaymentNumber;
534
+ /** Resolver + accounting engine come from the shared bridge — see AccountingBridge.ts. */
535
+ private buildResolver;
536
+ private entityIDFor;
537
+ private loadLinesForBooking;
538
+ private countPersistedLines;
539
+ }
540
+ /** Tree-shaking anchor — call from the server bootstrap so @RegisterClass is retained. */
541
+ export declare function LoadOrderEntityServer(): void;
542
+ //# sourceMappingURL=OrderEntityServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderEntityServer.d.ts","sourceRoot":"","sources":["../src/OrderEntityServer.ts"],"names":[],"mappings":"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"}