@mj-biz-apps/orders-core-entities-server 5.26.0 → 5.28.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.
- package/dist/CheckCoverageOverlapOperation.d.ts +28 -0
- package/dist/CheckCoverageOverlapOperation.d.ts.map +1 -0
- package/dist/CheckCoverageOverlapOperation.js +70 -0
- package/dist/CheckCoverageOverlapOperation.js.map +1 -0
- package/dist/DetectOverlappingSubscriptionsOperation.d.ts +13 -2
- package/dist/DetectOverlappingSubscriptionsOperation.d.ts.map +1 -1
- package/dist/DetectOverlappingSubscriptionsOperation.js +17 -3
- package/dist/DetectOverlappingSubscriptionsOperation.js.map +1 -1
- package/dist/EntitlementBehavior.d.ts +4 -3
- package/dist/EntitlementBehavior.d.ts.map +1 -1
- package/dist/EntitlementBehavior.js +4 -3
- package/dist/EntitlementBehavior.js.map +1 -1
- package/dist/ExternalInvoiceBehavior.d.ts +12 -8
- package/dist/ExternalInvoiceBehavior.d.ts.map +1 -1
- package/dist/ExternalInvoiceBehavior.js +4 -4
- package/dist/ExternalInvoiceBehavior.js.map +1 -1
- package/dist/GetExternalInvoicingWorklistOperation.d.ts +6 -3
- package/dist/GetExternalInvoicingWorklistOperation.d.ts.map +1 -1
- package/dist/GetExternalInvoicingWorklistOperation.js +44 -44
- package/dist/GetExternalInvoicingWorklistOperation.js.map +1 -1
- package/dist/InvoiceBehavior.d.ts +38 -26
- package/dist/InvoiceBehavior.d.ts.map +1 -1
- package/dist/InvoiceBehavior.js +40 -21
- package/dist/InvoiceBehavior.js.map +1 -1
- package/dist/InvoiceBuilder.d.ts +6 -4
- package/dist/InvoiceBuilder.d.ts.map +1 -1
- package/dist/InvoiceBuilder.js +9 -6
- package/dist/InvoiceBuilder.js.map +1 -1
- package/dist/IssueExternalInvoiceOperation.d.ts +15 -20
- package/dist/IssueExternalInvoiceOperation.d.ts.map +1 -1
- package/dist/IssueExternalInvoiceOperation.js +45 -49
- package/dist/IssueExternalInvoiceOperation.js.map +1 -1
- package/dist/IssueInstalmentInvoiceOperation.d.ts +6 -0
- package/dist/IssueInstalmentInvoiceOperation.d.ts.map +1 -1
- package/dist/IssueInstalmentInvoiceOperation.js +78 -44
- package/dist/IssueInstalmentInvoiceOperation.js.map +1 -1
- package/dist/OrderEntityServer.d.ts +71 -3
- package/dist/OrderEntityServer.d.ts.map +1 -1
- package/dist/OrderEntityServer.js +277 -30
- package/dist/OrderEntityServer.js.map +1 -1
- package/dist/OrderHeaderPaymentScheduleEntityServer.d.ts +7 -6
- package/dist/OrderHeaderPaymentScheduleEntityServer.d.ts.map +1 -1
- package/dist/OrderHeaderPaymentScheduleEntityServer.js +18 -31
- package/dist/OrderHeaderPaymentScheduleEntityServer.js.map +1 -1
- package/dist/OrderJournalEntryFactory.d.ts.map +1 -1
- package/dist/OrderJournalEntryFactory.js +17 -11
- package/dist/OrderJournalEntryFactory.js.map +1 -1
- package/dist/OrderLineEntityServer.d.ts +6 -0
- package/dist/OrderLineEntityServer.d.ts.map +1 -1
- package/dist/OrderLineEntityServer.js +15 -4
- package/dist/OrderLineEntityServer.js.map +1 -1
- package/dist/PaymentAllocationInputs.d.ts +8 -2
- package/dist/PaymentAllocationInputs.d.ts.map +1 -1
- package/dist/PaymentAllocationInputs.js +26 -5
- package/dist/PaymentAllocationInputs.js.map +1 -1
- package/dist/PaymentHeaderEntityServer.d.ts +7 -0
- package/dist/PaymentHeaderEntityServer.d.ts.map +1 -1
- package/dist/PaymentHeaderEntityServer.js +14 -3
- package/dist/PaymentHeaderEntityServer.js.map +1 -1
- package/dist/PaymentScheduleBehavior.d.ts +74 -21
- package/dist/PaymentScheduleBehavior.d.ts.map +1 -1
- package/dist/PaymentScheduleBehavior.js +155 -38
- package/dist/PaymentScheduleBehavior.js.map +1 -1
- package/dist/RecordProgressOperation.d.ts.map +1 -1
- package/dist/RecordProgressOperation.js +3 -5
- package/dist/RecordProgressOperation.js.map +1 -1
- package/dist/ReversalResolver.d.ts.map +1 -1
- package/dist/ReversalResolver.js +6 -1
- package/dist/ReversalResolver.js.map +1 -1
- package/dist/SpawnRenewalsOperation.d.ts +51 -2
- package/dist/SpawnRenewalsOperation.d.ts.map +1 -1
- package/dist/SpawnRenewalsOperation.js +214 -23
- package/dist/SpawnRenewalsOperation.js.map +1 -1
- package/dist/SubscriptionBehavior.d.ts +125 -0
- package/dist/SubscriptionBehavior.d.ts.map +1 -1
- package/dist/SubscriptionBehavior.js +147 -5
- package/dist/SubscriptionBehavior.js.map +1 -1
- package/dist/SubscriptionFamilyRules.d.ts +34 -0
- package/dist/SubscriptionFamilyRules.d.ts.map +1 -0
- package/dist/SubscriptionFamilyRules.js +96 -0
- package/dist/SubscriptionFamilyRules.js.map +1 -0
- package/dist/entity-names.d.ts +2 -0
- package/dist/entity-names.d.ts.map +1 -1
- package/dist/entity-names.js +2 -0
- package/dist/entity-names.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
|
@@ -26,6 +26,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
26
26
|
* with the revenue it reduces. All of it inside this transaction, so the number, the stamp and the entry
|
|
27
27
|
* commit or roll back together. It reads nothing itself: the order's lines and the company's
|
|
28
28
|
* sibling rows are read here and passed in.
|
|
29
|
+
*
|
|
30
|
+
* ONE DOCUMENT, ONE ENTRY PER PRODUCT COMPANY (golive #311). The row is the order company's and is
|
|
31
|
+
* invoiced once, but A/R and revenue stay in each product's company (D13). `CompanySlices` divides
|
|
32
|
+
* the row among the companies whose lines it bills, and each company with a piece gets its own
|
|
33
|
+
* billing entry, sliced against its own pieces of the schedule, exactly as a per-company row was.
|
|
34
|
+
* On a single-company order that is one entry, unchanged.
|
|
29
35
|
*/
|
|
30
36
|
import { BaseRemotableOperation, LogError, RunView, } from '@memberjunction/core';
|
|
31
37
|
import { RegisterClass } from '@memberjunction/global';
|
|
@@ -35,7 +41,7 @@ import { BuildGLAccountResolver, EntityIDFor } from './AccountingBridge.js';
|
|
|
35
41
|
import { EmitInstalmentInvoiceEntry } from './InstalmentInvoiceEntry.js';
|
|
36
42
|
import { BeginInstalmentIssue, EndInstalmentIssue } from './instalmentIssueGuard.js';
|
|
37
43
|
import { LoadInstalmentCashFacts } from './PaymentAllocationInputs.js';
|
|
38
|
-
import { DepositReleasedByCompany } from './PaymentScheduleBehavior.js';
|
|
44
|
+
import { CompanySlices, DepositReleasedByCompany } from './PaymentScheduleBehavior.js';
|
|
39
45
|
import { OrderJournalEntryFactory } from './OrderJournalEntryFactory.js';
|
|
40
46
|
import { InstalmentDocumentNumber } from './InvoiceBehavior.js';
|
|
41
47
|
import { ExplainShortfalls, ScheduleShortfalls } from './PaymentScheduleBehavior.js';
|
|
@@ -46,6 +52,8 @@ const BOOKED_STATUSES = new Set(['Confirmed', 'Posted', 'Fulfilled']);
|
|
|
46
52
|
/** Entity names the billing-entry factory needs; not in entity-names.ts, matching OrderEntityServer. */
|
|
47
53
|
const CHARGE_TYPE_ENTITY = 'MJ_BizApps_Orders: Charge Types';
|
|
48
54
|
const SUBSCRIPTION_TERM_ENTITY = 'MJ_BizApps_Orders: Subscription Terms';
|
|
55
|
+
/** The order company's piece first, then the others by id: the order the entries are posted in. */
|
|
56
|
+
const companyOrder = (companyID, orderCompany) => (String(companyID).toLowerCase() === orderCompany ? 0 : 1);
|
|
49
57
|
/** A refusal in the operation's own shape, usable outside the class. */
|
|
50
58
|
const refuse = (message, echo = {}) => ({ Success: false, AlreadyInvoiced: false, Message: message, ...echo });
|
|
51
59
|
/**
|
|
@@ -70,7 +78,7 @@ export async function IssueInstalment(scheduleID, provider, user) {
|
|
|
70
78
|
const row = rowResult.Results?.[0];
|
|
71
79
|
if (!row)
|
|
72
80
|
return refuse(`No instalment with ID ${scheduleID}.`);
|
|
73
|
-
const orderResult = await rv.RunView({ EntityName: ORDER_HEADER_ENTITY, ExtraFilter: `ID = '${RequireUUID(row.OrderHeaderID, 'OrderHeaderID')}'`, Fields: ['ID', 'OrderNumber', 'Status'], ResultType: 'simple' }, user);
|
|
81
|
+
const orderResult = await rv.RunView({ EntityName: ORDER_HEADER_ENTITY, ExtraFilter: `ID = '${RequireUUID(row.OrderHeaderID, 'OrderHeaderID')}'`, Fields: ['ID', 'OrderNumber', 'Status', 'CompanyID'], ResultType: 'simple' }, user);
|
|
74
82
|
const order = orderResult.Results?.[0];
|
|
75
83
|
if (!order)
|
|
76
84
|
return refuse(`Instalment ${scheduleID} belongs to an order that could not be read.`);
|
|
@@ -109,27 +117,30 @@ export async function IssueInstalment(scheduleID, provider, user) {
|
|
|
109
117
|
if (!lines.Success || !siblings.Success) {
|
|
110
118
|
return refuse(`Could not read order ${order.OrderNumber} to check its schedule: ${lines.ErrorMessage ?? siblings.ErrorMessage ?? 'unknown error'}`, echo);
|
|
111
119
|
}
|
|
112
|
-
const shortfalls = ScheduleShortfalls(siblings.Results ?? [], lines.Results ?? []);
|
|
120
|
+
const shortfalls = ScheduleShortfalls(siblings.Results ?? [], lines.Results ?? [], order.CompanyID);
|
|
113
121
|
if (shortfalls.length) {
|
|
114
122
|
const names = new Map((siblings.Results ?? []).map((s) => [String(s.CompanyID).toLowerCase(), s.Company ?? s.CompanyID]));
|
|
115
123
|
return refuse(ExplainShortfalls(order.OrderNumber, shortfalls, (id) => String(names.get(id) ?? id)), echo);
|
|
116
124
|
}
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const
|
|
125
|
+
// The number: the order number, plus the instalment number when the order has more than one
|
|
126
|
+
// (golive #311). Only a row left over from a per-company schedule (one whose company is not
|
|
127
|
+
// the order's, kept because that order had already issued under it) keeps the old company
|
|
128
|
+
// letter, so it cannot collide with what that schedule already issued.
|
|
129
|
+
const orderCompany = String(order.CompanyID).toLowerCase();
|
|
130
|
+
const rowCompany = String(row.CompanyID).toLowerCase();
|
|
131
|
+
const lineCompanyIDs = [...new Set((lines.Results ?? []).map((l) => String(l.CompanyID).toLowerCase()))].sort();
|
|
132
|
+
const legacyCompanyRow = rowCompany !== orderCompany;
|
|
133
|
+
const companyIndex = legacyCompanyRow ? Math.max(0, lineCompanyIDs.indexOf(rowCompany)) : 0;
|
|
134
|
+
const companyCount = legacyCompanyRow ? Math.max(1, lineCompanyIDs.length) : 1;
|
|
135
|
+
const mine = (s) => String(s.CompanyID).toLowerCase() === rowCompany;
|
|
122
136
|
// THE COUNT INCLUDES CANCELLED ROWS, DELIBERATELY (golive #242, Robert). The suffix exists
|
|
123
137
|
// to disambiguate, and a cancelled instalment does not give its number back: archiving an
|
|
124
138
|
// invoice in Bill.com keeps the number, and re-presenting it 422s as a duplicate. Counting
|
|
125
|
-
// only live rows meant that cancelling a
|
|
126
|
-
//
|
|
127
|
-
//
|
|
139
|
+
// only live rows meant that cancelling a single instalment and adding a replacement produced
|
|
140
|
+
// the bare ORD-1234 a second time — the same number on two documents, one of which the
|
|
141
|
+
// customer may already hold.
|
|
128
142
|
const companyRows = (siblings.Results ?? []).filter(mine);
|
|
129
|
-
|
|
130
|
-
// bills nothing and must not take a share of any line.
|
|
131
|
-
const live = companyRows.filter((s) => s.Status !== 'Canceled');
|
|
132
|
-
const documentNumber = InstalmentDocumentNumber(order.OrderNumber, companyIndex, Math.max(1, companyIDs.length), Number(row.InstallmentNumber), companyRows.length);
|
|
143
|
+
const documentNumber = InstalmentDocumentNumber(order.OrderNumber, companyIndex, companyCount, Number(row.InstallmentNumber), companyRows.length);
|
|
133
144
|
// AND REFUSE IF THAT NUMBER IS ALREADY ON THE ORDER. The count rule above prevents the
|
|
134
145
|
// collision this ticket found; this catches every other route to one — a hand-stamped row,
|
|
135
146
|
// an imported schedule, a renumbering — before the number is frozen and sent, rather than
|
|
@@ -155,15 +166,38 @@ export async function IssueInstalment(scheduleID, provider, user) {
|
|
|
155
166
|
return refuse(`Could not read order ${order.OrderNumber}'s lines to bill this instalment: ${lineEntities.ErrorMessage ?? 'unknown error'}`, echo);
|
|
156
167
|
}
|
|
157
168
|
const factory = new OrderJournalEntryFactory(await BuildGLAccountResolver(provider, user), EntityIDFor(ORDER_LINE_ENTITY), EntityIDFor(SUBSCRIPTION_TERM_ENTITY), EntityIDFor(CHARGE_TYPE_ENTITY), provider, user);
|
|
158
|
-
|
|
169
|
+
// The row divided among the product companies whose lines it bills (golive #311). Each
|
|
170
|
+
// company's billing slice is taken against ITS pieces of the live rows, in InstallmentNumber
|
|
171
|
+
// order, so every instalment's pieces of a line sum to that line's full amount. A cancelled
|
|
172
|
+
// instalment bills nothing and takes no share of any line.
|
|
173
|
+
const liveRows = (siblings.Results ?? []).filter((s) => s.Status !== 'Canceled');
|
|
174
|
+
const slices = CompanySlices(liveRows, lines.Results ?? [], order.CompanyID);
|
|
175
|
+
const pieces = slices
|
|
176
|
+
.filter((s) => String(s.ID).toLowerCase() === String(row.ID).toLowerCase() && Number(s.Amount) !== 0)
|
|
177
|
+
.sort((a, b) => companyOrder(a.CompanyID, orderCompany) - companyOrder(b.CompanyID, orderCompany) || a.CompanyID.localeCompare(b.CompanyID));
|
|
178
|
+
const billings = [];
|
|
159
179
|
try {
|
|
160
|
-
|
|
180
|
+
for (const piece of pieces) {
|
|
181
|
+
const company = String(piece.CompanyID);
|
|
182
|
+
const companyLines = await factory.BuildInstalmentLineFacts(lineEntities.Results ?? [], company, invoiceDay);
|
|
183
|
+
if (!companyLines.length)
|
|
184
|
+
continue;
|
|
185
|
+
billings.push({
|
|
186
|
+
CompanyID: company,
|
|
187
|
+
Amount: Number(piece.Amount),
|
|
188
|
+
Siblings: slices
|
|
189
|
+
.filter((s) => String(s.CompanyID).toLowerCase() === company.toLowerCase())
|
|
190
|
+
.sort((a, b) => Number(a.InstallmentNumber) - Number(b.InstallmentNumber))
|
|
191
|
+
.map((r) => ({ ID: r.ID, InstallmentNumber: Number(r.InstallmentNumber), Amount: Number(r.Amount), Status: r.Status })),
|
|
192
|
+
Lines: companyLines,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
161
195
|
}
|
|
162
196
|
catch (err) {
|
|
163
197
|
return refuse(err instanceof Error ? err.message : String(err), echo);
|
|
164
198
|
}
|
|
165
|
-
if (!
|
|
166
|
-
return refuse(`Order ${order.OrderNumber} has no lines for
|
|
199
|
+
if (!billings.length) {
|
|
200
|
+
return refuse(`Order ${order.OrderNumber} has no lines for this instalment to bill, so there is nothing to invoice.`, echo);
|
|
167
201
|
}
|
|
168
202
|
// The entity refuses an issue it did not send (D91). Held across EVERY save below, since the
|
|
169
203
|
// later ones stamp a row that is by then already Invoiced, and released in the `finally`
|
|
@@ -188,30 +222,30 @@ export async function IssueInstalment(scheduleID, provider, user) {
|
|
|
188
222
|
if (!(await entity.Save())) {
|
|
189
223
|
throw new Error(entity.LatestResult?.CompleteMessage ?? 'The instalment could not be updated.');
|
|
190
224
|
}
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
225
|
+
const released = DepositReleasedByCompany(depositsBefore, await LoadInstalmentCashFacts(runView, user, order.ID));
|
|
226
|
+
// One billing entry per product company. The row records the first: the order company's
|
|
227
|
+
// when it has lines, otherwise the first company's. Every entry links to the row
|
|
228
|
+
// (LinkedRecordID), so the others are found from it.
|
|
229
|
+
let journalEntryID = null;
|
|
230
|
+
const billedByLine = new Map();
|
|
231
|
+
for (const billing of billings) {
|
|
232
|
+
const result = await EmitInstalmentInvoiceEntry({
|
|
233
|
+
OrderHeaderPaymentScheduleID: row.ID,
|
|
234
|
+
OrderHeaderID: order.ID,
|
|
235
|
+
OrderNumber: order.OrderNumber,
|
|
236
|
+
CompanyID: billing.CompanyID,
|
|
237
|
+
InstallmentNumber: Number(row.InstallmentNumber),
|
|
238
|
+
DocumentNumber: documentNumber,
|
|
239
|
+
Amount: billing.Amount,
|
|
240
|
+
InvoiceDay: invoiceDay,
|
|
241
|
+
DepositApplied: released.get(billing.CompanyID.toLowerCase()) ?? 0,
|
|
242
|
+
Siblings: billing.Siblings,
|
|
243
|
+
Lines: billing.Lines,
|
|
244
|
+
}, provider, user);
|
|
245
|
+
journalEntryID = journalEntryID ?? result.JournalEntryID;
|
|
246
|
+
for (const [lineID, billed] of result.BilledByLine)
|
|
247
|
+
billedByLine.set(lineID, billed);
|
|
248
|
+
}
|
|
215
249
|
if (journalEntryID) {
|
|
216
250
|
// Reloaded first: the rollup rewrote AmountPaid and Status when the row became
|
|
217
251
|
// billed (a fully prepaid row is Paid by now), and saving the stale copy would write
|
|
@@ -227,7 +261,7 @@ export async function IssueInstalment(scheduleID, provider, user) {
|
|
|
227
261
|
// summary of itself, so they are written by the same act that books the entry and roll
|
|
228
262
|
// back with it. A separate writer — a trigger, a later sweep — is how a total and the
|
|
229
263
|
// journal lines it summarises drift apart, and nothing downstream would report it.
|
|
230
|
-
for (const [orderLineID, billed] of
|
|
264
|
+
for (const [orderLineID, billed] of billedByLine) {
|
|
231
265
|
// Signed: a reversal line's piece is negative and must still be applied, so the
|
|
232
266
|
// guard is "did this bill anything", not "is it positive".
|
|
233
267
|
if (billed === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IssueInstalmentInvoiceOperation.js","sourceRoot":"","sources":["../src/IssueInstalmentInvoiceOperation.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACH,sBAAsB,EAEtB,QAAQ,EACR,OAAO,GAIV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACH,qCAAqC,IAAI,yCAAyC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AAU,CAAC,mBAAmB,EAAE,CAAC;YAC5C,OAAO,GAAG,CAAC;QACf,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,QAAQ,CAAC,4CAA4C,UAAU,KAAK,GAAG,EAAE,CAAC,CAAC;YAC3E,IAAI,CAAC;gBACD,MAAM,UAAU,CAAC,mBAAmB,EAAE,CAAC;YAC3C,CAAC;YAAC,OAAO,WAAW,EAAE,CAAC;gBACnB,QAAQ,CAAC,uDAAuD,WAAW,EAAE,CAAC,CAAC;YACnF,CAAC;YACD,OAAO,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACpE,CAAC;IACL,CAAC;CACJ,CAAA;AA5BY,+BAA+B;IAD3C,aAAa,CAAC,sBAAsB,EAAE,+BAA+B,CAAC;GAC1D,+BAA+B,CA4B3C;;AAED,2FAA2F;AAC3F,MAAM,UAAU,mCAAmC;IAC/C,KAAK,+BAA+B,CAAC;AACzC,CAAC"}
|
|
@@ -27,13 +27,34 @@
|
|
|
27
27
|
* OP: 'Accounting.CreateJournalEntries' (@mj-biz-apps/accounting-core-entities-server)
|
|
28
28
|
*/
|
|
29
29
|
import { EntitySaveOptions, ValidationResult } from '@memberjunction/core';
|
|
30
|
-
import { OrderHeaderEntity } from '@mj-biz-apps/orders-entities';
|
|
30
|
+
import { OrderHeaderEntity, mjBizAppsOrdersOrderLineEntity } from '@mj-biz-apps/orders-entities';
|
|
31
31
|
import { type ManualDiscountRequest, type RequestedCharge } from '@mj-biz-apps/orders-entities';
|
|
32
|
+
import { type CoverageOverlap, type CoverageOverlapDecision } from './SubscriptionBehavior.js';
|
|
33
|
+
/** A subscription line whose term overlaps coverage in its family, as a preview reports it. */
|
|
34
|
+
export interface LineCoverageOverlap {
|
|
35
|
+
Line: mjBizAppsOrdersOrderLineEntity;
|
|
36
|
+
Decision: CoverageOverlapDecision;
|
|
37
|
+
Overlaps: CoverageOverlap[];
|
|
38
|
+
}
|
|
32
39
|
export declare class OrderEntityServer extends OrderHeaderEntity {
|
|
33
40
|
/** An approved Terms concession, applied by ./PaymentTermsChange.ts, is the only change to a confirmed order's terms. */
|
|
34
41
|
protected PaymentTermsChangeSanctioned(): boolean;
|
|
35
42
|
/** Price decompositions produced during this save, written once the lines have IDs (D69). */
|
|
36
43
|
private _priceComponents;
|
|
44
|
+
/** Lines the renewal pass priced, with the price it wrote; see {@link MarkRenewalPriced}. */
|
|
45
|
+
private _renewalPricedLines;
|
|
46
|
+
/**
|
|
47
|
+
* Record that the renewal pass priced this line (golive #304).
|
|
48
|
+
*
|
|
49
|
+
* A renewal is priced from the prior term, not today's list: a lapsed discount, a grandfathered
|
|
50
|
+
* price raised by the annual increase. That can sit below the engine's price, and it is the
|
|
51
|
+
* price finance chose, not a concession someone typed. While the line still carries the price
|
|
52
|
+
* the pass wrote, the concession gate and the below-engine review treat it as engine-priced.
|
|
53
|
+
* Change the price and both judge it as usual.
|
|
54
|
+
*/
|
|
55
|
+
MarkRenewalPriced(line: mjBizAppsOrdersOrderLineEntity): void;
|
|
56
|
+
/** True for a line the renewal pass priced whose price is unchanged; matched by entity or saved ID. */
|
|
57
|
+
private isUneditedRenewalPrice;
|
|
37
58
|
/** Why a line owes no tax, by line index — written as a zero-amount component (D73). */
|
|
38
59
|
private _taxReasons;
|
|
39
60
|
private _manualDiscounts;
|
|
@@ -644,12 +665,24 @@ export declare class OrderEntityServer extends OrderHeaderEntity {
|
|
|
644
665
|
* the persistence, inside the caller's transaction.
|
|
645
666
|
*/
|
|
646
667
|
private materializeSubscriptions;
|
|
668
|
+
/**
|
|
669
|
+
* The subscription lines of this draft whose terms overlap coverage in their family, and what
|
|
670
|
+
* confirm will do with each (golive #276). Writes nothing.
|
|
671
|
+
*
|
|
672
|
+
* Runs the same decision pass confirm runs, over the SAVED lines. Lines a bundle would add at
|
|
673
|
+
* confirm are not expanded here, so a band sold inside a bundle is caught at confirm only.
|
|
674
|
+
*/
|
|
675
|
+
PreviewCoverageOverlaps(): Promise<LineCoverageOverlap[]>;
|
|
647
676
|
/**
|
|
648
677
|
* Evaluate the subscription rules for every pending line, BEFORE any of them is inserted.
|
|
649
678
|
*
|
|
650
679
|
* Pure with respect to this app's tables — it reads the catalog and any existing subscription,
|
|
651
680
|
* then asks the behaviour what to do. Nothing is written, so a rules rejection aborts the
|
|
652
681
|
* confirm before a single line exists.
|
|
682
|
+
*
|
|
683
|
+
* `preview` turns refusals into answers: a line the rules reject is skipped, and every line
|
|
684
|
+
* whose term overlaps coverage in its family is collected there instead of throwing. That is
|
|
685
|
+
* how `Orders.CheckCoverageOverlap` asks the same question confirm does without confirming.
|
|
653
686
|
*/
|
|
654
687
|
private decideSubscriptions;
|
|
655
688
|
/**
|
|
@@ -738,7 +771,35 @@ export declare class OrderEntityServer extends OrderHeaderEntity {
|
|
|
738
771
|
* the same product under an `AllowMultiple` type.
|
|
739
772
|
*/
|
|
740
773
|
private findExistingSubscription;
|
|
741
|
-
/**
|
|
774
|
+
/**
|
|
775
|
+
* The subscription filter for a dedupe match, or null when it names nobody.
|
|
776
|
+
*
|
|
777
|
+
* Match on exactly the axes the BenefitModel says define a duplicate (`DedupeMatch`). An
|
|
778
|
+
* org-held type ignores the stored person entirely (one company membership, however many
|
|
779
|
+
* employees, whoever the order named as its contact); a seat type matches BOTH, so two seats
|
|
780
|
+
* for two people never collide.
|
|
781
|
+
*/
|
|
782
|
+
private holderFilter;
|
|
783
|
+
/** Family names by ID, for the overlap message. One read for every family on the order. */
|
|
784
|
+
private loadFamilyNames;
|
|
785
|
+
/**
|
|
786
|
+
* Terms that cover this holder under OTHER bands of the product's family and end on or after
|
|
787
|
+
* `start` (golive #276). Terms after `end` are included so the caller can say when coverage
|
|
788
|
+
* runs out.
|
|
789
|
+
*
|
|
790
|
+
* Bands are the family's other products in the product's own company. A subscription counts
|
|
791
|
+
* unless it is Migrated, and its terms count unless they are Canceled or Lapsed. A Canceled
|
|
792
|
+
* subscription still counts: cancelling stamps one term and leaves the subscription's access
|
|
793
|
+
* running to `Subscription.EndDate`, so its Canceled term counts through that date, and any
|
|
794
|
+
* term it did not stamp counts in full.
|
|
795
|
+
*/
|
|
796
|
+
private loadFamilyCoverage;
|
|
797
|
+
/**
|
|
798
|
+
* Load a subscription plus the end and number of its latest term, by whatever filter.
|
|
799
|
+
*
|
|
800
|
+
* When the filter matches several, the most live one wins: Active or Trialing, then Paused,
|
|
801
|
+
* then Canceled, then the rest; among equals, one stored for `personID`, then the newest.
|
|
802
|
+
*/
|
|
742
803
|
private loadSubscriptionState;
|
|
743
804
|
private createSubscription;
|
|
744
805
|
/**
|
|
@@ -749,7 +810,14 @@ export declare class OrderEntityServer extends OrderHeaderEntity {
|
|
|
749
810
|
* worth having; a `SubscriptionEvent` table nobody writes to is just schema.
|
|
750
811
|
*/
|
|
751
812
|
private logSubscriptionEvent;
|
|
752
|
-
/**
|
|
813
|
+
/**
|
|
814
|
+
* Extension or reactivation — the term is what changes; the subscription just re-activates.
|
|
815
|
+
*
|
|
816
|
+
* `renewedOnto` is the product a renewal line names. When it is not the subscription's product,
|
|
817
|
+
* the subscription moved to a successor at renewal (golive #304), and from this term on it is a
|
|
818
|
+
* subscription to the successor: its product and type follow, so the next renewal, entitlement
|
|
819
|
+
* checks and reports all read the product the customer now holds.
|
|
820
|
+
*/
|
|
753
821
|
private touchExistingSubscription;
|
|
754
822
|
/**
|
|
755
823
|
* Mint the next `SUB-{seq}` from the SubscriptionSequence singleton.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderEntityServer.d.ts","sourceRoot":"","sources":["../src/OrderEntityServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAMH,iBAAiB,EAUjB,gBAAgB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAGH,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Order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