@endora-commerce/mod-quick-order 0.100.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 +21 -0
- package/README.md +58 -0
- package/dist/admin/api/quick-order-client.d.ts +76 -0
- package/dist/admin/api/quick-order-client.d.ts.map +1 -0
- package/dist/admin/api/quick-order-client.js +18 -0
- package/dist/admin/api/quick-order-client.js.map +1 -0
- package/dist/admin/components/DefaultPreferencesPanel.d.ts +44 -0
- package/dist/admin/components/DefaultPreferencesPanel.d.ts.map +1 -0
- package/dist/admin/components/DefaultPreferencesPanel.js +107 -0
- package/dist/admin/components/DefaultPreferencesPanel.js.map +1 -0
- package/dist/admin/index.d.ts +48 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +120 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/pages/QuickOrderOnBehalfPage.d.ts +16 -0
- package/dist/admin/pages/QuickOrderOnBehalfPage.d.ts.map +1 -0
- package/dist/admin/pages/QuickOrderOnBehalfPage.js +85 -0
- package/dist/admin/pages/QuickOrderOnBehalfPage.js.map +1 -0
- package/dist/admin/zones/CustomerDefaults.d.ts +27 -0
- package/dist/admin/zones/CustomerDefaults.d.ts.map +1 -0
- package/dist/admin/zones/CustomerDefaults.js +11 -0
- package/dist/admin/zones/CustomerDefaults.js.map +1 -0
- package/dist/admin/zones/OrderEntryQuickTab.d.ts +21 -0
- package/dist/admin/zones/OrderEntryQuickTab.d.ts.map +1 -0
- package/dist/admin/zones/OrderEntryQuickTab.js +26 -0
- package/dist/admin/zones/OrderEntryQuickTab.js.map +1 -0
- package/dist/admin/zones/OrganizationDefaults.d.ts +30 -0
- package/dist/admin/zones/OrganizationDefaults.d.ts.map +1 -0
- package/dist/admin/zones/OrganizationDefaults.js +11 -0
- package/dist/admin/zones/OrganizationDefaults.js.map +1 -0
- package/dist/backend/entities/quick-order-default-preference.entity.d.ts +22 -0
- package/dist/backend/entities/quick-order-default-preference.entity.d.ts.map +1 -0
- package/dist/backend/entities/quick-order-default-preference.entity.js +76 -0
- package/dist/backend/entities/quick-order-default-preference.entity.js.map +1 -0
- package/dist/backend/index.d.ts +88 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +235 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/routes.admin.d.ts +35 -0
- package/dist/backend/routes.admin.d.ts.map +1 -0
- package/dist/backend/routes.admin.js +64 -0
- package/dist/backend/routes.admin.js.map +1 -0
- package/dist/backend/routes.d.ts +35 -0
- package/dist/backend/routes.d.ts.map +1 -0
- package/dist/backend/routes.js +77 -0
- package/dist/backend/routes.js.map +1 -0
- package/dist/backend/routes.one-click.d.ts +22 -0
- package/dist/backend/routes.one-click.d.ts.map +1 -0
- package/dist/backend/routes.one-click.js +35 -0
- package/dist/backend/routes.one-click.js.map +1 -0
- package/dist/backend/routes.preferences.admin.d.ts +23 -0
- package/dist/backend/routes.preferences.admin.d.ts.map +1 -0
- package/dist/backend/routes.preferences.admin.js +40 -0
- package/dist/backend/routes.preferences.admin.js.map +1 -0
- package/dist/backend/routes.preferences.d.ts +21 -0
- package/dist/backend/routes.preferences.d.ts.map +1 -0
- package/dist/backend/routes.preferences.js +42 -0
- package/dist/backend/routes.preferences.js.map +1 -0
- package/dist/backend/services/catalog-lookup.d.ts +39 -0
- package/dist/backend/services/catalog-lookup.d.ts.map +1 -0
- package/dist/backend/services/catalog-lookup.js +104 -0
- package/dist/backend/services/catalog-lookup.js.map +1 -0
- package/dist/backend/services/default-preference-authz.d.ts +31 -0
- package/dist/backend/services/default-preference-authz.d.ts.map +1 -0
- package/dist/backend/services/default-preference-authz.js +26 -0
- package/dist/backend/services/default-preference-authz.js.map +1 -0
- package/dist/backend/services/default-preference-resolver.d.ts +28 -0
- package/dist/backend/services/default-preference-resolver.d.ts.map +1 -0
- package/dist/backend/services/default-preference-resolver.js +27 -0
- package/dist/backend/services/default-preference-resolver.js.map +1 -0
- package/dist/backend/services/default-preference-service.d.ts +63 -0
- package/dist/backend/services/default-preference-service.d.ts.map +1 -0
- package/dist/backend/services/default-preference-service.js +176 -0
- package/dist/backend/services/default-preference-service.js.map +1 -0
- package/dist/backend/services/excel-importer.d.ts +11 -0
- package/dist/backend/services/excel-importer.d.ts.map +1 -0
- package/dist/backend/services/excel-importer.js +47 -0
- package/dist/backend/services/excel-importer.js.map +1 -0
- package/dist/backend/services/import-from-request.d.ts +9 -0
- package/dist/backend/services/import-from-request.d.ts.map +1 -0
- package/dist/backend/services/import-from-request.js +17 -0
- package/dist/backend/services/import-from-request.js.map +1 -0
- package/dist/backend/services/import-pipeline.d.ts +89 -0
- package/dist/backend/services/import-pipeline.d.ts.map +1 -0
- package/dist/backend/services/import-pipeline.js +188 -0
- package/dist/backend/services/import-pipeline.js.map +1 -0
- package/dist/backend/services/import-rows.d.ts +43 -0
- package/dist/backend/services/import-rows.d.ts.map +1 -0
- package/dist/backend/services/import-rows.js +102 -0
- package/dist/backend/services/import-rows.js.map +1 -0
- package/dist/backend/services/one-click-service.d.ts +50 -0
- package/dist/backend/services/one-click-service.d.ts.map +1 -0
- package/dist/backend/services/one-click-service.js +83 -0
- package/dist/backend/services/one-click-service.js.map +1 -0
- package/dist/backend/services/quick-order-build-service.d.ts +35 -0
- package/dist/backend/services/quick-order-build-service.d.ts.map +1 -0
- package/dist/backend/services/quick-order-build-service.js +61 -0
- package/dist/backend/services/quick-order-build-service.js.map +1 -0
- package/dist/backend/services/variant-resolver.d.ts +40 -0
- package/dist/backend/services/variant-resolver.d.ts.map +1 -0
- package/dist/backend/services/variant-resolver.js +47 -0
- package/dist/backend/services/variant-resolver.js.map +1 -0
- package/dist/manifest.d.ts +190 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +129 -0
- package/dist/manifest.js.map +1 -0
- package/dist/migrations/20260611T140359_quick_order_default_preferences.d.ts +15 -0
- package/dist/migrations/20260611T140359_quick_order_default_preferences.d.ts.map +1 -0
- package/dist/migrations/20260611T140359_quick_order_default_preferences.js +53 -0
- package/dist/migrations/20260611T140359_quick_order_default_preferences.js.map +1 -0
- package/dist/migrations/index.d.ts +27 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +29 -0
- package/dist/migrations/index.js.map +1 -0
- package/docs/quick_order.md +98 -0
- package/i18n/en.json +47 -0
- package/i18n/pl.json +47 -0
- package/package.json +91 -0
- package/tailwind.css +14 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { ApiError } from '@endora-commerce/admin-kit/lib';
|
|
4
|
+
import { Alert, AlertDescription, Button, Card, CardContent, CardHeader, CardTitle, Label, Textarea, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, PageHeader } from '@endora-commerce/admin-kit/ui';
|
|
5
|
+
import { CustomerPicker, OrganizationPicker, FileDropzone } from '@endora-commerce/admin-kit/components';
|
|
6
|
+
import { RouteTabsZone } from '@endora-commerce/admin-kit/zones';
|
|
7
|
+
import { useTranslation } from '@endora-commerce/admin-kit/i18n';
|
|
8
|
+
import { adminQuickOrderBuild, adminQuickOrderImport, } from '../api/quick-order-client.js';
|
|
9
|
+
/**
|
|
10
|
+
* QuickOrderOnBehalfPage — feature 039 (US1 / FR-008).
|
|
11
|
+
*
|
|
12
|
+
* Lets an operator import a CSV / Excel file (or paste CSV) and build a Cart
|
|
13
|
+
* or Quote Request on behalf of a chosen customer + organization. Identifier
|
|
14
|
+
* fields are entered directly, matching the existing OrderCreatePage approach.
|
|
15
|
+
*/
|
|
16
|
+
export function QuickOrderOnBehalfPage() {
|
|
17
|
+
const t = useTranslation('quick_order');
|
|
18
|
+
const [customerAccountId, setCustomerAccountId] = useState('');
|
|
19
|
+
const [organizationId, setOrganizationId] = useState('');
|
|
20
|
+
const [csv, setCsv] = useState('');
|
|
21
|
+
const [preview, setPreview] = useState(null);
|
|
22
|
+
const [result, setResult] = useState(null);
|
|
23
|
+
const [busy, setBusy] = useState(false);
|
|
24
|
+
const [error, setError] = useState(null);
|
|
25
|
+
async function runImport(input) {
|
|
26
|
+
setBusy(true);
|
|
27
|
+
setError(null);
|
|
28
|
+
setResult(null);
|
|
29
|
+
try {
|
|
30
|
+
setPreview(await adminQuickOrderImport(input));
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
setError(err instanceof ApiError ? err.message : t('onBehalf.error.import'));
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
setBusy(false);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function build(target) {
|
|
40
|
+
if (!preview || preview.recognized.length === 0)
|
|
41
|
+
return;
|
|
42
|
+
if (!customerAccountId.trim() || !organizationId.trim()) {
|
|
43
|
+
setError(t('onBehalf.error.missingCustomer'));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
setBusy(true);
|
|
47
|
+
setError(null);
|
|
48
|
+
try {
|
|
49
|
+
const res = await adminQuickOrderBuild({
|
|
50
|
+
target,
|
|
51
|
+
onBehalfOf: {
|
|
52
|
+
customerAccountId: customerAccountId.trim(),
|
|
53
|
+
organizationId: organizationId.trim(),
|
|
54
|
+
},
|
|
55
|
+
items: preview.recognized.map((r) => ({
|
|
56
|
+
productId: r.productId,
|
|
57
|
+
variantId: r.variantId,
|
|
58
|
+
quantity: r.quantity,
|
|
59
|
+
})),
|
|
60
|
+
});
|
|
61
|
+
setResult(res);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
setError(err instanceof ApiError ? err.message : t('onBehalf.error.build'));
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
setBusy(false);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return (_jsxs("div", { className: "space-y-6", children: [_jsx(PageHeader, { title: t('onBehalf.page.title'), description: t('onBehalf.page.description') }), _jsx(RouteTabsZone, { name: "order.entry.tabs", props: {}, className: "mb-4" }), error ? (_jsx(Alert, { variant: "destructive", children: _jsx(AlertDescription, { children: error }) })) : null, result ? (_jsx(Alert, { children: _jsx(AlertDescription, { children: result.target === 'cart'
|
|
71
|
+
? t('onBehalf.success.cart', { id: result.cartId ?? '' })
|
|
72
|
+
: t('onBehalf.success.quoteRequest', { id: result.quoteRequestId ?? '' }) }) })) : null, _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: t('onBehalf.customer.title') }) }), _jsxs(CardContent, { className: "space-y-3", children: [_jsxs("div", { children: [_jsx(Label, { htmlFor: "customerAccountId", children: t('onBehalf.customer.account') }), _jsx(CustomerPicker, { id: "customerAccountId", value: customerAccountId || null, onChange: (v) => setCustomerAccountId(v ?? ''), placeholder: t('onBehalf.customer.accountPlaceholder'), emptyMessage: t('onBehalf.customer.accountEmpty'), ariaLabel: t('onBehalf.customer.account') })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "organizationId", children: t('onBehalf.customer.organization') }), _jsx(OrganizationPicker, { id: "organizationId", value: organizationId || null, onChange: (v) => setOrganizationId(v ?? ''), placeholder: t('onBehalf.customer.organizationPlaceholder'), emptyMessage: t('onBehalf.customer.organizationEmpty'), ariaLabel: t('onBehalf.customer.organization') })] })] })] }), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: t('onBehalf.import.title') }) }), _jsxs(CardContent, { className: "space-y-3", children: [_jsx(FileDropzone, { label: t('onBehalf.import.dropzone'), selectedLabel: (name) => t('onBehalf.import.selectedFile', { name }), onFile: (filename, contentBase64) => void runImport({ file: { filename, contentBase64 } }) }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "csv", children: t('onBehalf.import.pasteLabel') }), _jsx(Textarea, { id: "csv", rows: 6, value: csv, onChange: (e) => setCsv(e.target.value),
|
|
73
|
+
// Sample data, not prose — intentionally not translated.
|
|
74
|
+
placeholder: 'sku,quantity\nEXAMPLE-SIMPLE-001,10', style: { fontFamily: 'monospace' } })] }), _jsx(Button, { disabled: busy || !csv.trim(), onClick: () => void runImport({ csv }), children: t('onBehalf.import.preview') })] })] }), preview ? (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs(CardTitle, { children: [t('onBehalf.preview.title'), " (", t('onBehalf.preview.summary', {
|
|
75
|
+
recognized: preview.summary.recognizedCount,
|
|
76
|
+
rejected: preview.summary.rejectedCount,
|
|
77
|
+
}), preview.summary.truncated ? `, ${t('onBehalf.preview.truncated')}` : '', ")"] }) }), _jsxs(CardContent, { className: "space-y-4", children: [preview.recognized.length > 0 ? (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: t('onBehalf.column.line') }), _jsx(TableHead, { children: t('onBehalf.column.sku') }), _jsx(TableHead, { children: t('onBehalf.column.variant') }), _jsx(TableHead, { children: t('onBehalf.column.quantity') })] }) }), _jsx(TableBody, { children: preview.recognized.map((r) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: r.line }), _jsx(TableCell, { children: r.sku }), _jsx(TableCell, { children: r.resolvedVariantSku ?? '—' }), _jsx(TableCell, { children: r.quantity })] }, r.line))) })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: t('onBehalf.preview.empty') })), preview.rejected.length > 0 ? (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: t('onBehalf.column.line') }), _jsx(TableHead, { children: t('onBehalf.column.reason') }), _jsx(TableHead, { children: t('onBehalf.column.raw') })] }) }), _jsx(TableBody, { children: preview.rejected.map((r) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: r.line }), _jsx(TableCell, { children: t(`onBehalf.reason.${r.reason}`) }), _jsx(TableCell, { children: _jsx("code", { children: r.raw }) })] }, `r-${r.line}`))) })] })) : null, preview.recognized.length > 0 ? (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { disabled: busy, onClick: () => void build('cart'), children: t('onBehalf.action.buildCart') }), _jsx(Button, { variant: "outline", disabled: busy, onClick: () => void build('quote_request'), children: t('onBehalf.action.buildQuoteRequest') })] })) : null] })] })) : null] }));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The registry loads a route component through a dynamic-import factory and
|
|
81
|
+
* reads its default export (feature 091, FR-013). The named export stays: it is
|
|
82
|
+
* the spelling this module's own code and its tests use.
|
|
83
|
+
*/
|
|
84
|
+
export default QuickOrderOnBehalfPage;
|
|
85
|
+
//# sourceMappingURL=QuickOrderOnBehalfPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuickOrderOnBehalfPage.js","sourceRoot":"","sources":["../../../src/admin/pages/QuickOrderOnBehalfPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AACtN,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GAItB,MAAM,8BAA8B,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,CAAC,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;IACxC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,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
|
|
3
|
+
/**
|
|
4
|
+
* The customer's default ordering preferences (feature 091, P7b).
|
|
5
|
+
*
|
|
6
|
+
* `customers`' `CustomerDetail.tsx` used to import `DefaultPreferencesPanel` by
|
|
7
|
+
* path and pass `scope="customer"` — the single key of
|
|
8
|
+
* `backend/scripts/ledgers/cross-module-imports/customers.ts`, whose shard this
|
|
9
|
+
* contribution deletes. The place is `customer.detail.after` now and the scope
|
|
10
|
+
* is *this module's* constant.
|
|
11
|
+
*
|
|
12
|
+
* The twin of `OrganizationDefaults`, and deliberately a second file rather
|
|
13
|
+
* than a `match` on one shared member — see the note there.
|
|
14
|
+
*
|
|
15
|
+
* **No `match`, and it is a decision rather than an omission.** This place has
|
|
16
|
+
* one host and one mount, so there is nothing to narrow.
|
|
17
|
+
* `admin/test/modules/quick_order/quick-order-zones.test.tsx` asserts it absent
|
|
18
|
+
* so a later author cannot add one quietly.
|
|
19
|
+
*/
|
|
20
|
+
export type CustomerDefaultsProps = AdminZoneProps<'customer.detail.after'>;
|
|
21
|
+
export declare function CustomerDefaults({ customerId }: CustomerDefaultsProps): ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* The zone renderer loads a contribution through a dynamic-import factory and
|
|
24
|
+
* reads its default export (feature 091, FR-013).
|
|
25
|
+
*/
|
|
26
|
+
export default CustomerDefaults;
|
|
27
|
+
//# sourceMappingURL=CustomerDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerDefaults.d.ts","sourceRoot":"","sources":["../../../src/admin/zones/CustomerDefaults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAC;AAE5E,wBAAgB,gBAAgB,CAAC,EAAE,UAAU,EAAE,EAAE,qBAAqB,GAAG,SAAS,CAEjF;AAED;;;GAGG;AACH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DefaultPreferencesPanel } from '../components/DefaultPreferencesPanel.js';
|
|
3
|
+
export function CustomerDefaults({ customerId }) {
|
|
4
|
+
return _jsx(DefaultPreferencesPanel, { scope: "customer", scopeId: customerId });
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The zone renderer loads a contribution through a dynamic-import factory and
|
|
8
|
+
* reads its default export (feature 091, FR-013).
|
|
9
|
+
*/
|
|
10
|
+
export default CustomerDefaults;
|
|
11
|
+
//# sourceMappingURL=CustomerDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerDefaults.js","sourceRoot":"","sources":["../../../src/admin/zones/CustomerDefaults.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAqBnF,MAAM,UAAU,gBAAgB,CAAC,EAAE,UAAU,EAAyB;IACpE,OAAO,KAAC,uBAAuB,IAAC,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,UAAU,GAAI,CAAC;AAC3E,CAAC;AAED;;;GAGG;AACH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The *Quick order* tab of the order-entry switch (feature 091, P4d).
|
|
4
|
+
*
|
|
5
|
+
* The twin of `orders`' `OrderEntryStandardTab`, and the other half of what
|
|
6
|
+
* `admin/src/components/OrderEntryTabs.tsx` used to do out of a file belonging
|
|
7
|
+
* to neither module: this module's route, this module's label, resolved out of
|
|
8
|
+
* this module's own bundle rather than the shared `core` one.
|
|
9
|
+
*
|
|
10
|
+
* **No `match`, on `OrderEntryStandardTab`'s terms and for its reason**:
|
|
11
|
+
* `order.entry.tabs` carries no props, so there is nothing to narrow.
|
|
12
|
+
* `admin/test/modules/orders/order-entry-tabs-zone.test.tsx` asserts it absent
|
|
13
|
+
* on both contributions.
|
|
14
|
+
*/
|
|
15
|
+
export declare function OrderEntryQuickTab(): ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* The zone renderer loads a contribution through a dynamic-import factory and
|
|
18
|
+
* reads its default export (feature 091, FR-013).
|
|
19
|
+
*/
|
|
20
|
+
export default OrderEntryQuickTab;
|
|
21
|
+
//# sourceMappingURL=OrderEntryQuickTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrderEntryQuickTab.d.ts","sourceRoot":"","sources":["../../../src/admin/zones/OrderEntryQuickTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,IAAI,SAAS,CAG9C;AAED;;;GAGG;AACH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { RouteTabLink } from '@endora-commerce/admin-kit/ui';
|
|
3
|
+
import { useTranslation } from '@endora-commerce/admin-kit/i18n';
|
|
4
|
+
/**
|
|
5
|
+
* The *Quick order* tab of the order-entry switch (feature 091, P4d).
|
|
6
|
+
*
|
|
7
|
+
* The twin of `orders`' `OrderEntryStandardTab`, and the other half of what
|
|
8
|
+
* `admin/src/components/OrderEntryTabs.tsx` used to do out of a file belonging
|
|
9
|
+
* to neither module: this module's route, this module's label, resolved out of
|
|
10
|
+
* this module's own bundle rather than the shared `core` one.
|
|
11
|
+
*
|
|
12
|
+
* **No `match`, on `OrderEntryStandardTab`'s terms and for its reason**:
|
|
13
|
+
* `order.entry.tabs` carries no props, so there is nothing to narrow.
|
|
14
|
+
* `admin/test/modules/orders/order-entry-tabs-zone.test.tsx` asserts it absent
|
|
15
|
+
* on both contributions.
|
|
16
|
+
*/
|
|
17
|
+
export function OrderEntryQuickTab() {
|
|
18
|
+
const t = useTranslation('quick_order');
|
|
19
|
+
return _jsx(RouteTabLink, { to: "/orders/quick-order", label: t('orderEntry.tab.quick') });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The zone renderer loads a contribution through a dynamic-import factory and
|
|
23
|
+
* reads its default export (feature 091, FR-013).
|
|
24
|
+
*/
|
|
25
|
+
export default OrderEntryQuickTab;
|
|
26
|
+
//# sourceMappingURL=OrderEntryQuickTab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrderEntryQuickTab.js","sourceRoot":"","sources":["../../../src/admin/zones/OrderEntryQuickTab.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,CAAC,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;IACxC,OAAO,KAAC,YAAY,IAAC,EAAE,EAAC,qBAAqB,EAAC,KAAK,EAAE,CAAC,CAAC,sBAAsB,CAAC,GAAI,CAAC;AACrF,CAAC;AAED;;;GAGG;AACH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AdminZoneProps } from '@endora-commerce/contracts';
|
|
3
|
+
/**
|
|
4
|
+
* The organization's default ordering preferences (feature 091, P7b).
|
|
5
|
+
*
|
|
6
|
+
* `organizations`' `OrganizationDetail.tsx` used to import
|
|
7
|
+
* `DefaultPreferencesPanel` by path and pass `scope="organization"` — one of
|
|
8
|
+
* the three keys of
|
|
9
|
+
* `backend/scripts/ledgers/cross-module-imports/organizations.ts`. The place is
|
|
10
|
+
* `organization.detail.after` now and the scope is *this module's* constant.
|
|
11
|
+
*
|
|
12
|
+
* **This wrapper and `CustomerDefaults` are the whole cost of Z13.** Under the
|
|
13
|
+
* rejected shared `entity.detail.after` they would have been one contribution
|
|
14
|
+
* and one `match`; under two members they are two four-line files, and in
|
|
15
|
+
* exchange `unrendered-zone` answers per host instead of letting one host's
|
|
16
|
+
* mount cover the other's absence.
|
|
17
|
+
*
|
|
18
|
+
* **No `match`, and it is a decision rather than an omission.** This place has
|
|
19
|
+
* one host and one mount, so there is nothing to narrow.
|
|
20
|
+
* `admin/test/modules/quick_order/quick-order-zones.test.tsx` asserts it absent
|
|
21
|
+
* so a later author cannot add one quietly.
|
|
22
|
+
*/
|
|
23
|
+
export type OrganizationDefaultsProps = AdminZoneProps<'organization.detail.after'>;
|
|
24
|
+
export declare function OrganizationDefaults({ organizationId }: OrganizationDefaultsProps): ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* The zone renderer loads a contribution through a dynamic-import factory and
|
|
27
|
+
* reads its default export (feature 091, FR-013).
|
|
28
|
+
*/
|
|
29
|
+
export default OrganizationDefaults;
|
|
30
|
+
//# sourceMappingURL=OrganizationDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationDefaults.d.ts","sourceRoot":"","sources":["../../../src/admin/zones/OrganizationDefaults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,2BAA2B,CAAC,CAAC;AAEpF,wBAAgB,oBAAoB,CAAC,EAAE,cAAc,EAAE,EAAE,yBAAyB,GAAG,SAAS,CAE7F;AAED;;;GAGG;AACH,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DefaultPreferencesPanel } from '../components/DefaultPreferencesPanel.js';
|
|
3
|
+
export function OrganizationDefaults({ organizationId }) {
|
|
4
|
+
return _jsx(DefaultPreferencesPanel, { scope: "organization", scopeId: organizationId });
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The zone renderer loads a contribution through a dynamic-import factory and
|
|
8
|
+
* reads its default export (feature 091, FR-013).
|
|
9
|
+
*/
|
|
10
|
+
export default OrganizationDefaults;
|
|
11
|
+
//# sourceMappingURL=OrganizationDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganizationDefaults.js","sourceRoot":"","sources":["../../../src/admin/zones/OrganizationDefaults.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAwBnF,MAAM,UAAU,oBAAoB,CAAC,EAAE,cAAc,EAA6B;IAChF,OAAO,KAAC,uBAAuB,IAAC,KAAK,EAAC,cAAc,EAAC,OAAO,EAAE,cAAc,GAAI,CAAC;AACnF,CAAC;AAED;;;GAGG;AACH,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OptionalProps } from '@mikro-orm/core';
|
|
2
|
+
/**
|
|
3
|
+
* QuickOrderDefaultPreference (feature 039, US2). One row per target — either
|
|
4
|
+
* an Organization or a Customer — holding the four default ordering selections
|
|
5
|
+
* (payment method, delivery method, billing address, shipping address). A
|
|
6
|
+
* customer row overrides the organization row per field; resolution lives in
|
|
7
|
+
* the service. References are plain ids with `ON DELETE SET NULL` FKs (the
|
|
8
|
+
* unique + check + FK constraints are declared in migration 057).
|
|
9
|
+
*/
|
|
10
|
+
export declare class QuickOrderDefaultPreference {
|
|
11
|
+
[OptionalProps]?: 'id' | 'createdAt' | 'updatedAt' | 'defaultPaymentMethodId' | 'defaultDeliveryMethodId' | 'defaultBillingAddressId' | 'defaultShippingAddressId';
|
|
12
|
+
id: string;
|
|
13
|
+
scope: 'organization' | 'customer';
|
|
14
|
+
scopeId: string;
|
|
15
|
+
defaultPaymentMethodId?: string | null;
|
|
16
|
+
defaultDeliveryMethodId?: string | null;
|
|
17
|
+
defaultBillingAddressId?: string | null;
|
|
18
|
+
defaultShippingAddressId?: string | null;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=quick-order-default-preference.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-order-default-preference.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/quick-order-default-preference.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAI7F;;;;;;;GAOG;AACH,qBAGa,2BAA2B;IACtC,CAAC,aAAa,CAAC,CAAC,EACZ,IAAI,GACJ,WAAW,GACX,WAAW,GACX,wBAAwB,GACxB,yBAAyB,GACzB,yBAAyB,GACzB,0BAA0B,CAAC;IAG/B,EAAE,EAAE,MAAM,CAAgB;IAG1B,KAAK,EAAG,cAAc,GAAG,UAAU,CAAC;IAIpC,OAAO,EAAG,MAAM,CAAC;IAGjB,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvC,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxC,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxC,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzC,SAAS,EAAE,IAAI,CAAc;IAG7B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Entity, Index, OptionalProps, PrimaryKey, Property, Unique } from '@mikro-orm/core';
|
|
11
|
+
import { GlobalEntity } from '@endora-commerce/platform/tenancy';
|
|
12
|
+
import { randomUUID } from 'crypto';
|
|
13
|
+
/**
|
|
14
|
+
* QuickOrderDefaultPreference (feature 039, US2). One row per target — either
|
|
15
|
+
* an Organization or a Customer — holding the four default ordering selections
|
|
16
|
+
* (payment method, delivery method, billing address, shipping address). A
|
|
17
|
+
* customer row overrides the organization row per field; resolution lives in
|
|
18
|
+
* the service. References are plain ids with `ON DELETE SET NULL` FKs (the
|
|
19
|
+
* unique + check + FK constraints are declared in migration 057).
|
|
20
|
+
*/
|
|
21
|
+
let QuickOrderDefaultPreference = class QuickOrderDefaultPreference {
|
|
22
|
+
[OptionalProps];
|
|
23
|
+
id = randomUUID();
|
|
24
|
+
scope;
|
|
25
|
+
scopeId;
|
|
26
|
+
defaultPaymentMethodId;
|
|
27
|
+
defaultDeliveryMethodId;
|
|
28
|
+
defaultBillingAddressId;
|
|
29
|
+
defaultShippingAddressId;
|
|
30
|
+
createdAt = new Date();
|
|
31
|
+
updatedAt = new Date();
|
|
32
|
+
};
|
|
33
|
+
__decorate([
|
|
34
|
+
PrimaryKey({ type: 'uuid' }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], QuickOrderDefaultPreference.prototype, "id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
Property({ type: 'string', length: 16 }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], QuickOrderDefaultPreference.prototype, "scope", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
Property({ type: 'uuid' }),
|
|
43
|
+
Index(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], QuickOrderDefaultPreference.prototype, "scopeId", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
Property({ type: 'uuid', nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], QuickOrderDefaultPreference.prototype, "defaultPaymentMethodId", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
Property({ type: 'uuid', nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], QuickOrderDefaultPreference.prototype, "defaultDeliveryMethodId", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
Property({ type: 'uuid', nullable: true }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], QuickOrderDefaultPreference.prototype, "defaultBillingAddressId", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
Property({ type: 'uuid', nullable: true }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], QuickOrderDefaultPreference.prototype, "defaultShippingAddressId", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
Property({ type: 'datetime', onCreate: () => new Date() }),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], QuickOrderDefaultPreference.prototype, "createdAt", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
Property({ type: 'datetime', onUpdate: () => new Date() }),
|
|
68
|
+
__metadata("design:type", Date)
|
|
69
|
+
], QuickOrderDefaultPreference.prototype, "updatedAt", void 0);
|
|
70
|
+
QuickOrderDefaultPreference = __decorate([
|
|
71
|
+
GlobalEntity(),
|
|
72
|
+
Entity({ tableName: 'quick_order_default_preferences' }),
|
|
73
|
+
Unique({ properties: ['scope', 'scopeId'] })
|
|
74
|
+
], QuickOrderDefaultPreference);
|
|
75
|
+
export { QuickOrderDefaultPreference };
|
|
76
|
+
//# sourceMappingURL=quick-order-default-preference.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-order-default-preference.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/quick-order-default-preference.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;;;;;GAOG;AAII,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,CAAC,aAAa,CAAC,CAOgB;IAG/B,EAAE,GAAW,UAAU,EAAE,CAAC;IAG1B,KAAK,CAA+B;IAIpC,OAAO,CAAU;IAGjB,sBAAsB,CAAiB;IAGvC,uBAAuB,CAAiB;IAGxC,uBAAuB,CAAiB;IAGxC,wBAAwB,CAAiB;IAGzC,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IAG7B,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;CAC9B,CAAA;AA1BC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDACH;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;0DACL;AAIpC;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,EAAE;;4DACS;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2EACJ;AAGvC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4EACH;AAGxC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4EACH;AAGxC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6EACF;AAGzC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BAChD,IAAI;8DAAc;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BAChD,IAAI;8DAAc;AApClB,2BAA2B;IAHvC,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,iCAAiC,EAAE,CAAC;IACxD,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;GAChC,2BAA2B,CAqCvC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { EntityManager } from '@mikro-orm/postgresql';
|
|
2
|
+
import type { FastifyRequest } from 'fastify';
|
|
3
|
+
import type { AuditPort } from '@endora-commerce/platform/kernel';
|
|
4
|
+
import type { CustomerAddressReadPort } from '@endora-commerce/contracts';
|
|
5
|
+
import type { ModuleContext } from '@endora-commerce/platform/kernel';
|
|
6
|
+
import type { RequireAdminFactory } from '@endora-commerce/platform/kernel';
|
|
7
|
+
import type { SettingsReadPort } from '@endora-commerce/platform/kernel';
|
|
8
|
+
import { QuickOrderImportPipeline } from './services/import-pipeline.js';
|
|
9
|
+
import { QuickOrderBuildService } from './services/quick-order-build-service.js';
|
|
10
|
+
import { DefaultPreferenceService } from './services/default-preference-service.js';
|
|
11
|
+
import { OneClickService } from './services/one-click-service.js';
|
|
12
|
+
import { QuickOrderDefaultPreference } from './entities/quick-order-default-preference.entity.js';
|
|
13
|
+
/**
|
|
14
|
+
* `quick_order` — a module that owned five route files and was mounted by
|
|
15
|
+
* another module's plugin (feature 072, wave 4, T139).
|
|
16
|
+
*
|
|
17
|
+
* Nothing here is new code. All of it lived in `shopping_lists/plugin.ts`,
|
|
18
|
+
* whose header described itself as *"composition root for the shopping_lists +
|
|
19
|
+
* quick_order modules"* — two lifecycle participants, one factory, and
|
|
20
|
+
* therefore one activation control. `shopping_lists`' own manifest said so
|
|
21
|
+
* outright: its description covered "the quick-order surfaces this module
|
|
22
|
+
* hosts", with a note pointing at this task.
|
|
23
|
+
*
|
|
24
|
+
* The cost was not organisational. Because the surfaces were mounted by
|
|
25
|
+
* `shopping_lists`, switching *that* module off took quick order with it, and
|
|
26
|
+
* switching quick order off was not expressible at all — a deployment that
|
|
27
|
+
* wants CSV import but no shopping lists, or the reverse, could not be
|
|
28
|
+
* configured. Constitution XVII says presence is per module; a module whose
|
|
29
|
+
* surfaces another module mounts has no presence of its own.
|
|
30
|
+
*
|
|
31
|
+
* **Three nested conditionals decided which endpoints existed.** The host
|
|
32
|
+
* mounted the preference routes only `if (options.auditLog)`, the admin
|
|
33
|
+
* preference routes only `if (options.requireAdmin && options.resolveAdminContext)`,
|
|
34
|
+
* and one-click buy only `if (options.getOrderService && options.resolveOneClickEnabled)`.
|
|
35
|
+
* Every root passed all five, so the reduced shapes were nobody's deployment —
|
|
36
|
+
* but "which endpoints does this module serve" answered by "which arguments did
|
|
37
|
+
* a root remember", which is the defect this whole wave removes. All five route
|
|
38
|
+
* groups register unconditionally now, and the module's own activation control
|
|
39
|
+
* is the one intentional gate.
|
|
40
|
+
*
|
|
41
|
+
* **Feature 075, Phase C — every collaborator is a published port now.** The
|
|
42
|
+
* five type imports this file carried (`CartService`, `CatalogAttributeReadService`,
|
|
43
|
+
* `OrderService`, `OrganizationRestrictionService`, `RfqService`) named five
|
|
44
|
+
* other modules' classes; they are `@endora-commerce/contracts` interfaces resolved by
|
|
45
|
+
* `lazyPort` with a string literal. Six more ports arrive with them, because
|
|
46
|
+
* the two preference surfaces and the CSV lookup were reading five modules'
|
|
47
|
+
* entities directly.
|
|
48
|
+
*
|
|
49
|
+
* `orderServiceAccessor` is gone with the last of them. The one-click flow
|
|
50
|
+
* reached `OrderService` through it — a `() => OrderService | null` whose
|
|
51
|
+
* `null` arm the service turned into a 503 — and `orderPlacementPort` answers
|
|
52
|
+
* the same 503 at the resolution seam, where a wiring mistake and an absent
|
|
53
|
+
* module stop being the same value.
|
|
54
|
+
*/
|
|
55
|
+
/** What `quick_order` resolves from the container, and the names it owns. */
|
|
56
|
+
export interface QuickOrderCradle {
|
|
57
|
+
readonly emFactory: () => EntityManager;
|
|
58
|
+
readonly auditLogService: AuditPort;
|
|
59
|
+
readonly requireAdmin: RequireAdminFactory;
|
|
60
|
+
readonly requireCustomer: (req: FastifyRequest, reply: unknown) => Promise<void>;
|
|
61
|
+
readonly customerContextResolver: (req: FastifyRequest) => {
|
|
62
|
+
customerAccountId: string;
|
|
63
|
+
organizationId: string;
|
|
64
|
+
};
|
|
65
|
+
readonly adminContextResolver: (req: FastifyRequest) => {
|
|
66
|
+
adminUserId: string;
|
|
67
|
+
};
|
|
68
|
+
readonly settingsReadPort: SettingsReadPort;
|
|
69
|
+
readonly quickOrderPipeline: QuickOrderImportPipeline;
|
|
70
|
+
readonly quickOrderBuildService: QuickOrderBuildService;
|
|
71
|
+
readonly quickOrderPreferenceService: DefaultPreferenceService;
|
|
72
|
+
readonly quickOrderOneClickService: OneClickService;
|
|
73
|
+
}
|
|
74
|
+
export declare function customerAddressesOrAbsent(port: CustomerAddressReadPort): CustomerAddressReadPort;
|
|
75
|
+
export declare function registerModule(ctx: ModuleContext): void;
|
|
76
|
+
/**
|
|
77
|
+
* The module's persisted entity classes, on the `./backend` subpath, as one
|
|
78
|
+
* array and **no named class export** (D-168).
|
|
79
|
+
*
|
|
80
|
+
* This is the shape the platform reads when the package is *installed*: the
|
|
81
|
+
* boot-time loader (`src/packages/package-runtime.ts`, `exported['entities']`)
|
|
82
|
+
* and the static declaration reader (`scripts/lib/package-declarations.ts`),
|
|
83
|
+
* which is the third source of `check:module-boundary`'s `table→owner` map and
|
|
84
|
+
* the package pass of `check-entity-tenant-classification`. A missing array is
|
|
85
|
+
* answered with `[]` — zero entities registered, no error anywhere.
|
|
86
|
+
*/
|
|
87
|
+
export declare const entities: (typeof QuickOrderDefaultPreference)[];
|
|
88
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAMV,uBAAuB,EAQxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAOzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qDAAqD,CAAC;AAElG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,aAAa,CAAC;IACxC,QAAQ,CAAC,eAAe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