@mj-biz-apps/orders-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.
- package/LICENSE +183 -0
- package/README.md +47 -2
- package/dist/CheckoutServerExtension.d.ts +96 -0
- package/dist/CheckoutServerExtension.d.ts.map +1 -0
- package/dist/CheckoutServerExtension.js +554 -0
- package/dist/CheckoutServerExtension.js.map +1 -0
- package/dist/PaymentWebhookExtension.d.ts +17 -0
- package/dist/PaymentWebhookExtension.d.ts.map +1 -0
- package/dist/PaymentWebhookExtension.js +151 -0
- package/dist/PaymentWebhookExtension.js.map +1 -0
- package/dist/__tests__/CheckoutServerExtension.test.d.ts +2 -0
- package/dist/__tests__/CheckoutServerExtension.test.d.ts.map +1 -0
- package/dist/__tests__/CheckoutServerExtension.test.js +257 -0
- package/dist/__tests__/CheckoutServerExtension.test.js.map +1 -0
- package/dist/__tests__/checkout-edge-policy.test.d.ts +2 -0
- package/dist/__tests__/checkout-edge-policy.test.d.ts.map +1 -0
- package/dist/__tests__/checkout-edge-policy.test.js +70 -0
- package/dist/__tests__/checkout-edge-policy.test.js.map +1 -0
- package/dist/__tests__/checkout-host-page.test.d.ts +2 -0
- package/dist/__tests__/checkout-host-page.test.d.ts.map +1 -0
- package/dist/__tests__/checkout-host-page.test.js +86 -0
- package/dist/__tests__/checkout-host-page.test.js.map +1 -0
- package/dist/__tests__/server-extensions-manifest.test.d.ts +2 -0
- package/dist/__tests__/server-extensions-manifest.test.d.ts.map +1 -0
- package/dist/__tests__/server-extensions-manifest.test.js +29 -0
- package/dist/__tests__/server-extensions-manifest.test.js.map +1 -0
- package/dist/checkout-edge-policy.d.ts +44 -0
- package/dist/checkout-edge-policy.d.ts.map +1 -0
- package/dist/checkout-edge-policy.js +84 -0
- package/dist/checkout-edge-policy.js.map +1 -0
- package/dist/checkout-host-page.d.ts +43 -0
- package/dist/checkout-host-page.d.ts.map +1 -0
- package/dist/checkout-host-page.js +445 -0
- package/dist/checkout-host-page.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -0
- package/dist/custom/generate-invoice.action.d.ts +59 -0
- package/dist/custom/generate-invoice.action.d.ts.map +1 -0
- package/dist/custom/generate-invoice.action.js +208 -0
- package/dist/custom/generate-invoice.action.js.map +1 -0
- package/dist/custom/open-payment-intent.action.d.ts +39 -0
- package/dist/custom/open-payment-intent.action.d.ts.map +1 -0
- package/dist/custom/open-payment-intent.action.js +169 -0
- package/dist/custom/open-payment-intent.action.js.map +1 -0
- package/dist/custom/send-document.action.d.ts +78 -0
- package/dist/custom/send-document.action.d.ts.map +1 -0
- package/dist/custom/send-document.action.js +277 -0
- package/dist/custom/send-document.action.js.map +1 -0
- package/dist/generated/class-registrations-manifest.d.ts +7 -0
- package/dist/generated/class-registrations-manifest.d.ts.map +1 -0
- package/dist/generated/class-registrations-manifest.js +7 -0
- package/dist/generated/class-registrations-manifest.js.map +1 -0
- package/dist/generated/generated.d.ts +3536 -0
- package/dist/generated/generated.d.ts.map +1 -0
- package/dist/generated/generated.js +18371 -0
- package/dist/generated/generated.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/server-extensions-manifest.d.ts +14 -0
- package/dist/server-extensions-manifest.d.ts.map +1 -0
- package/dist/server-extensions-manifest.js +15 -0
- package/dist/server-extensions-manifest.js.map +1 -0
- package/dist/services/invoice-renderer.d.ts +80 -0
- package/dist/services/invoice-renderer.d.ts.map +1 -0
- package/dist/services/invoice-renderer.js +103 -0
- package/dist/services/invoice-renderer.js.map +1 -0
- package/package.json +65 -5
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BizApps Orders Server Bootstrap
|
|
3
|
+
*
|
|
4
|
+
* Server-side bootstrap package for the BizApps Orders Open App. Ensures the
|
|
5
|
+
* entity subclasses, action subclasses, and GraphQL resolvers are registered
|
|
6
|
+
* with the MJ class factory.
|
|
7
|
+
*/
|
|
8
|
+
import '@mj-biz-apps/orders-entities';
|
|
9
|
+
import '@mj-biz-apps/orders-actions';
|
|
10
|
+
import '@mj-biz-apps/orders-core-entities-server';
|
|
11
|
+
import './generated/generated.js';
|
|
12
|
+
export { CLASS_REGISTRATIONS } from './generated/class-registrations-manifest.js';
|
|
13
|
+
export { PaymentWebhookExtension, LoadPaymentWebhookExtension } from './PaymentWebhookExtension.js';
|
|
14
|
+
export { CheckoutServerExtension, LoadCheckoutServerExtension } from './CheckoutServerExtension.js';
|
|
15
|
+
export { MJ_SERVER_EXTENSIONS } from './server-extensions-manifest.js';
|
|
16
|
+
/**
|
|
17
|
+
* Absolute paths to the resolver files (generated + custom), for use with createMJServer().
|
|
18
|
+
* NOTE the `*Resolver.{js,ts}` suffix for custom resolvers (not `*.{js,ts}`): brace-expansion
|
|
19
|
+
* of `*.{js,ts}` would also match emitted `*.d.ts` files, which ts-node then fails to require.
|
|
20
|
+
*/
|
|
21
|
+
export declare const RESOLVER_PATHS: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Bootstrap function called by DynamicPackageLoader during MJAPI startup.
|
|
24
|
+
* The static imports above handle all registration; this function is the
|
|
25
|
+
* startupExport entry point.
|
|
26
|
+
*/
|
|
27
|
+
export declare function LoadBizAppsOrdersServer(): void;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,8BAA8B,CAAC;AACtC,OAAO,6BAA6B,CAAC;AAYrC,OAAO,0CAA0C,CAAC;AAyClD,OAAO,0BAA0B,CAAC;AAMlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAOvE;;;;GAIG;AACH,eAAO,MAAM,cAAc,UAG1B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CA0D9C"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BizApps Orders Server Bootstrap
|
|
3
|
+
*
|
|
4
|
+
* Server-side bootstrap package for the BizApps Orders Open App. Ensures the
|
|
5
|
+
* entity subclasses, action subclasses, and GraphQL resolvers are registered
|
|
6
|
+
* with the MJ class factory.
|
|
7
|
+
*/
|
|
8
|
+
// Import entity and action packages to trigger @RegisterClass decorators
|
|
9
|
+
import '@mj-biz-apps/orders-entities';
|
|
10
|
+
import '@mj-biz-apps/orders-actions';
|
|
11
|
+
// Hand-authored, SERVER-ONLY actions. These live here rather than in @mj-biz-apps/orders-actions
|
|
12
|
+
// because they import @mj-biz-apps/orders-core-entities-server — and orders-actions is a `shared`
|
|
13
|
+
// package that also ships to MJExplorer, where a server dependency drags Node's `stream` into the
|
|
14
|
+
// browser bundle and breaks the build. See packages/Actions/src/index.ts.
|
|
15
|
+
import { LoadGenerateInvoiceAction } from './custom/generate-invoice.action.js';
|
|
16
|
+
import { LoadOpenPaymentIntentAction } from './custom/open-payment-intent.action.js';
|
|
17
|
+
import { LoadSendDocumentAction } from './custom/send-document.action.js';
|
|
18
|
+
// Server-side entity subclasses — MUST come after orders-entities so @RegisterClass
|
|
19
|
+
// auto-increment gives these higher priority than the generated classes.
|
|
20
|
+
import '@mj-biz-apps/orders-core-entities-server';
|
|
21
|
+
import { LoadCancelSubscriptionOperation, LoadEnvironmentSecretResolver, LoadManualPaymentProvider, LoadOrderEntityServer, LoadOrderLineEntityServer, LoadPaymentHeaderEntityServer, LoadPaymentLineEntityServer, LoadRefundPaymentOperation, LoadApplyAccountCreditOperation, LoadPreviewPriceOperation, LoadPriceOrderOperation, LoadGetOverdueWorklistOperation, LoadGetFulfillmentQueueOperation, LoadFulfillOrderLinesOperation, LoadCapturePaymentOperation, LoadAdvanceOrderStateOperation, LoadDefaultPriceResolver, LoadPromotionEngine, LoadTaxResolver, LoadRevenueRecognitionDrivers, LoadSpawnRenewalsOperation, LoadEmailDeliveryChannel, LoadStoredValuePaymentProvider, LoadStripeACHPaymentProvider, LoadStripePaymentProvider, LoadSubscriptionBehavior, LoadEntitlementGrantClaimDriver, LoadGuestOrderClaimDriver, LoadCheckEntitlementOperation, LoadListEntitlementsOperation, } from '@mj-biz-apps/orders-core-entities-server';
|
|
22
|
+
// The unauthenticated webhook route. Registered as a server EXTENSION rather than mounted here,
|
|
23
|
+
// because it must be installed before MJServer's auth middleware — see the file for why.
|
|
24
|
+
import { LoadPaymentWebhookExtension } from './PaymentWebhookExtension.js';
|
|
25
|
+
// The anonymous checkout edge — same pre-auth extension mechanism as the webhook.
|
|
26
|
+
import { LoadCheckoutServerExtension } from './CheckoutServerExtension.js';
|
|
27
|
+
// Import generated GraphQL resolvers
|
|
28
|
+
import './generated/generated.js';
|
|
29
|
+
// Re-export the manifest for consumers
|
|
30
|
+
export { CLASS_REGISTRATIONS } from './generated/class-registrations-manifest.js';
|
|
31
|
+
export { PaymentWebhookExtension, LoadPaymentWebhookExtension } from './PaymentWebhookExtension.js';
|
|
32
|
+
export { CheckoutServerExtension, LoadCheckoutServerExtension } from './CheckoutServerExtension.js';
|
|
33
|
+
export { MJ_SERVER_EXTENSIONS } from './server-extensions-manifest.js';
|
|
34
|
+
import { fileURLToPath } from 'node:url';
|
|
35
|
+
import { resolve } from 'node:path';
|
|
36
|
+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
37
|
+
/**
|
|
38
|
+
* Absolute paths to the resolver files (generated + custom), for use with createMJServer().
|
|
39
|
+
* NOTE the `*Resolver.{js,ts}` suffix for custom resolvers (not `*.{js,ts}`): brace-expansion
|
|
40
|
+
* of `*.{js,ts}` would also match emitted `*.d.ts` files, which ts-node then fails to require.
|
|
41
|
+
*/
|
|
42
|
+
export const RESOLVER_PATHS = [
|
|
43
|
+
resolve(__dirname, 'generated/generated.{js,ts}'),
|
|
44
|
+
resolve(__dirname, 'resolvers/*Resolver.{js,ts}'),
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* Bootstrap function called by DynamicPackageLoader during MJAPI startup.
|
|
48
|
+
* The static imports above handle all registration; this function is the
|
|
49
|
+
* startupExport entry point.
|
|
50
|
+
*/
|
|
51
|
+
export function LoadBizAppsOrdersServer() {
|
|
52
|
+
// Static imports above ensure all classes are registered; these anchor the server-only
|
|
53
|
+
// subclasses against tree-shaking (booking lives in OrderEntityServer.Save).
|
|
54
|
+
LoadOrderEntityServer();
|
|
55
|
+
LoadOrderLineEntityServer();
|
|
56
|
+
LoadPaymentHeaderEntityServer(); // books the cash leg on capture/refund (D18)
|
|
57
|
+
LoadPaymentLineEntityServer(); // the over-application guard
|
|
58
|
+
LoadRefundPaymentOperation(); // the 'Orders.RefundPayment' remote operation (D17)
|
|
59
|
+
LoadApplyAccountCreditOperation(); // the 'Orders.ApplyAccountCredit' remote operation (D68)
|
|
60
|
+
LoadPreviewPriceOperation(); // the 'Orders.PreviewPrice' dry run (D69)
|
|
61
|
+
LoadPriceOrderOperation(); // 'Orders.PriceOrder' — what a whole order comes to, persisting nothing
|
|
62
|
+
LoadGetOverdueWorklistOperation(); // 'Orders.GetOverdueWorklist' — overdue is computed, not stored
|
|
63
|
+
LoadGetFulfillmentQueueOperation(); // 'Orders.GetFulfillmentQueue' — so is the shipping backlog
|
|
64
|
+
LoadFulfillOrderLinesOperation(); // 'Orders.FulfillOrderLines' — flip lines AND close the order, one act
|
|
65
|
+
LoadCapturePaymentOperation(); // 'Orders.CapturePayment' — header + allocations in ONE transaction
|
|
66
|
+
LoadAdvanceOrderStateOperation(); // 'Orders.AdvanceOrderState' — climbs the ladder above Confirmed (D17)
|
|
67
|
+
LoadDefaultPriceResolver(); // the data-driven price resolver the walk falls back to (D69)
|
|
68
|
+
LoadPromotionEngine(); // the promotion qualifier plugin seam (D70)
|
|
69
|
+
LoadTaxResolver(); // the address -> jurisdiction seam (D72)
|
|
70
|
+
LoadRevenueRecognitionDrivers(); // the three shipped rev-rec drivers (D43)
|
|
71
|
+
LoadSubscriptionBehavior(); // the base subscription rules engine (D45)
|
|
72
|
+
LoadCancelSubscriptionOperation(); // the 'Orders.CancelSubscription' remote operation
|
|
73
|
+
LoadSpawnRenewalsOperation(); // the 'Orders.SpawnRenewals' remote operation (D55)
|
|
74
|
+
LoadCheckEntitlementOperation(); // 'Orders.CheckEntitlement' — LXP ask/answer (read contract)
|
|
75
|
+
LoadListEntitlementsOperation(); // 'Orders.ListEntitlements' — the person's library, same evaluator
|
|
76
|
+
// Payment drivers (D19/D37). Each is keyed by its PaymentProviderType.Code, and WITHOUT these
|
|
77
|
+
// anchors the @RegisterClass decorators are tree-shaken away — the ClassFactory then falls back to
|
|
78
|
+
// the base driver, which declines every operation. `PaymentProviderResolver` refuses that fallback
|
|
79
|
+
// explicitly rather than letting "nobody registered a driver" read as "the gateway said no".
|
|
80
|
+
LoadStripePaymentProvider(); // cards; stub when the provider row is not live
|
|
81
|
+
LoadStripeACHPaymentProvider(); // US bank debits — settles LATE, so the webhook books the cash
|
|
82
|
+
LoadManualPaymentProvider(); // cheque, wire, cash — no gateway to call
|
|
83
|
+
LoadStoredValuePaymentProvider(); // gift cards and account credit, one driver (D38/D68)
|
|
84
|
+
LoadEnvironmentSecretResolver(); // the default CredentialsRef -> env lookup; replaceable
|
|
85
|
+
// Actions. Same tree-shaking hazard as the operations above: without the anchor the action row
|
|
86
|
+
// exists in metadata and `ActionEngine` finds nothing registered under its DriverClass.
|
|
87
|
+
LoadGenerateInvoiceAction(); // 'Orders.GenerateInvoice' — an order, rendered (D-INV)
|
|
88
|
+
LoadSendDocumentAction(); // 'Orders.SendDocument' — an order, rendered AND sent (§4.4)
|
|
89
|
+
LoadOpenPaymentIntentAction(); // 'Orders.OpenPaymentIntent' — the FIRST half of a gateway capture (D80)
|
|
90
|
+
// Delivery channels (§4.4). Same tree-shaking hazard as the payment drivers, and the same
|
|
91
|
+
// deliberately unhelpful failure without the anchor: `DeliveryResolver` refuses the base-class
|
|
92
|
+
// fallback rather than letting "nobody registered a channel" read as "the channel refused to send".
|
|
93
|
+
LoadEmailDeliveryChannel(); // 'Email' — over MJ's communication framework
|
|
94
|
+
// Identity-claim drivers (guest checkout → account linking). Without these anchors the
|
|
95
|
+
// @RegisterClass decorators are tree-shaken and MJ core's IdentityClaimEngine finds no
|
|
96
|
+
// driver for the DriverClass named in the claim-type metadata — silently.
|
|
97
|
+
LoadGuestOrderClaimDriver(); // 'GuestOrderClaimDriver' — re-parents the order + activates grants on redemption
|
|
98
|
+
LoadEntitlementGrantClaimDriver(); // 'EntitlementGrantClaimDriver' — activates a single grant on redemption
|
|
99
|
+
// Server extensions. Same tree-shaking hazard again: without the anchor the class is absent from
|
|
100
|
+
// the ClassFactory and MJServer's extension loader silently finds nothing for the DriverClass named
|
|
101
|
+
// in mj.config.cjs — so the webhook route is never mounted and no bank debit ever captures.
|
|
102
|
+
LoadPaymentWebhookExtension(); // POST /webhooks/payments/:providerId, mounted before auth
|
|
103
|
+
LoadCheckoutServerExtension(); // GET /checkout/:slug + POST /checkout/{initialize,draft,payment-intent,complete}, mounted before auth
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,yEAAyE;AACzE,OAAO,8BAA8B,CAAC;AACtC,OAAO,6BAA6B,CAAC;AAErC,iGAAiG;AACjG,kGAAkG;AAClG,kGAAkG;AAClG,0EAA0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AG,mEAAmE;IAEtG,8FAA8F;IAC9F,mGAAmG;IACnG,mGAAmG;IACnG,6FAA6F;IAC7F,yBAAyB,EAAE,CAAC,CAAO,gDAAgD;IACnF,4BAA4B,EAAE,CAAC,CAAI,+DAA+D;IAClG,yBAAyB,EAAE,CAAC,CAAO,0CAA0C;IAC7E,8BAA8B,EAAE,CAAC,CAAE,sDAAsD;IACzF,6BAA6B,EAAE,CAAC,CAAG,wDAAwD;IAE3F,+FAA+F;IAC/F,wFAAwF;IACxF,yBAAyB,EAAE,CAAC,CAAO,wDAAwD;IAC3F,sBAAsB,EAAE,CAAC,CAAU,6DAA6D;IAChG,2BAA2B,EAAE,CAAC,CAAK,yEAAyE;IAE5G,0FAA0F;IAC1F,+FAA+F;IAC/F,oGAAoG;IACpG,wBAAwB,EAAE,CAAC,CAAQ,8CAA8C;IAEjF,uFAAuF;IACvF,uFAAuF;IACvF,0EAA0E;IAC1E,yBAAyB,EAAE,CAAC,CAAO,kFAAkF;IACrH,+BAA+B,EAAE,CAAC,CAAC,yEAAyE;IAE5G,iGAAiG;IACjG,oGAAoG;IACpG,4FAA4F;IAC5F,2BAA2B,EAAE,CAAC,CAAK,2DAA2D;IAC9F,2BAA2B,EAAE,CAAC,CAAK,uGAAuG;AAC9I,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-extension declarations for `@mj-biz-apps/orders-server`.
|
|
3
|
+
*
|
|
4
|
+
* MJ bootstrap (`createMJServer`) collects this list from installed Open App
|
|
5
|
+
* packages listed in the host `mj.config.cjs` `dynamicPackages.server[]` — either
|
|
6
|
+
* from this named export or from `package.json` `memberjunction.serverExtensions`.
|
|
7
|
+
* Host `serverExtensions[]` overlays by DriverClass (Settings, RootPath, Enabled).
|
|
8
|
+
*
|
|
9
|
+
* Keep this array in sync with `package.json` → `memberjunction.serverExtensions`
|
|
10
|
+
* and with this repo's own `mj.config.cjs` `serverExtensions` defaults.
|
|
11
|
+
*/
|
|
12
|
+
import type { ServerExtensionConfig } from '@memberjunction/server-extensions-core';
|
|
13
|
+
export declare const MJ_SERVER_EXTENSIONS: ServerExtensionConfig[];
|
|
14
|
+
//# sourceMappingURL=server-extensions-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-extensions-manifest.d.ts","sourceRoot":"","sources":["../src/server-extensions-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAEpF,eAAO,MAAM,oBAAoB,EAAE,qBAAqB,EAavD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const MJ_SERVER_EXTENSIONS = [
|
|
2
|
+
{
|
|
3
|
+
Enabled: true,
|
|
4
|
+
DriverClass: 'OrdersPaymentWebhook',
|
|
5
|
+
RootPath: '/webhooks/payments',
|
|
6
|
+
Settings: {},
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
Enabled: true,
|
|
10
|
+
DriverClass: 'OrdersCheckoutEdge',
|
|
11
|
+
RootPath: '/checkout',
|
|
12
|
+
Settings: {},
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
//# sourceMappingURL=server-extensions-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-extensions-manifest.js","sourceRoot":"","sources":["../src/server-extensions-manifest.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,oBAAoB,GAA4B;IACzD;QACI,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,sBAAsB;QACnC,QAAQ,EAAE,oBAAoB;QAC9B,QAAQ,EAAE,EAAE;KACf;IACD;QACI,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,oBAAoB;QACjC,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,EAAE;KACf;CACJ,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning an order into rendered documents — the orchestration, extracted so two actions can share it.
|
|
3
|
+
*
|
|
4
|
+
* WHY IT MOVED OUT OF THE ACTION. `Orders.GenerateInvoice` owned this sequence, which was correct while
|
|
5
|
+
* it was the only caller. `Orders.SendDocument` needs the identical sequence — read the order, build
|
|
6
|
+
* one document per selling company, decorate it for a locale, render it through a database template —
|
|
7
|
+
* and an action calling another action is the pattern MJ's own guidance rules out: it produces a stack
|
|
8
|
+
* trace that goes through the metadata dispatcher instead of the code, and a rename that the compiler
|
|
9
|
+
* cannot follow. So the sequence became a service and both actions are thin wrappers over it, which is
|
|
10
|
+
* what the guidance asks for.
|
|
11
|
+
*
|
|
12
|
+
* IT RETURNS A RESULT, NEVER THROWS FOR A REFUSAL. A voided order, a missing template and an unknown
|
|
13
|
+
* order id are all ANSWERS — the caller has to branch on them and turn them into an action result code
|
|
14
|
+
* — while a provider that is not configured is a fault. Keeping that line in the same place the
|
|
15
|
+
* payment drivers keep it means a caller can trust it everywhere.
|
|
16
|
+
*
|
|
17
|
+
* THE TEMPLATE IS RESOLVED ONCE PER CALL, not once per document. A two-company order should not
|
|
18
|
+
* resolve the same template twice, and a month-end run producing four hundred invoices should not
|
|
19
|
+
* resolve it four hundred times.
|
|
20
|
+
*
|
|
21
|
+
* CONNECTS TO:
|
|
22
|
+
* READER: @mj-biz-apps/orders-core-entities-server → BuildInvoiceDocuments, DecorateInvoice
|
|
23
|
+
* ACTIONS: ../custom/generate-invoice.action.ts · ../custom/send-document.action.ts
|
|
24
|
+
*/
|
|
25
|
+
import type { IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
26
|
+
import { type DisplayInvoice } from '@mj-biz-apps/orders-core-entities-server';
|
|
27
|
+
/** The template rendered when a caller does not name one. */
|
|
28
|
+
export declare const DEFAULT_INVOICE_TEMPLATE = "Orders: Standard Invoice";
|
|
29
|
+
/** One rendered document. */
|
|
30
|
+
export interface RenderedInvoice {
|
|
31
|
+
DocumentNumber: string;
|
|
32
|
+
Kind: string;
|
|
33
|
+
CompanyID: string;
|
|
34
|
+
CompanyName: string;
|
|
35
|
+
Gross: number;
|
|
36
|
+
AmountDue: number;
|
|
37
|
+
/** Null when `Format` asked for data only. */
|
|
38
|
+
HTML: string | null;
|
|
39
|
+
/** The full decorated document, so a caller can reconcile without parsing markup. */
|
|
40
|
+
Data: DisplayInvoice;
|
|
41
|
+
/** Anything the builder had to decide rather than read. Empty is the expected state. */
|
|
42
|
+
Notes: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface RenderInvoiceOptions {
|
|
45
|
+
/** Render only this selling company's document. Omit for every document the order produces. */
|
|
46
|
+
CompanyID?: string | null;
|
|
47
|
+
AsOfDate?: string | null;
|
|
48
|
+
TemplateName?: string | null;
|
|
49
|
+
Locale?: string | null;
|
|
50
|
+
/** Overrides the selling company's functional currency. Only for a caller who genuinely knows better. */
|
|
51
|
+
CurrencyCode?: string | null;
|
|
52
|
+
/** `HTML` for rendered markup, `DATA` for the figures alone. */
|
|
53
|
+
Format?: 'HTML' | 'DATA';
|
|
54
|
+
ShowDiagnostics?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** A refusal carries a code so the caller can map it to an action result without parsing prose. */
|
|
57
|
+
export type RenderFailureCode = 'ORDER_NOT_FOUND' | 'NOT_INVOICEABLE' | 'TEMPLATE_NOT_FOUND' | 'RENDER_FAILED';
|
|
58
|
+
/**
|
|
59
|
+
* A flat result rather than a discriminated union, matching `RefundPaymentOutput` and the driver
|
|
60
|
+
* results throughout this app. The repo's tsconfig does not enable `strict`, so a boolean-literal
|
|
61
|
+
* discriminant does not narrow — a union here would compile as a type that no caller can read.
|
|
62
|
+
*/
|
|
63
|
+
export interface RenderInvoiceResult {
|
|
64
|
+
Success: boolean;
|
|
65
|
+
/** Empty on refusal. */
|
|
66
|
+
Documents: RenderedInvoice[];
|
|
67
|
+
/** Set when `Success` is false. */
|
|
68
|
+
Code?: RenderFailureCode;
|
|
69
|
+
/** Set when `Success` is false — written for the person who has to fix it. */
|
|
70
|
+
Message?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Build and render every document an order produces.
|
|
74
|
+
*
|
|
75
|
+
* An order sold by more than one company produces one document PER COMPANY — they are different
|
|
76
|
+
* receivables owed to different legal entities — so this always returns an array and the caller must
|
|
77
|
+
* not treat the first element as the whole bill.
|
|
78
|
+
*/
|
|
79
|
+
export declare function RenderInvoiceDocuments(orderID: string, provider: IMetadataProvider, user: UserInfo, options?: RenderInvoiceOptions): Promise<RenderInvoiceResult>;
|
|
80
|
+
//# sourceMappingURL=invoice-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice-renderer.d.ts","sourceRoot":"","sources":["../../src/services/invoice-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAGvH,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAEnE,6BAA6B;AAC7B,MAAM,WAAW,eAAe;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,qFAAqF;IACrF,IAAI,EAAE,cAAc,CAAC;IACrB,wFAAwF;IACxF,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACjC,+FAA+F;IAC/F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,yGAAyG;IACzG,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,mGAAmG;AACnG,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAE/G;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,wBAAwB;IACxB,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,mCAAmC;IACnC,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CACxC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,oBAAyB,GACnC,OAAO,CAAC,mBAAmB,CAAC,CAmE9B"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { BuildInvoiceDocuments, DecorateInvoice } from '@mj-biz-apps/orders-core-entities-server';
|
|
2
|
+
import { TemplateEngineServer } from '@memberjunction/templates';
|
|
3
|
+
/** The template rendered when a caller does not name one. */
|
|
4
|
+
export const DEFAULT_INVOICE_TEMPLATE = 'Orders: Standard Invoice';
|
|
5
|
+
/**
|
|
6
|
+
* Build and render every document an order produces.
|
|
7
|
+
*
|
|
8
|
+
* An order sold by more than one company produces one document PER COMPANY — they are different
|
|
9
|
+
* receivables owed to different legal entities — so this always returns an array and the caller must
|
|
10
|
+
* not treat the first element as the whole bill.
|
|
11
|
+
*/
|
|
12
|
+
export async function RenderInvoiceDocuments(orderID, provider, user, options = {}) {
|
|
13
|
+
const asOf = options.AsOfDate ?? null;
|
|
14
|
+
const built = await BuildInvoiceDocuments(orderID, provider, user, {
|
|
15
|
+
AsOf: asOf,
|
|
16
|
+
OnlyCompanyID: options.CompanyID ?? null,
|
|
17
|
+
});
|
|
18
|
+
if (!built.Success) {
|
|
19
|
+
// A refusal is reported as a refusal, not as an empty success. Zero documents with Success=true
|
|
20
|
+
// reads to a workflow as "this order needed no invoice".
|
|
21
|
+
return {
|
|
22
|
+
Success: false,
|
|
23
|
+
Documents: [],
|
|
24
|
+
Code: built.Message?.includes('voided') ? 'NOT_INVOICEABLE' : 'ORDER_NOT_FOUND',
|
|
25
|
+
Message: built.Message ?? `Order '${orderID}' produced no documents.`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const format = options.Format ?? 'HTML';
|
|
29
|
+
const locale = options.Locale ?? 'en-US';
|
|
30
|
+
const generatedOn = asOf ?? new Date().toISOString().slice(0, 10);
|
|
31
|
+
const templateName = options.TemplateName ?? DEFAULT_INVOICE_TEMPLATE;
|
|
32
|
+
let render = null;
|
|
33
|
+
if (format === 'HTML') {
|
|
34
|
+
const prepared = await prepareTemplate(templateName, user, provider, options.ShowDiagnostics === true);
|
|
35
|
+
if ('error' in prepared) {
|
|
36
|
+
return { Success: false, Documents: [], Code: 'TEMPLATE_NOT_FOUND', Message: prepared.error };
|
|
37
|
+
}
|
|
38
|
+
render = prepared.render;
|
|
39
|
+
}
|
|
40
|
+
const documents = [];
|
|
41
|
+
for (const doc of built.Documents) {
|
|
42
|
+
// Currency comes from the SELLING COMPANY's accounting profile, because it is a property of the
|
|
43
|
+
// seller and not of the sale.
|
|
44
|
+
const currency = options.CurrencyCode ?? doc.Issuer.CurrencyCode ?? 'USD';
|
|
45
|
+
const decorated = DecorateInvoice(doc, { Locale: locale, Currency: currency, GeneratedOn: generatedOn });
|
|
46
|
+
let html = null;
|
|
47
|
+
if (render) {
|
|
48
|
+
const rendered = await render(decorated);
|
|
49
|
+
if (rendered.error) {
|
|
50
|
+
return {
|
|
51
|
+
Success: false,
|
|
52
|
+
Documents: [],
|
|
53
|
+
Code: 'RENDER_FAILED',
|
|
54
|
+
Message: `Could not render ${doc.DocumentNumber}: ${rendered.error}`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
html = rendered.html;
|
|
58
|
+
}
|
|
59
|
+
documents.push({
|
|
60
|
+
DocumentNumber: doc.DocumentNumber,
|
|
61
|
+
Kind: doc.Kind,
|
|
62
|
+
CompanyID: doc.CompanyID,
|
|
63
|
+
CompanyName: doc.CompanyName,
|
|
64
|
+
Gross: doc.Gross,
|
|
65
|
+
AmountDue: doc.AmountDue,
|
|
66
|
+
HTML: html,
|
|
67
|
+
Data: decorated,
|
|
68
|
+
Notes: doc.Notes,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return { Success: true, Documents: documents };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Find the template and its content, and return a render function bound to them.
|
|
75
|
+
*/
|
|
76
|
+
async function prepareTemplate(templateName, user, provider, showDiagnostics) {
|
|
77
|
+
const engine = TemplateEngineServer.Instance;
|
|
78
|
+
await engine.Config(false, user, provider);
|
|
79
|
+
const template = engine.FindTemplate(templateName);
|
|
80
|
+
if (!template) {
|
|
81
|
+
return {
|
|
82
|
+
error: `No template named '${templateName}'. The standard one is '${DEFAULT_INVOICE_TEMPLATE}'; if it is missing, the app's metadata has not been pushed.`,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// Ask for HTML first, then whatever the template does have. A deployment that overrode this
|
|
86
|
+
// template with a text version should still render rather than refuse.
|
|
87
|
+
const content = template.GetHighestPriorityContent('HTML') ?? template.GetHighestPriorityContent();
|
|
88
|
+
if (!content) {
|
|
89
|
+
return { error: `Template '${templateName}' has no content rows — there is nothing to render.` };
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
render: async (doc) => {
|
|
93
|
+
// Validation is skipped rather than declaring one template param per field: the context is
|
|
94
|
+
// a single nested document, and a param list mirroring it would be a second schema to keep
|
|
95
|
+
// in step with the first.
|
|
96
|
+
const result = await engine.RenderTemplate(template, content, { doc, options: { ShowDiagnostics: showDiagnostics } }, true, true);
|
|
97
|
+
if (!result.Success)
|
|
98
|
+
return { html: null, error: result.Message ?? 'unknown template error' };
|
|
99
|
+
return { html: result.Output ?? '' };
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=invoice-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice-renderer.js","sourceRoot":"","sources":["../../src/services/invoice-renderer.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAuB,MAAM,0CAA0C,CAAC;AACvH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,6DAA6D;AAC7D,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAiDnE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CACxC,OAAe,EACf,QAA2B,EAC3B,IAAc,EACd,UAAgC,EAAE;IAElC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC;IACtC,MAAM,KAAK,GAAG,MAAM,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/D,IAAI,EAAE,IAAI;QACV,aAAa,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;KAC3C,CAAC,CAAC;IAEH,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACjB,gGAAgG;QAChG,yDAAyD;QACzD,OAAO;YACH,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE;YACb,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CA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AC7J,CAAC;IACN,CAAC;IAED,4FAA4F;IAC5F,uEAAuE;IACvE,MAAM,OAAO,GAAG,QAAQ,CAAC,yBAAyB,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,yBAAyB,EAAE,CAAC;IACnG,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,EAAE,KAAK,EAAE,aAAa,YAAY,qDAAqD,EAAE,CAAC;IACrG,CAAC;IAED,OAAO;QACH,MAAM,EAAE,KAAK,EAAE,GAAmB,EAAE,EAAE;YAClC,2FAA2F;YAC3F,2FAA2F;YAC3F,0BAA0B;YAC1B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CACtC,QAAQ,EACR,OAAO,EACP,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,eAAe,EAAE,eAAe,EAAE,EAAE,EACtD,IAAI,EACJ,IAAI,CACP,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,OAAO;gBAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,IAAI,wBAAwB,EAAE,CAAC;YAC9F,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QACzC,CAAC;KACJ,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mj-biz-apps/orders-server",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "5.2.0",
|
|
5
|
+
"description": "BizApps Orders server bootstrap - GraphQL resolvers and class registrations for the unified order-management Open App",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"/dist"
|
|
13
|
+
],
|
|
14
|
+
"memberjunction": {
|
|
15
|
+
"serverExtensions": [
|
|
16
|
+
{
|
|
17
|
+
"Enabled": true,
|
|
18
|
+
"DriverClass": "OrdersPaymentWebhook",
|
|
19
|
+
"RootPath": "/webhooks/payments",
|
|
20
|
+
"Settings": {}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"Enabled": true,
|
|
24
|
+
"DriverClass": "OrdersCheckoutEdge",
|
|
25
|
+
"RootPath": "/checkout",
|
|
26
|
+
"Settings": {}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"author": "MemberJunction.com",
|
|
5
31
|
"license": "BUSL-1.1",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@mj-biz-apps/accounting-engine-base": ">=0.1.0",
|
|
34
|
+
"@mj-biz-apps/accounting-entities": ">=0.1.0",
|
|
35
|
+
"@mj-biz-apps/accounting-server": ">=0.1.0",
|
|
36
|
+
"@types/express": "^5.0.6",
|
|
37
|
+
"typescript": "^5.9.3"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@mj-biz-apps/orders-actions": "5.2.0",
|
|
41
|
+
"@mj-biz-apps/orders-core-entities-server": "5.2.0",
|
|
42
|
+
"@mj-biz-apps/orders-entities": "5.2.0",
|
|
43
|
+
"body-parser": "^2.2.0",
|
|
44
|
+
"class-validator": "^0.14.3"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@memberjunction/actions": "^6.1.0-edge.4",
|
|
48
|
+
"@memberjunction/actions-base": "^6.1.0-edge.4",
|
|
49
|
+
"@memberjunction/core": "^6.1.0-edge.4",
|
|
50
|
+
"@memberjunction/global": "^6.1.0-edge.4",
|
|
51
|
+
"@memberjunction/server": "^6.1.0-edge.4",
|
|
52
|
+
"@memberjunction/server-extensions-core": "^6.1.0-edge.4",
|
|
53
|
+
"@memberjunction/generic-database-provider": "^6.1.0-edge.4",
|
|
54
|
+
"@memberjunction/templates": "^6.1.0-edge.4",
|
|
55
|
+
"@mj-biz-apps/accounting-engine-base": ">=0.1.0",
|
|
56
|
+
"@mj-biz-apps/accounting-entities": ">=0.1.0",
|
|
57
|
+
"@mj-biz-apps/accounting-server": ">=0.1.0"
|
|
58
|
+
},
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "https://github.com/MemberJunction/bizapps-orders"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsc && tsc-alias -f",
|
|
65
|
+
"test": "vitest run",
|
|
66
|
+
"test:watch": "vitest"
|
|
67
|
+
}
|
|
68
|
+
}
|