@mj-biz-apps/orders-server 5.16.0 → 5.18.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/__tests__/invoice-as-of-date.test.d.ts +2 -0
- package/dist/__tests__/invoice-as-of-date.test.d.ts.map +1 -0
- package/dist/__tests__/invoice-as-of-date.test.js +50 -0
- package/dist/__tests__/invoice-as-of-date.test.js.map +1 -0
- package/dist/__tests__/spawn-renewals-as-of-date.test.d.ts +2 -0
- package/dist/__tests__/spawn-renewals-as-of-date.test.d.ts.map +1 -0
- package/dist/__tests__/spawn-renewals-as-of-date.test.js +42 -0
- package/dist/__tests__/spawn-renewals-as-of-date.test.js.map +1 -0
- package/dist/custom/enforce-payment-gated-access.action.d.ts +31 -0
- package/dist/custom/enforce-payment-gated-access.action.d.ts.map +1 -0
- package/dist/custom/enforce-payment-gated-access.action.js +117 -0
- package/dist/custom/enforce-payment-gated-access.action.js.map +1 -0
- package/dist/custom/spawn-renewals.action.d.ts.map +1 -1
- package/dist/custom/spawn-renewals.action.js +9 -1
- package/dist/custom/spawn-renewals.action.js.map +1 -1
- package/dist/generated/graphql-schemas/__mj_BizAppsOrders.d.ts +24 -0
- package/dist/generated/graphql-schemas/__mj_BizAppsOrders.d.ts.map +1 -1
- package/dist/generated/graphql-schemas/__mj_BizAppsOrders.js +99 -0
- package/dist/generated/graphql-schemas/__mj_BizAppsOrders.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/services/invoice-renderer.d.ts +1 -1
- package/dist/services/invoice-renderer.d.ts.map +1 -1
- package/dist/services/invoice-renderer.js +20 -2
- package/dist/services/invoice-renderer.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice-as-of-date.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/invoice-as-of-date.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An invoice asked for a day that does not exist is refused, not dated today (#209).
|
|
3
|
+
*
|
|
4
|
+
* `RenderInvoiceDocuments` is the boundary both `Orders.GenerateInvoice` and `Orders.SendDocument`
|
|
5
|
+
* come through, and everything below it NORMALISES: `AsDateValue` answers `null` for `2026-02-30`,
|
|
6
|
+
* so the day would fall back to today — on the printed date and on the days-until-due countdown —
|
|
7
|
+
* with nothing to tell the caller their date never existed.
|
|
8
|
+
*
|
|
9
|
+
* The refusal has to happen before any work, which is what the empty provider below proves: if the
|
|
10
|
+
* guard did not fire, `BuildInvoiceDocuments` would be reached and throw on it.
|
|
11
|
+
*/
|
|
12
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
13
|
+
const mocks = vi.hoisted(() => ({
|
|
14
|
+
// Whether the builder was reached is the assertion: a refusal must happen BEFORE any work,
|
|
15
|
+
// and a guard that refuses everything must not.
|
|
16
|
+
build: vi.fn().mockResolvedValue({ Success: false, Message: 'builder reached', Documents: [] }),
|
|
17
|
+
}));
|
|
18
|
+
vi.mock('@mj-biz-apps/orders-core-entities-server', async (importOriginal) => {
|
|
19
|
+
const actual = await importOriginal();
|
|
20
|
+
return { ...actual, BuildInvoiceDocuments: mocks.build };
|
|
21
|
+
});
|
|
22
|
+
import { RenderInvoiceDocuments } from '../services/invoice-renderer.js';
|
|
23
|
+
const ORDER = '3f2504e0-4f89-41d3-9a0c-0305e82c3301';
|
|
24
|
+
const provider = {};
|
|
25
|
+
const user = { ID: 'user-1' };
|
|
26
|
+
describe('RenderInvoiceDocuments validates the day it was asked for', () => {
|
|
27
|
+
beforeEach(() => mocks.build.mockClear());
|
|
28
|
+
it.each([
|
|
29
|
+
['2026-02-30', 'a well-formed day that does not exist — Date.parse rolls it to 2 March'],
|
|
30
|
+
['2026-13-01', 'a month that does not exist'],
|
|
31
|
+
['not-a-date', 'plain garbage'],
|
|
32
|
+
])('refuses %s (%s)', async (asOf) => {
|
|
33
|
+
const res = await RenderInvoiceDocuments(ORDER, provider, user, { AsOfDate: asOf });
|
|
34
|
+
expect(res.Success).toBe(false);
|
|
35
|
+
expect(res.Code).toBe('INVALID_AS_OF_DATE');
|
|
36
|
+
expect(res.Documents).toEqual([]);
|
|
37
|
+
expect(mocks.build).not.toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
it('lets a real day through to the builder, so the guard is not simply refusing everything', async () => {
|
|
40
|
+
// Guards the guard: without this, a guard that refused every input would pass the three
|
|
41
|
+
// assertions above and quietly break invoicing.
|
|
42
|
+
await RenderInvoiceDocuments(ORDER, provider, user, { AsOfDate: '2026-03-15' });
|
|
43
|
+
expect(mocks.build).toHaveBeenCalledWith(ORDER, provider, user, expect.objectContaining({ AsOf: '2026-03-15' }));
|
|
44
|
+
});
|
|
45
|
+
it('lets an omitted day through, which is the ordinary call', async () => {
|
|
46
|
+
await RenderInvoiceDocuments(ORDER, provider, user, {});
|
|
47
|
+
expect(mocks.build).toHaveBeenCalledWith(ORDER, provider, user, expect.objectContaining({ AsOf: null }));
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=invoice-as-of-date.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice-as-of-date.test.js","sourceRoot":"","sources":["../../src/__tests__/invoice-as-of-date.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAG9D,MAAM,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5B,2FAA2F;IAC3F,gDAAgD;IAChD,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,EAAE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CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wFAAwF,EAAE,KAAK,IAAI,EAAE;QACpG,wFAAwF;QACxF,gDAAgD;QAChD,MAAM,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;QAChF,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IACrH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAM,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACxD,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7G,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-renewals-as-of-date.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/spawn-renewals-as-of-date.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Orders.SpawnRenewals` refuses a day that does not exist, before it places anything (#209).
|
|
3
|
+
*
|
|
4
|
+
* The action's own guard used to be `Number.isNaN(new Date(asOf).getTime())`, which ROLLS OVER:
|
|
5
|
+
* `2026-02-30` parses as 2 March, so the check passed and a renewal pass ran — and placed real
|
|
6
|
+
* orders — for a day nobody named. The operation below now refuses the same value, so this guard
|
|
7
|
+
* is no longer the only thing standing between a typo and a billing run; what it still owns is the
|
|
8
|
+
* refusal happening HERE, with the action's own message, before any provider work.
|
|
9
|
+
*
|
|
10
|
+
* That last part is what this test pins: the action returns on the date alone, with no metadata
|
|
11
|
+
* provider configured and no operation reached.
|
|
12
|
+
*/
|
|
13
|
+
import { describe, expect, it } from 'vitest';
|
|
14
|
+
import { SpawnRenewalsAction } from '../custom/spawn-renewals.action.js';
|
|
15
|
+
const run = (asOf) => {
|
|
16
|
+
const action = new SpawnRenewalsAction();
|
|
17
|
+
return action.InternalRunAction({
|
|
18
|
+
ContextUser: { ID: 'user-1' },
|
|
19
|
+
Params: [{ Name: 'AsOfDate', Value: asOf, Type: 'Input' }],
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
describe('Orders.SpawnRenewals refuses an impossible AsOfDate at the action boundary', () => {
|
|
23
|
+
it.each([
|
|
24
|
+
['2026-02-30', 'Date.parse rolls this to 2 March, so the old check let it through'],
|
|
25
|
+
['2026-06-31', 'June has 30 days'],
|
|
26
|
+
['not-a-date', 'plain garbage, which the old check did catch'],
|
|
27
|
+
])('refuses %s (%s)', async (asOf) => {
|
|
28
|
+
const res = await run(asOf);
|
|
29
|
+
expect(res.Success).toBe(false);
|
|
30
|
+
expect(res.ResultCode).toBe('INVALID_AS_OF_DATE');
|
|
31
|
+
});
|
|
32
|
+
it('does not refuse a real day — including a leap day, which is real', async () => {
|
|
33
|
+
// Guards the guard: a check that refused everything would satisfy the three above while
|
|
34
|
+
// making the renewal pass unrunnable. These get past the date and stop on the absent
|
|
35
|
+
// provider instead, which `InternalRunAction` reports as ERROR.
|
|
36
|
+
for (const day of ['2026-03-15', '2028-02-29']) {
|
|
37
|
+
const res = await run(day);
|
|
38
|
+
expect(res.ResultCode, day).not.toBe('INVALID_AS_OF_DATE');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=spawn-renewals-as-of-date.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AAE,CAAC;YAC7C,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;YAC3B,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC/D,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `Orders: Enforce Payment-Gated Access` — the nightly pass for bc-aidp-next-golive#223.
|
|
3
|
+
*
|
|
4
|
+
* A renewal goes past its cutoff with nothing being written; only a day passes. The payment path
|
|
5
|
+
* moves grants when cash moves, and this is the caller for the other half: MJ's scheduler dispatches
|
|
6
|
+
* Actions, so the Action is how the clock reaches `EnforcePaymentGatedAccess`.
|
|
7
|
+
*
|
|
8
|
+
* NO ACCESS LOGIC LIVES HERE. Candidate selection, the decision and the writes are all in
|
|
9
|
+
* `PaymentGatedAccess.ts`; this reads parameters, calls it, and reports what came back.
|
|
10
|
+
*
|
|
11
|
+
* PREVIEW IS A PARAMETER. The scheduled job ships set to Preview, so the first runs report what they
|
|
12
|
+
* would suspend and write nothing. Setting Preview to false is the act that starts cutting access.
|
|
13
|
+
*
|
|
14
|
+
* @module @mj-biz-apps/orders-server
|
|
15
|
+
*/
|
|
16
|
+
import { BaseAction } from '@memberjunction/actions';
|
|
17
|
+
import type { ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
18
|
+
/**
|
|
19
|
+
* Suspend renewals past the cutoff and restore grants whose payment has arrived.
|
|
20
|
+
*
|
|
21
|
+
* Inputs: `AsOfDate`, `Preview`, `MaxCount` — all optional.
|
|
22
|
+
* Outputs: `Activated`, `Suspended`, `Changes`, `Failures`, `PreviewedOnly`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class EnforcePaymentGatedAccessAction extends BaseAction {
|
|
25
|
+
/** An action must not throw at its caller — same reasoning as the other hand-authored actions. */
|
|
26
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
27
|
+
private enforce;
|
|
28
|
+
}
|
|
29
|
+
/** Tree-shaking anchor — without it the decorator never runs and the action has nothing behind it. */
|
|
30
|
+
export declare function LoadEnforcePaymentGatedAccessAction(): void;
|
|
31
|
+
//# sourceMappingURL=enforce-payment-gated-access.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enforce-payment-gated-access.action.d.ts","sourceRoot":"","sources":["../../src/custom/enforce-payment-gated-access.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAe,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA0BrG;;;;;GAKG;AACH,qBACa,+BAAgC,SAAQ,UAAU;IAC3D,kGAAkG;cAClF,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;YAQzE,OAAO;CAkDxB;AAED,sGAAsG;AACtG,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `Orders: Enforce Payment-Gated Access` — the nightly pass for bc-aidp-next-golive#223.
|
|
3
|
+
*
|
|
4
|
+
* A renewal goes past its cutoff with nothing being written; only a day passes. The payment path
|
|
5
|
+
* moves grants when cash moves, and this is the caller for the other half: MJ's scheduler dispatches
|
|
6
|
+
* Actions, so the Action is how the clock reaches `EnforcePaymentGatedAccess`.
|
|
7
|
+
*
|
|
8
|
+
* NO ACCESS LOGIC LIVES HERE. Candidate selection, the decision and the writes are all in
|
|
9
|
+
* `PaymentGatedAccess.ts`; this reads parameters, calls it, and reports what came back.
|
|
10
|
+
*
|
|
11
|
+
* PREVIEW IS A PARAMETER. The scheduled job ships set to Preview, so the first runs report what they
|
|
12
|
+
* would suspend and write nothing. Setting Preview to false is the act that starts cutting access.
|
|
13
|
+
*
|
|
14
|
+
* @module @mj-biz-apps/orders-server
|
|
15
|
+
*/
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
import { BaseAction } from '@memberjunction/actions';
|
|
23
|
+
import { Metadata } from '@memberjunction/core';
|
|
24
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
25
|
+
import { EnforcePaymentGatedAccess } from '@mj-biz-apps/orders-core-entities-server';
|
|
26
|
+
function param(params, name) {
|
|
27
|
+
const raw = params.Params?.find((p) => p.Name?.toLowerCase() === name.toLowerCase())?.Value;
|
|
28
|
+
if (raw == null)
|
|
29
|
+
return null;
|
|
30
|
+
const value = String(raw).trim();
|
|
31
|
+
// A scheduler writes an unset parameter as an empty string, so blank is absent.
|
|
32
|
+
return value.length ? value : null;
|
|
33
|
+
}
|
|
34
|
+
function setOutput(params, name, value) {
|
|
35
|
+
const existing = params.Params?.find((p) => p.Name?.toLowerCase() === name.toLowerCase());
|
|
36
|
+
if (existing) {
|
|
37
|
+
existing.Value = value;
|
|
38
|
+
existing.Type = 'Output';
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
params.Params = params.Params ?? [];
|
|
42
|
+
params.Params.push({ Name: name, Value: value, Type: 'Output' });
|
|
43
|
+
}
|
|
44
|
+
const refuse = (ResultCode, Message) => ({ Success: false, ResultCode, Message });
|
|
45
|
+
/**
|
|
46
|
+
* Suspend renewals past the cutoff and restore grants whose payment has arrived.
|
|
47
|
+
*
|
|
48
|
+
* Inputs: `AsOfDate`, `Preview`, `MaxCount` — all optional.
|
|
49
|
+
* Outputs: `Activated`, `Suspended`, `Changes`, `Failures`, `PreviewedOnly`.
|
|
50
|
+
*/
|
|
51
|
+
let EnforcePaymentGatedAccessAction = class EnforcePaymentGatedAccessAction extends BaseAction {
|
|
52
|
+
/** An action must not throw at its caller — same reasoning as the other hand-authored actions. */
|
|
53
|
+
async InternalRunAction(params) {
|
|
54
|
+
try {
|
|
55
|
+
return await this.enforce(params);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
return refuse('ERROR', `The payment-gated access pass failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async enforce(params) {
|
|
62
|
+
const user = params.ContextUser;
|
|
63
|
+
if (!user)
|
|
64
|
+
return refuse('NO_CONTEXT_USER', 'ContextUser is required: suspending access has to be attributable to somebody.');
|
|
65
|
+
const input = {};
|
|
66
|
+
const asOf = param(params, 'AsOfDate');
|
|
67
|
+
if (asOf !== null) {
|
|
68
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(asOf) || Number.isNaN(new Date(asOf).getTime())) {
|
|
69
|
+
return refuse('INVALID_AS_OF_DATE', `'${asOf}' is not a date. AsOfDate takes YYYY-MM-DD, and is omitted for "today".`);
|
|
70
|
+
}
|
|
71
|
+
input.AsOfDate = asOf;
|
|
72
|
+
}
|
|
73
|
+
const preview = param(params, 'Preview');
|
|
74
|
+
if (preview !== null) {
|
|
75
|
+
// Refused rather than guessed: the wrong guess suspends customers.
|
|
76
|
+
const v = preview.toLowerCase();
|
|
77
|
+
if (['true', '1', 'yes', 'y'].includes(v))
|
|
78
|
+
input.Preview = true;
|
|
79
|
+
else if (['false', '0', 'no', 'n'].includes(v))
|
|
80
|
+
input.Preview = false;
|
|
81
|
+
else
|
|
82
|
+
return refuse('INVALID_PREVIEW', `Preview takes true or false — got '${preview}'.`);
|
|
83
|
+
}
|
|
84
|
+
const maxCount = param(params, 'MaxCount');
|
|
85
|
+
if (maxCount !== null) {
|
|
86
|
+
const n = Number(maxCount);
|
|
87
|
+
if (!Number.isInteger(n) || n < 1) {
|
|
88
|
+
return refuse('INVALID_MAX_COUNT', `MaxCount must be a whole number of at least 1 — got '${maxCount}'.`);
|
|
89
|
+
}
|
|
90
|
+
input.MaxCount = n;
|
|
91
|
+
}
|
|
92
|
+
const provider = params.Provider ?? Metadata.Provider;
|
|
93
|
+
const output = await EnforcePaymentGatedAccess(input, provider, user);
|
|
94
|
+
setOutput(params, 'Activated', output.Activated);
|
|
95
|
+
setOutput(params, 'Suspended', output.Suspended);
|
|
96
|
+
setOutput(params, 'Changes', output.Changes);
|
|
97
|
+
setOutput(params, 'Failures', output.Failures);
|
|
98
|
+
// Not named `Preview`: an output overwrites the param row of the same name, and whether a
|
|
99
|
+
// run was a rehearsal is the one fact the run record has to keep.
|
|
100
|
+
setOutput(params, 'PreviewedOnly', input.Preview === true);
|
|
101
|
+
return {
|
|
102
|
+
Success: output.Success,
|
|
103
|
+
ResultCode: !output.Success ? 'PARTIAL' : input.Preview ? 'PREVIEWED' : 'COMPLETED',
|
|
104
|
+
Params: params.Params,
|
|
105
|
+
Message: output.Message ?? '',
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
EnforcePaymentGatedAccessAction = __decorate([
|
|
110
|
+
RegisterClass(BaseAction, 'Orders.EnforcePaymentGatedAccess')
|
|
111
|
+
], EnforcePaymentGatedAccessAction);
|
|
112
|
+
export { EnforcePaymentGatedAccessAction };
|
|
113
|
+
/** Tree-shaking anchor — without it the decorator never runs and the action has nothing behind it. */
|
|
114
|
+
export function LoadEnforcePaymentGatedAccessAction() {
|
|
115
|
+
void EnforcePaymentGatedAccessAction;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=enforce-payment-gated-access.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enforce-payment-gated-access.action.js","sourceRoot":"","sources":["../../src/custom/enforce-payment-gated-access.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAA0B,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAuC,MAAM,0CAA0C,CAAC;AAE1H,SAAS,KAAK,CAAC,MAAuB,EAAE,IAAY;IAChD,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,KAAK,CAAC;IAC5F,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,gFAAgF;IAChF,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC;AAED,SAAS,SAAS,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;IACpE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1F,IAAI,QAAQ,EAAE,CAAC;QACX,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;QACvB,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC;QACzB,OAAO;IACX,CAAC;IACD,MAAM,CAAC,MAAM,GAAG,MAAM,C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QAEtE,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACjD,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACjD,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/C,0FAA0F;QAC1F,kEAAkE;QAClE,SAAS,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;QAE3D,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,UAAU,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW;YACnF,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;SAChC,CAAC;IACN,CAAC;CACJ,CAAA;AA5DY,+BAA+B;IAD3C,aAAa,CAAC,UAAU,EAAE,kCAAkC,CAAC;GACjD,+BAA+B,CA4D3C;;AAED,sGAAsG;AACtG,MAAM,UAAU,mCAAmC;IAC/C,KAAK,+BAA+B,CAAC;AACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-renewals.action.d.ts","sourceRoot":"","sources":["../../src/custom/spawn-renewals.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAe,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"spawn-renewals.action.d.ts","sourceRoot":"","sources":["../../src/custom/spawn-renewals.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAe,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAiErG;;;;;GAKG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IAC/C,kGAAkG;cAClF,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;YAYzE,KAAK;CAkItB;AAED,sGAAsG;AACtG,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
|
|
@@ -34,6 +34,7 @@ import { BaseAction } from '@memberjunction/actions';
|
|
|
34
34
|
import { Metadata } from '@memberjunction/core';
|
|
35
35
|
import { RegisterClass } from '@memberjunction/global';
|
|
36
36
|
import { OrdersSpawnRenewalsOperation } from '@mj-biz-apps/orders-entities';
|
|
37
|
+
import { RequireDate } from '@mj-biz-apps/orders-core-entities-server';
|
|
37
38
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
38
39
|
function param(params, name) {
|
|
39
40
|
return params.Params?.find((p) => p.Name?.toLowerCase() === name.toLowerCase())?.Value;
|
|
@@ -127,7 +128,14 @@ let SpawnRenewalsAction = class SpawnRenewalsAction extends BaseAction {
|
|
|
127
128
|
// A date we cannot read is refused rather than quietly replaced with today. Today is
|
|
128
129
|
// the one value most likely to look right and be wrong — a preview run for the cutover
|
|
129
130
|
// would silently report the wrong quarter, and a live run would bill it.
|
|
130
|
-
|
|
131
|
+
//
|
|
132
|
+
// Through `RequireDate` rather than `new Date(asOf)`, which ROLLS OVER: `2026-02-30`
|
|
133
|
+
// parsed happily as 2 March, so the check passed and the pass ran for a day nobody
|
|
134
|
+
// named. The operation below refuses it too; this keeps the action's own message.
|
|
135
|
+
try {
|
|
136
|
+
RequireDate(asOf, 'AsOfDate');
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
131
139
|
return {
|
|
132
140
|
Success: false,
|
|
133
141
|
ResultCode: 'INVALID_AS_OF_DATE',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-renewals.action.js","sourceRoot":"","sources":["../../src/custom/spawn-renewals.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAA0B,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAA2B,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"spawn-renewals.action.js","sourceRoot":"","sources":["../../src/custom/spawn-renewals.action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAA0B,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAA2B,MAAM,8BAA8B,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,MAAM,IAAI,GAAG,iEAAiE,CAAC;AAE/E,SAAS,KAAK,CAAC,MAAuB,EAAE,IAAY;IAChD,OAAO,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,KAAK,CAAC;AAC3F,CAAC;AAED,SAAS,QAAQ,CAAC,MAAuB,EAAE,IAAY;IACnD,MAAM,GAAG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O,EAAE,KAAK;gBACd,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,4BAA4B;gBACrE,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EACH,GAAG,MAAM,CAAC,MAAM,6BAA6B,QAAQ,CAAC,MAAM,wCAAwC;oBACpG,kCAAkC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;oBAC/D,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG;aAC3E,CAAC;QACN,CAAC;QAED,OAAO;YACH,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW;YAC9D,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,GAAG,MAAM,CAAC,MAAM,6BAA6B,MAAM,CAAC,OAAO,WAAW;SACpG,CAAC;IACN,CAAC;CACJ,CAAA;AAhJY,mBAAmB;IAD/B,aAAa,CAAC,UAAU,EAAE,sBAAsB,CAAC;GACrC,mBAAmB,CAgJ/B;;AAED,sGAAsG;AACtG,MAAM,UAAU,uBAAuB;IACnC,KAAK,mBAAmB,CAAC;AAC7B,CAAC"}
|
|
@@ -504,6 +504,9 @@ export declare class mjBizAppsOrdersEntitlementGrant_ {
|
|
|
504
504
|
RevocationReason?: string;
|
|
505
505
|
_mj__CreatedAt: Date;
|
|
506
506
|
_mj__UpdatedAt: Date;
|
|
507
|
+
GrantTimingApplied?: string;
|
|
508
|
+
SuspendedAt?: Date;
|
|
509
|
+
SuspensionReason?: string;
|
|
507
510
|
ProductEntitlement?: string;
|
|
508
511
|
Subscription?: string;
|
|
509
512
|
BeneficiaryPerson?: string;
|
|
@@ -526,6 +529,9 @@ export declare class CreatemjBizAppsOrdersEntitlementGrantInput {
|
|
|
526
529
|
SubscriptionTermID: string | null;
|
|
527
530
|
RevokedAt: Date | null;
|
|
528
531
|
RevocationReason: string | null;
|
|
532
|
+
GrantTimingApplied: string | null;
|
|
533
|
+
SuspendedAt: Date | null;
|
|
534
|
+
SuspensionReason: string | null;
|
|
529
535
|
RestoreContext___?: RestoreContextInput;
|
|
530
536
|
}
|
|
531
537
|
export declare class UpdatemjBizAppsOrdersEntitlementGrantInput {
|
|
@@ -544,6 +550,9 @@ export declare class UpdatemjBizAppsOrdersEntitlementGrantInput {
|
|
|
544
550
|
SubscriptionTermID?: string | null;
|
|
545
551
|
RevokedAt?: Date | null;
|
|
546
552
|
RevocationReason?: string | null;
|
|
553
|
+
GrantTimingApplied?: string | null;
|
|
554
|
+
SuspendedAt?: Date | null;
|
|
555
|
+
SuspensionReason?: string | null;
|
|
547
556
|
OldValues___?: KeyValuePairInput[];
|
|
548
557
|
RestoreContext___?: RestoreContextInput;
|
|
549
558
|
}
|
|
@@ -616,7 +625,9 @@ export declare class mjBizAppsOrdersEventOrderLine_ {
|
|
|
616
625
|
DimensionID?: string;
|
|
617
626
|
DimensionValueID?: string;
|
|
618
627
|
Person?: string;
|
|
628
|
+
BilledToDate: number;
|
|
619
629
|
ReadableFields___?: string[];
|
|
630
|
+
RecognizedToDate: number;
|
|
620
631
|
}
|
|
621
632
|
export declare class CreatemjBizAppsOrdersEventOrderLineInput {
|
|
622
633
|
ID?: string;
|
|
@@ -666,6 +677,8 @@ export declare class CreatemjBizAppsOrdersEventOrderLineInput {
|
|
|
666
677
|
PriceOverrideReason: string | null;
|
|
667
678
|
DimensionID: string | null;
|
|
668
679
|
DimensionValueID: string | null;
|
|
680
|
+
BilledToDate?: number;
|
|
681
|
+
RecognizedToDate?: number;
|
|
669
682
|
RestoreContext___?: RestoreContextInput;
|
|
670
683
|
}
|
|
671
684
|
export declare class UpdatemjBizAppsOrdersEventOrderLineInput {
|
|
@@ -716,6 +729,8 @@ export declare class UpdatemjBizAppsOrdersEventOrderLineInput {
|
|
|
716
729
|
PriceOverrideReason?: string | null;
|
|
717
730
|
DimensionID?: string | null;
|
|
718
731
|
DimensionValueID?: string | null;
|
|
732
|
+
BilledToDate?: number;
|
|
733
|
+
RecognizedToDate?: number;
|
|
719
734
|
OldValues___?: KeyValuePairInput[];
|
|
720
735
|
RestoreContext___?: RestoreContextInput;
|
|
721
736
|
}
|
|
@@ -1516,6 +1531,8 @@ export declare class mjBizAppsOrdersOrderLine_ {
|
|
|
1516
1531
|
PriceOverrideReason?: string;
|
|
1517
1532
|
DimensionID?: string;
|
|
1518
1533
|
DimensionValueID?: string;
|
|
1534
|
+
BilledToDate: number;
|
|
1535
|
+
RecognizedToDate: number;
|
|
1519
1536
|
OrderHeader?: string;
|
|
1520
1537
|
Product?: string;
|
|
1521
1538
|
Company?: string;
|
|
@@ -1568,6 +1585,8 @@ export declare class CreatemjBizAppsOrdersOrderLineInput {
|
|
|
1568
1585
|
PriceOverrideReason: string | null;
|
|
1569
1586
|
DimensionID: string | null;
|
|
1570
1587
|
DimensionValueID: string | null;
|
|
1588
|
+
BilledToDate?: number;
|
|
1589
|
+
RecognizedToDate?: number;
|
|
1571
1590
|
RestoreContext___?: RestoreContextInput;
|
|
1572
1591
|
}
|
|
1573
1592
|
export declare class UpdatemjBizAppsOrdersOrderLineInput {
|
|
@@ -1604,6 +1623,8 @@ export declare class UpdatemjBizAppsOrdersOrderLineInput {
|
|
|
1604
1623
|
PriceOverrideReason?: string | null;
|
|
1605
1624
|
DimensionID?: string | null;
|
|
1606
1625
|
DimensionValueID?: string | null;
|
|
1626
|
+
BilledToDate?: number;
|
|
1627
|
+
RecognizedToDate?: number;
|
|
1607
1628
|
OldValues___?: KeyValuePairInput[];
|
|
1608
1629
|
RestoreContext___?: RestoreContextInput;
|
|
1609
1630
|
}
|
|
@@ -1785,6 +1806,7 @@ export declare class mjBizAppsOrdersPaymentHeader_ {
|
|
|
1785
1806
|
IdempotencyKey?: string;
|
|
1786
1807
|
_mj__CreatedAt: Date;
|
|
1787
1808
|
_mj__UpdatedAt: Date;
|
|
1809
|
+
ReversalSource?: string;
|
|
1788
1810
|
ReceivingCompany?: string;
|
|
1789
1811
|
BillToPerson?: string;
|
|
1790
1812
|
BillToOrganization?: string;
|
|
@@ -1819,6 +1841,7 @@ export declare class CreatemjBizAppsOrdersPaymentHeaderInput {
|
|
|
1819
1841
|
Description: string | null;
|
|
1820
1842
|
Notes: string | null;
|
|
1821
1843
|
IdempotencyKey: string | null;
|
|
1844
|
+
ReversalSource: string | null;
|
|
1822
1845
|
RestoreContext___?: RestoreContextInput;
|
|
1823
1846
|
}
|
|
1824
1847
|
export declare class UpdatemjBizAppsOrdersPaymentHeaderInput {
|
|
@@ -1844,6 +1867,7 @@ export declare class UpdatemjBizAppsOrdersPaymentHeaderInput {
|
|
|
1844
1867
|
Description?: string | null;
|
|
1845
1868
|
Notes?: string | null;
|
|
1846
1869
|
IdempotencyKey?: string | null;
|
|
1870
|
+
ReversalSource?: string | null;
|
|
1847
1871
|
OldValues___?: KeyValuePairInput[];
|
|
1848
1872
|
RestoreContext___?: RestoreContextInput;
|
|
1849
1873
|
}
|