@endora-commerce/contracts 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 +34 -0
- package/dist/actor.d.ts +79 -0
- package/dist/actor.d.ts.map +1 -0
- package/dist/actor.js +41 -0
- package/dist/actor.js.map +1 -0
- package/dist/addresses.d.ts +134 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/addresses.js +16 -0
- package/dist/addresses.js.map +1 -0
- package/dist/admin-actions.d.ts +367 -0
- package/dist/admin-actions.d.ts.map +1 -0
- package/dist/admin-actions.js +287 -0
- package/dist/admin-actions.js.map +1 -0
- package/dist/admin-contributions.d.ts +518 -0
- package/dist/admin-contributions.d.ts.map +1 -0
- package/dist/admin-contributions.js +495 -0
- package/dist/admin-contributions.js.map +1 -0
- package/dist/admin-i18n.d.ts +135 -0
- package/dist/admin-i18n.d.ts.map +1 -0
- package/dist/admin-i18n.js +72 -0
- package/dist/admin-i18n.js.map +1 -0
- package/dist/admin-notifications.d.ts +55 -0
- package/dist/admin-notifications.d.ts.map +1 -0
- package/dist/admin-notifications.js +16 -0
- package/dist/admin-notifications.js.map +1 -0
- package/dist/admin-roles.d.ts +125 -0
- package/dist/admin-roles.d.ts.map +1 -0
- package/dist/admin-roles.js +2 -0
- package/dist/admin-roles.js.map +1 -0
- package/dist/admin-users.d.ts +178 -0
- package/dist/admin-users.d.ts.map +1 -0
- package/dist/admin-users.js +14 -0
- package/dist/admin-users.js.map +1 -0
- package/dist/admin.d.ts +243 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +246 -0
- package/dist/admin.js.map +1 -0
- package/dist/analytics.d.ts +123 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +68 -0
- package/dist/analytics.js.map +1 -0
- package/dist/api-keys.d.ts +97 -0
- package/dist/api-keys.d.ts.map +1 -0
- package/dist/api-keys.js +64 -0
- package/dist/api-keys.js.map +1 -0
- package/dist/assets-library.d.ts +684 -0
- package/dist/assets-library.d.ts.map +1 -0
- package/dist/assets-library.js +181 -0
- package/dist/assets-library.js.map +1 -0
- package/dist/audit-logs.d.ts +141 -0
- package/dist/audit-logs.d.ts.map +1 -0
- package/dist/audit-logs.js +31 -0
- package/dist/audit-logs.js.map +1 -0
- package/dist/auth.d.ts +174 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +27 -0
- package/dist/auth.js.map +1 -0
- package/dist/blog.d.ts +669 -0
- package/dist/blog.d.ts.map +1 -0
- package/dist/blog.js +360 -0
- package/dist/blog.js.map +1 -0
- package/dist/capabilities.d.ts +40 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +38 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/carts.d.ts +1367 -0
- package/dist/carts.d.ts.map +1 -0
- package/dist/carts.js +405 -0
- package/dist/carts.js.map +1 -0
- package/dist/catalog.d.ts +2855 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +1543 -0
- package/dist/catalog.js.map +1 -0
- package/dist/cms.d.ts +872 -0
- package/dist/cms.d.ts.map +1 -0
- package/dist/cms.js +468 -0
- package/dist/cms.js.map +1 -0
- package/dist/common.d.ts +82 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +72 -0
- package/dist/common.js.map +1 -0
- package/dist/comparisons.d.ts +487 -0
- package/dist/comparisons.d.ts.map +1 -0
- package/dist/comparisons.js +221 -0
- package/dist/comparisons.js.map +1 -0
- package/dist/credentials.d.ts +292 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +142 -0
- package/dist/credentials.js.map +1 -0
- package/dist/credit-limits.d.ts +111 -0
- package/dist/credit-limits.d.ts.map +1 -0
- package/dist/credit-limits.js +35 -0
- package/dist/credit-limits.js.map +1 -0
- package/dist/currencies.d.ts +127 -0
- package/dist/currencies.d.ts.map +1 -0
- package/dist/currencies.js +20 -0
- package/dist/currencies.js.map +1 -0
- package/dist/custom-fields.d.ts +345 -0
- package/dist/custom-fields.d.ts.map +1 -0
- package/dist/custom-fields.js +185 -0
- package/dist/custom-fields.js.map +1 -0
- package/dist/customer-accounts.d.ts +690 -0
- package/dist/customer-accounts.d.ts.map +1 -0
- package/dist/customer-accounts.js +41 -0
- package/dist/customer-accounts.js.map +1 -0
- package/dist/customers.d.ts +305 -0
- package/dist/customers.d.ts.map +1 -0
- package/dist/customers.js +158 -0
- package/dist/customers.js.map +1 -0
- package/dist/dictionary.d.ts +580 -0
- package/dist/dictionary.d.ts.map +1 -0
- package/dist/dictionary.js +297 -0
- package/dist/dictionary.js.map +1 -0
- package/dist/email-address.d.ts +62 -0
- package/dist/email-address.d.ts.map +1 -0
- package/dist/email-address.js +64 -0
- package/dist/email-address.js.map +1 -0
- package/dist/email.d.ts +175 -0
- package/dist/email.d.ts.map +1 -0
- package/dist/email.js +45 -0
- package/dist/email.js.map +1 -0
- package/dist/envelopes.d.ts +15 -0
- package/dist/envelopes.d.ts.map +1 -0
- package/dist/envelopes.js +16 -0
- package/dist/envelopes.js.map +1 -0
- package/dist/environment-inputs.d.ts +306 -0
- package/dist/environment-inputs.d.ts.map +1 -0
- package/dist/environment-inputs.js +277 -0
- package/dist/environment-inputs.js.map +1 -0
- package/dist/erp-connector.d.ts +52 -0
- package/dist/erp-connector.d.ts.map +1 -0
- package/dist/erp-connector.js +34 -0
- package/dist/erp-connector.js.map +1 -0
- package/dist/errors.d.ts +455 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +532 -0
- package/dist/errors.js.map +1 -0
- package/dist/google-analytics.d.ts +181 -0
- package/dist/google-analytics.d.ts.map +1 -0
- package/dist/google-analytics.js +176 -0
- package/dist/google-analytics.js.map +1 -0
- package/dist/google-tag-manager.d.ts +111 -0
- package/dist/google-tag-manager.d.ts.map +1 -0
- package/dist/google-tag-manager.js +129 -0
- package/dist/google-tag-manager.js.map +1 -0
- package/dist/i18n.d.ts +69 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +59 -0
- package/dist/i18n.js.map +1 -0
- package/dist/import-export.d.ts +63 -0
- package/dist/import-export.d.ts.map +1 -0
- package/dist/import-export.js +37 -0
- package/dist/import-export.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +126 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory.d.ts +673 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +412 -0
- package/dist/inventory.js.map +1 -0
- package/dist/invoice-ledger.d.ts +366 -0
- package/dist/invoice-ledger.d.ts.map +1 -0
- package/dist/invoice-ledger.js +114 -0
- package/dist/invoice-ledger.js.map +1 -0
- package/dist/invoices.d.ts +845 -0
- package/dist/invoices.d.ts.map +1 -0
- package/dist/invoices.js +314 -0
- package/dist/invoices.js.map +1 -0
- package/dist/kernel.d.ts +49 -0
- package/dist/kernel.d.ts.map +1 -0
- package/dist/kernel.js +19 -0
- package/dist/kernel.js.map +1 -0
- package/dist/languages.d.ts +122 -0
- package/dist/languages.d.ts.map +1 -0
- package/dist/languages.js +24 -0
- package/dist/languages.js.map +1 -0
- package/dist/linkedin-ads.d.ts +167 -0
- package/dist/linkedin-ads.d.ts.map +1 -0
- package/dist/linkedin-ads.js +156 -0
- package/dist/linkedin-ads.js.map +1 -0
- package/dist/megamenu.d.ts +556 -0
- package/dist/megamenu.d.ts.map +1 -0
- package/dist/megamenu.js +186 -0
- package/dist/megamenu.js.map +1 -0
- package/dist/meta-ads.d.ts +126 -0
- package/dist/meta-ads.d.ts.map +1 -0
- package/dist/meta-ads.js +112 -0
- package/dist/meta-ads.js.map +1 -0
- package/dist/mfa.d.ts +274 -0
- package/dist/mfa.d.ts.map +1 -0
- package/dist/mfa.js +187 -0
- package/dist/mfa.js.map +1 -0
- package/dist/modules.d.ts +1706 -0
- package/dist/modules.d.ts.map +1 -0
- package/dist/modules.js +1390 -0
- package/dist/modules.js.map +1 -0
- package/dist/newsletter.d.ts +611 -0
- package/dist/newsletter.d.ts.map +1 -0
- package/dist/newsletter.js +345 -0
- package/dist/newsletter.js.map +1 -0
- package/dist/orders.d.ts +1175 -0
- package/dist/orders.d.ts.map +1 -0
- package/dist/orders.js +630 -0
- package/dist/orders.js.map +1 -0
- package/dist/organizations.d.ts +938 -0
- package/dist/organizations.d.ts.map +1 -0
- package/dist/organizations.js +418 -0
- package/dist/organizations.js.map +1 -0
- package/dist/pagination.d.ts +21 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +22 -0
- package/dist/pagination.js.map +1 -0
- package/dist/payment-methods.d.ts +472 -0
- package/dist/payment-methods.d.ts.map +1 -0
- package/dist/payment-methods.js +175 -0
- package/dist/payment-methods.js.map +1 -0
- package/dist/payment-return-url.d.ts +53 -0
- package/dist/payment-return-url.d.ts.map +1 -0
- package/dist/payment-return-url.js +35 -0
- package/dist/payment-return-url.js.map +1 -0
- package/dist/payments.d.ts +386 -0
- package/dist/payments.d.ts.map +1 -0
- package/dist/payments.js +84 -0
- package/dist/payments.js.map +1 -0
- package/dist/pim-connector.d.ts +60 -0
- package/dist/pim-connector.d.ts.map +1 -0
- package/dist/pim-connector.js +43 -0
- package/dist/pim-connector.js.map +1 -0
- package/dist/pim-field-path.d.ts +6 -0
- package/dist/pim-field-path.d.ts.map +1 -0
- package/dist/pim-field-path.js +101 -0
- package/dist/pim-field-path.js.map +1 -0
- package/dist/platform-language.d.ts +20 -0
- package/dist/platform-language.d.ts.map +1 -0
- package/dist/platform-language.js +22 -0
- package/dist/platform-language.js.map +1 -0
- package/dist/price-lists.d.ts +685 -0
- package/dist/price-lists.d.ts.map +1 -0
- package/dist/price-lists.js +330 -0
- package/dist/price-lists.js.map +1 -0
- package/dist/product-feeds.d.ts +2837 -0
- package/dist/product-feeds.d.ts.map +1 -0
- package/dist/product-feeds.js +1504 -0
- package/dist/product-feeds.js.map +1 -0
- package/dist/product-scope-overrides.d.ts +134 -0
- package/dist/product-scope-overrides.d.ts.map +1 -0
- package/dist/product-scope-overrides.js +82 -0
- package/dist/product-scope-overrides.js.map +1 -0
- package/dist/product-value-resolver.d.ts +88 -0
- package/dist/product-value-resolver.d.ts.map +1 -0
- package/dist/product-value-resolver.js +128 -0
- package/dist/product-value-resolver.js.map +1 -0
- package/dist/promotions.d.ts +678 -0
- package/dist/promotions.d.ts.map +1 -0
- package/dist/promotions.js +479 -0
- package/dist/promotions.js.map +1 -0
- package/dist/prompt-actions.d.ts +582 -0
- package/dist/prompt-actions.d.ts.map +1 -0
- package/dist/prompt-actions.js +221 -0
- package/dist/prompt-actions.js.map +1 -0
- package/dist/pwa.d.ts +293 -0
- package/dist/pwa.d.ts.map +1 -0
- package/dist/pwa.js +204 -0
- package/dist/pwa.js.map +1 -0
- package/dist/quick-order.d.ts +340 -0
- package/dist/quick-order.d.ts.map +1 -0
- package/dist/quick-order.js +177 -0
- package/dist/quick-order.js.map +1 -0
- package/dist/quote-requests.d.ts +538 -0
- package/dist/quote-requests.d.ts.map +1 -0
- package/dist/quote-requests.js +308 -0
- package/dist/quote-requests.js.map +1 -0
- package/dist/returns.d.ts +774 -0
- package/dist/returns.d.ts.map +1 -0
- package/dist/returns.js +389 -0
- package/dist/returns.js.map +1 -0
- package/dist/sales-channels.d.ts +392 -0
- package/dist/sales-channels.d.ts.map +1 -0
- package/dist/sales-channels.js +285 -0
- package/dist/sales-channels.js.map +1 -0
- package/dist/scope-notice.d.ts +60 -0
- package/dist/scope-notice.d.ts.map +1 -0
- package/dist/scope-notice.js +56 -0
- package/dist/scope-notice.js.map +1 -0
- package/dist/search.d.ts +321 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +160 -0
- package/dist/search.js.map +1 -0
- package/dist/seo.d.ts +113 -0
- package/dist/seo.d.ts.map +1 -0
- package/dist/seo.js +63 -0
- package/dist/seo.js.map +1 -0
- package/dist/settings.d.ts +453 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +337 -0
- package/dist/settings.js.map +1 -0
- package/dist/shipments.d.ts +140 -0
- package/dist/shipments.d.ts.map +1 -0
- package/dist/shipments.js +14 -0
- package/dist/shipments.js.map +1 -0
- package/dist/shipping-methods.d.ts +350 -0
- package/dist/shipping-methods.d.ts.map +1 -0
- package/dist/shipping-methods.js +99 -0
- package/dist/shipping-methods.js.map +1 -0
- package/dist/shopping-lists.d.ts +122 -0
- package/dist/shopping-lists.d.ts.map +1 -0
- package/dist/shopping-lists.js +92 -0
- package/dist/shopping-lists.js.map +1 -0
- package/dist/taxes.d.ts +106 -0
- package/dist/taxes.d.ts.map +1 -0
- package/dist/taxes.js +80 -0
- package/dist/taxes.js.map +1 -0
- package/dist/text-normalization.d.ts +199 -0
- package/dist/text-normalization.d.ts.map +1 -0
- package/dist/text-normalization.js +205 -0
- package/dist/text-normalization.js.map +1 -0
- package/dist/transactional-emails.d.ts +459 -0
- package/dist/transactional-emails.d.ts.map +1 -0
- package/dist/transactional-emails.js +212 -0
- package/dist/transactional-emails.js.map +1 -0
- package/dist/webhooks.d.ts +69 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +53 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type PaymentMethodKind } from './payments.js';
|
|
3
|
+
/**
|
|
4
|
+
* Payment Method adapter framework (feature 034 — Metoda Płatności).
|
|
5
|
+
*
|
|
6
|
+
* Source-of-truth schemas for the admin-managed payment-method entry and the
|
|
7
|
+
* adapter ingress, plus the behavioural `PaymentAdapter` contract a module
|
|
8
|
+
* implements to act as a payment method. The adapter `type` mirrors the
|
|
9
|
+
* existing `PaymentMethod.kind`.
|
|
10
|
+
*/
|
|
11
|
+
/** Adapter type — kept aligned with the existing `PaymentMethod.kind`. */
|
|
12
|
+
export declare const paymentAdapterTypeSchema: z.ZodEnum<{
|
|
13
|
+
bank_transfer: "bank_transfer";
|
|
14
|
+
pickup: "pickup";
|
|
15
|
+
credit_limit: "credit_limit";
|
|
16
|
+
gateway: "gateway";
|
|
17
|
+
}>;
|
|
18
|
+
export type PaymentAdapterType = PaymentMethodKind;
|
|
19
|
+
/**
|
|
20
|
+
* Localised name: a non-empty record of `lang → label`. A surface in language
|
|
21
|
+
* `xx` uses `name[xx]` when present; otherwise the `default` key, otherwise the
|
|
22
|
+
* first available value (see the backend name-resolver). Kept as an open record
|
|
23
|
+
* for compatibility with the existing locale-keyed payloads (`en-US`, `pl-PL`).
|
|
24
|
+
*/
|
|
25
|
+
export declare const paymentMethodNameSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
26
|
+
export type PaymentMethodName = z.infer<typeof paymentMethodNameSchema>;
|
|
27
|
+
/** One selectable Order-status option (from the OrderStatusRegistry port). */
|
|
28
|
+
export declare const orderStatusOptionSchema: z.ZodObject<{
|
|
29
|
+
code: z.ZodString;
|
|
30
|
+
label: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type OrderStatusOption = z.infer<typeof orderStatusOptionSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* Admin upsert body for a payment-method entry. `kind` is required (the core
|
|
35
|
+
* discriminator); `adapter` defaults to `kind` and `statusOn*` to the seed
|
|
36
|
+
* order statuses when omitted — keeping the pre-feature-034 payload
|
|
37
|
+
* (`{ code, name, kind }`) valid while letting the richer admin form send the
|
|
38
|
+
* full configuration.
|
|
39
|
+
*/
|
|
40
|
+
export declare const paymentMethodUpsertSchema: z.ZodObject<{
|
|
41
|
+
code: z.ZodOptional<z.ZodString>;
|
|
42
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
43
|
+
kind: z.ZodEnum<{
|
|
44
|
+
bank_transfer: "bank_transfer";
|
|
45
|
+
pickup: "pickup";
|
|
46
|
+
credit_limit: "credit_limit";
|
|
47
|
+
gateway: "gateway";
|
|
48
|
+
}>;
|
|
49
|
+
adapter: z.ZodOptional<z.ZodString>;
|
|
50
|
+
additionalPrice: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
active: "active";
|
|
53
|
+
inactive: "inactive";
|
|
54
|
+
}>>;
|
|
55
|
+
statusOnPending: z.ZodOptional<z.ZodString>;
|
|
56
|
+
statusOnSuccess: z.ZodOptional<z.ZodString>;
|
|
57
|
+
statusOnFailure: z.ZodOptional<z.ZodString>;
|
|
58
|
+
salesChannelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export type PaymentMethodUpsert = z.infer<typeof paymentMethodUpsertSchema>;
|
|
61
|
+
/**
|
|
62
|
+
* Whether the method is offered to buyers — feature 076, D-82.
|
|
63
|
+
*
|
|
64
|
+
* Its own body, because it is its own operation. `paymentMethodUpsertSchema`
|
|
65
|
+
* requires `name` and `kind`, so a toggle expressed through the `PUT` would
|
|
66
|
+
* have to resend the whole record, and a stale client that did would clobber a
|
|
67
|
+
* concurrent edit of fields it never meant to touch.
|
|
68
|
+
*
|
|
69
|
+
* `status` stays on the upsert as well: a full edit that happens to include
|
|
70
|
+
* availability is one legitimate operation, and removing it there would force
|
|
71
|
+
* two round trips for one form.
|
|
72
|
+
*/
|
|
73
|
+
export declare const paymentMethodStatusPatchSchema: z.ZodObject<{
|
|
74
|
+
status: z.ZodEnum<{
|
|
75
|
+
active: "active";
|
|
76
|
+
inactive: "inactive";
|
|
77
|
+
}>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export type PaymentMethodStatusPatch = z.infer<typeof paymentMethodStatusPatchSchema>;
|
|
80
|
+
/** Admin detail (full config) response. */
|
|
81
|
+
export declare const paymentMethodAdminSchema: z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
code: z.ZodString;
|
|
84
|
+
adapter: z.ZodString;
|
|
85
|
+
kind: z.ZodEnum<{
|
|
86
|
+
bank_transfer: "bank_transfer";
|
|
87
|
+
pickup: "pickup";
|
|
88
|
+
credit_limit: "credit_limit";
|
|
89
|
+
gateway: "gateway";
|
|
90
|
+
}>;
|
|
91
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
92
|
+
status: z.ZodEnum<{
|
|
93
|
+
active: "active";
|
|
94
|
+
inactive: "inactive";
|
|
95
|
+
}>;
|
|
96
|
+
additionalPrice: z.ZodNumber;
|
|
97
|
+
statusOnPending: z.ZodString;
|
|
98
|
+
statusOnSuccess: z.ZodString;
|
|
99
|
+
statusOnFailure: z.ZodString;
|
|
100
|
+
salesChannelIds: z.ZodArray<z.ZodString>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export type PaymentMethodAdmin = z.infer<typeof paymentMethodAdminSchema>;
|
|
103
|
+
/**
|
|
104
|
+
* Why a method can — or cannot — be offered to a buyer (issue #96).
|
|
105
|
+
*
|
|
106
|
+
* A payment method is realised by an adapter, and an adapter is contributed by
|
|
107
|
+
* a module. When that module is absent on either axis the method disappears
|
|
108
|
+
* from cart and checkout entirely, because a buyer must never be shown a
|
|
109
|
+
* payment option that cannot take their money. The *admin* keeps seeing the
|
|
110
|
+
* row — off is not uninstall — so it needs the reason, and the reason is the
|
|
111
|
+
* owning module's presence, carried verbatim rather than restated: an admin
|
|
112
|
+
* that renders `/platform/modules` can render this without learning a second
|
|
113
|
+
* vocabulary.
|
|
114
|
+
*
|
|
115
|
+
* `ownerModule` is `null` when no module contributes the method's adapter at
|
|
116
|
+
* all (a legacy row, or a module removed from the deployment); `ownerPresence`
|
|
117
|
+
* is then `null` too, and `available` is false.
|
|
118
|
+
*/
|
|
119
|
+
export declare const paymentMethodAvailabilitySchema: z.ZodObject<{
|
|
120
|
+
ownerModule: z.ZodNullable<z.ZodString>;
|
|
121
|
+
available: z.ZodBoolean;
|
|
122
|
+
ownerPresence: z.ZodNullable<z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
present: z.ZodBoolean;
|
|
125
|
+
platformState: z.ZodUnion<[z.ZodEnum<{
|
|
126
|
+
installing: "installing";
|
|
127
|
+
installed: "installed";
|
|
128
|
+
disabled: "disabled";
|
|
129
|
+
uninstalled: "uninstalled";
|
|
130
|
+
}>, z.ZodLiteral<"not-installed">]>;
|
|
131
|
+
activated: z.ZodBoolean;
|
|
132
|
+
deactivatable: z.ZodBoolean;
|
|
133
|
+
nonDeactivatableReason: z.ZodNullable<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
export type PaymentMethodAvailability = z.infer<typeof paymentMethodAvailabilitySchema>;
|
|
137
|
+
/** One row of the admin payment-method list: the stored config plus its availability. */
|
|
138
|
+
export declare const paymentMethodAdminListItemSchema: z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
code: z.ZodString;
|
|
141
|
+
adapter: z.ZodString;
|
|
142
|
+
kind: z.ZodEnum<{
|
|
143
|
+
bank_transfer: "bank_transfer";
|
|
144
|
+
pickup: "pickup";
|
|
145
|
+
credit_limit: "credit_limit";
|
|
146
|
+
gateway: "gateway";
|
|
147
|
+
}>;
|
|
148
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
149
|
+
status: z.ZodEnum<{
|
|
150
|
+
active: "active";
|
|
151
|
+
inactive: "inactive";
|
|
152
|
+
}>;
|
|
153
|
+
additionalPrice: z.ZodNumber;
|
|
154
|
+
statusOnPending: z.ZodString;
|
|
155
|
+
statusOnSuccess: z.ZodString;
|
|
156
|
+
statusOnFailure: z.ZodString;
|
|
157
|
+
salesChannelIds: z.ZodArray<z.ZodString>;
|
|
158
|
+
rendererKey: z.ZodNullable<z.ZodString>;
|
|
159
|
+
availability: z.ZodObject<{
|
|
160
|
+
ownerModule: z.ZodNullable<z.ZodString>;
|
|
161
|
+
available: z.ZodBoolean;
|
|
162
|
+
ownerPresence: z.ZodNullable<z.ZodObject<{
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
present: z.ZodBoolean;
|
|
165
|
+
platformState: z.ZodUnion<[z.ZodEnum<{
|
|
166
|
+
installing: "installing";
|
|
167
|
+
installed: "installed";
|
|
168
|
+
disabled: "disabled";
|
|
169
|
+
uninstalled: "uninstalled";
|
|
170
|
+
}>, z.ZodLiteral<"not-installed">]>;
|
|
171
|
+
activated: z.ZodBoolean;
|
|
172
|
+
deactivatable: z.ZodBoolean;
|
|
173
|
+
nonDeactivatableReason: z.ZodNullable<z.ZodString>;
|
|
174
|
+
}, z.core.$strip>>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export type PaymentMethodAdminListItem = z.infer<typeof paymentMethodAdminListItemSchema>;
|
|
178
|
+
/** Storefront list item — what checkout needs to render an eligible method. */
|
|
179
|
+
export declare const paymentMethodListItemSchema: z.ZodObject<{
|
|
180
|
+
id: z.ZodString;
|
|
181
|
+
code: z.ZodString;
|
|
182
|
+
adapter: z.ZodString;
|
|
183
|
+
kind: z.ZodEnum<{
|
|
184
|
+
bank_transfer: "bank_transfer";
|
|
185
|
+
pickup: "pickup";
|
|
186
|
+
credit_limit: "credit_limit";
|
|
187
|
+
gateway: "gateway";
|
|
188
|
+
}>;
|
|
189
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
190
|
+
additionalPrice: z.ZodNumber;
|
|
191
|
+
rendererKey: z.ZodNullable<z.ZodString>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
export type PaymentMethodListItem = z.infer<typeof paymentMethodListItemSchema>;
|
|
194
|
+
/** `receive_payment` ingress payload (FR-022). */
|
|
195
|
+
export declare const receivePaymentSchema: z.ZodObject<{
|
|
196
|
+
providerDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
197
|
+
paymentId: z.ZodOptional<z.ZodString>;
|
|
198
|
+
orderId: z.ZodOptional<z.ZodString>;
|
|
199
|
+
externalReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
200
|
+
outcome: z.ZodEnum<{
|
|
201
|
+
success: "success";
|
|
202
|
+
failure: "failure";
|
|
203
|
+
}>;
|
|
204
|
+
failureReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type ReceivePayment = z.infer<typeof receivePaymentSchema>;
|
|
207
|
+
/**
|
|
208
|
+
* What an **operator** may write into `payments.provider_details`.
|
|
209
|
+
*
|
|
210
|
+
* That column is a JSON bag, and `POST /api/v1/payments/receive` is one of the
|
|
211
|
+
* paths that fills it — the caller-supplied one. It took
|
|
212
|
+
* `z.record(z.string(), z.unknown())` and persisted the result verbatim, which
|
|
213
|
+
* is the caller deciding what the platform stores: any JSON document, of any
|
|
214
|
+
* depth and any size, echoed back in full by
|
|
215
|
+
* `GET /api/v1/admin/orders/:id/payments`. What we persist there has to be
|
|
216
|
+
* bounded by our schema rather than by somebody else's.
|
|
217
|
+
*
|
|
218
|
+
* A flat map of scalars is the bound, not a named field set, and the reason is
|
|
219
|
+
* that the column has several authors. The key vocabulary belongs to whichever
|
|
220
|
+
* adapter wrote the row — `refundedAt` and `refundReference` are the two the
|
|
221
|
+
* platform itself reads back — so enumerating keys here would be this route
|
|
222
|
+
* claiming an ownership it does not have. What it can refuse is the part that
|
|
223
|
+
* makes an unbounded bag dangerous: arbitrary nesting, unbounded strings and an
|
|
224
|
+
* unbounded number of entries. An operator settling an offline payment by hand
|
|
225
|
+
* records a bank statement line or a reference, which this admits.
|
|
226
|
+
*
|
|
227
|
+
* The bound is on the route body only. The gateway modules build `ReceivePayment`
|
|
228
|
+
* in code with their own shapes, including nested ones, and bounding *their*
|
|
229
|
+
* writes is a different repair with a different owner.
|
|
230
|
+
*/
|
|
231
|
+
export declare const operatorProviderDetailsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
232
|
+
export type OperatorProviderDetails = z.infer<typeof operatorProviderDetailsSchema>;
|
|
233
|
+
/**
|
|
234
|
+
* The body of `POST /api/v1/payments/receive` — `receivePaymentSchema` with the
|
|
235
|
+
* operator's bound on `providerDetails`. Its output is assignable to
|
|
236
|
+
* `ReceivePayment`, so the handler is unchanged.
|
|
237
|
+
*/
|
|
238
|
+
export declare const receivePaymentRequestSchema: z.ZodObject<{
|
|
239
|
+
providerDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
240
|
+
paymentId: z.ZodOptional<z.ZodString>;
|
|
241
|
+
orderId: z.ZodOptional<z.ZodString>;
|
|
242
|
+
externalReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
243
|
+
outcome: z.ZodEnum<{
|
|
244
|
+
success: "success";
|
|
245
|
+
failure: "failure";
|
|
246
|
+
}>;
|
|
247
|
+
failureReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
export type ReceivePaymentRequest = z.infer<typeof receivePaymentRequestSchema>;
|
|
250
|
+
export type PaymentSurface = 'storefront' | 'admin' | 'api';
|
|
251
|
+
export interface PaymentEligibilityContext {
|
|
252
|
+
paymentMethod: PaymentMethodAdmin;
|
|
253
|
+
/**
|
|
254
|
+
* The channel the buyer is on, or `null` when none is resolved — a checkout
|
|
255
|
+
* reached without a channel, an admin-created order, a direct API submission.
|
|
256
|
+
*
|
|
257
|
+
* Widened from `string` (issue #103): the narrower type left a caller with no
|
|
258
|
+
* way to say "there is no channel", so `''` was passed instead, and an empty
|
|
259
|
+
* string is not a spelling of platform-wide — it is rejected by the settings
|
|
260
|
+
* seam guard, which made every adapter that reads its own configuration
|
|
261
|
+
* answer "not eligible". An adapter must treat `null` as the platform-wide
|
|
262
|
+
* tier (or resolve the system-default channel), never as "match nothing".
|
|
263
|
+
*/
|
|
264
|
+
salesChannelId: string | null;
|
|
265
|
+
organizationId: string | null;
|
|
266
|
+
customerAccountId: string | null;
|
|
267
|
+
surface: PaymentSurface;
|
|
268
|
+
/** Present at storefront checkout; opaque to the contract. */
|
|
269
|
+
cartSnapshot?: unknown;
|
|
270
|
+
}
|
|
271
|
+
export type StartPaymentResult = {
|
|
272
|
+
kind: 'awaiting_transfer';
|
|
273
|
+
iban: string | null;
|
|
274
|
+
reference: string;
|
|
275
|
+
} | {
|
|
276
|
+
kind: 'redirect';
|
|
277
|
+
url: string;
|
|
278
|
+
} | {
|
|
279
|
+
kind: 'none';
|
|
280
|
+
};
|
|
281
|
+
export interface ReceivePaymentContext {
|
|
282
|
+
orderId: string;
|
|
283
|
+
paymentId: string;
|
|
284
|
+
externalReference?: string | null;
|
|
285
|
+
providerDetails?: Record<string, unknown>;
|
|
286
|
+
}
|
|
287
|
+
export type PaymentOutcome = {
|
|
288
|
+
result: 'success';
|
|
289
|
+
externalReference?: string | null;
|
|
290
|
+
providerDetails?: Record<string, unknown>;
|
|
291
|
+
} | {
|
|
292
|
+
result: 'failure';
|
|
293
|
+
failureReason: string;
|
|
294
|
+
providerDetails?: Record<string, unknown>;
|
|
295
|
+
};
|
|
296
|
+
export interface PaymentAdapter {
|
|
297
|
+
readonly adapterKey: string;
|
|
298
|
+
readonly type: PaymentAdapterType;
|
|
299
|
+
validateUseOnStorefront(ctx: PaymentEligibilityContext): Promise<boolean>;
|
|
300
|
+
validateUseOnAdmin(ctx: PaymentEligibilityContext): Promise<boolean>;
|
|
301
|
+
validateUseInApi(ctx: PaymentEligibilityContext): Promise<boolean>;
|
|
302
|
+
onStorefrontOrderCreated(ctx: {
|
|
303
|
+
orderId: string;
|
|
304
|
+
paymentId: string;
|
|
305
|
+
amount: number;
|
|
306
|
+
currency: string;
|
|
307
|
+
/**
|
|
308
|
+
* Preferred over a DB reload: place-order runs inside a transaction, so a
|
|
309
|
+
* forked EM often cannot see the just-flushed Payment/Order rows yet.
|
|
310
|
+
*/
|
|
311
|
+
paymentMethodCode?: string;
|
|
312
|
+
paymentMethodId?: string;
|
|
313
|
+
salesChannelId?: string | null;
|
|
314
|
+
/** Buyer identity for gateway create (TPay requires payer.email + payer.name). */
|
|
315
|
+
payerEmail?: string | null;
|
|
316
|
+
payerName?: string | null;
|
|
317
|
+
billingCountry?: string | null;
|
|
318
|
+
orderBusinessId?: string | null;
|
|
319
|
+
}): Promise<StartPaymentResult>;
|
|
320
|
+
onReceivePayment(ctx: ReceivePaymentContext): Promise<PaymentOutcome>;
|
|
321
|
+
/** Optional renderer keys; absent ⇒ the default fallback renderer is used. */
|
|
322
|
+
readonly renderers?: {
|
|
323
|
+
storefront?: string;
|
|
324
|
+
admin?: string;
|
|
325
|
+
email?: string;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* A payment method as it crosses a module boundary — a plain shape, never the
|
|
330
|
+
* ORM entity (FR-011).
|
|
331
|
+
*
|
|
332
|
+
* `additionalPrice` stays a string: it is `decimal(14,2)` and lands in an
|
|
333
|
+
* order's `paymentMethodSnapshot`, where the figure has to survive verbatim.
|
|
334
|
+
*
|
|
335
|
+
* The three `statusOn…` fields name **order statuses**, which are
|
|
336
|
+
* admin-configurable, so they are `string` rather than a union — see
|
|
337
|
+
* `OrderStatusRegistry` below for what validates them.
|
|
338
|
+
*/
|
|
339
|
+
export interface PaymentMethodRecord {
|
|
340
|
+
id: string;
|
|
341
|
+
code: string;
|
|
342
|
+
name: Record<string, string>;
|
|
343
|
+
kind: PaymentMethodKind;
|
|
344
|
+
/** The adapter registry key this method settles through. */
|
|
345
|
+
adapter: string;
|
|
346
|
+
status: 'active' | 'inactive';
|
|
347
|
+
additionalPrice: string;
|
|
348
|
+
statusOnPending: string;
|
|
349
|
+
statusOnSuccess: string;
|
|
350
|
+
statusOnFailure: string;
|
|
351
|
+
createdAt: Date;
|
|
352
|
+
updatedAt: Date;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Container name: `paymentMethodReadPort`. Owner: `payment_methods`.
|
|
356
|
+
*
|
|
357
|
+
* Nineteen of this module's 33 inbound sites are `em.findOne(PaymentMethod, …)`
|
|
358
|
+
* — four gateways resolving the method behind a payment, `orders` resolving it
|
|
359
|
+
* at placement, `quick_order` resolving a buyer's default, and `payments`
|
|
360
|
+
* mapping an outcome onto an order status.
|
|
361
|
+
*
|
|
362
|
+
* `listActive` exists because two of those callers filter on
|
|
363
|
+
* `status: 'active'` and two do not, and which of the two is right depends on
|
|
364
|
+
* whether the read is a catalogue (active only) or a settlement of an order
|
|
365
|
+
* placed earlier (any, or a paid order stops being explicable the day an
|
|
366
|
+
* operator retires a method).
|
|
367
|
+
*
|
|
368
|
+
* **Owner off:** the seam fails closed — resolving this port throws
|
|
369
|
+
* `ModuleDisabledError` and the call answers 503 `MODULE_DISABLED`, so nothing
|
|
370
|
+
* half-executes. Whether `payment_methods` has an off state at all is its manifest's
|
|
371
|
+
* `activation` to say, not this line's: a module declaring
|
|
372
|
+
* `nonDeactivatable` never enters one.
|
|
373
|
+
*/
|
|
374
|
+
export interface PaymentMethodReadPort {
|
|
375
|
+
findById(id: string): Promise<PaymentMethodRecord | null>;
|
|
376
|
+
findByIds(ids: readonly string[]): Promise<PaymentMethodRecord[]>;
|
|
377
|
+
findByCode(code: string): Promise<PaymentMethodRecord | null>;
|
|
378
|
+
/** Every method, ordered by code — the admin catalogue and the export adapter. */
|
|
379
|
+
listAll(): Promise<PaymentMethodRecord[]>;
|
|
380
|
+
/** Only `status === 'active'`, ordered by code — the buyer-facing catalogue. */
|
|
381
|
+
listActive(): Promise<PaymentMethodRecord[]>;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Container name: `paymentAdapterRegistry`. Owner: `payment_methods`.
|
|
385
|
+
*
|
|
386
|
+
* A **contribution seam**: the four gateway modules push their adapter in from
|
|
387
|
+
* their boot hook and this module's catalogue reads the table. Every edge into
|
|
388
|
+
* it classifies as `contributes`, and publishing the shape must not change
|
|
389
|
+
* that.
|
|
390
|
+
*
|
|
391
|
+
* **Three members, which is the measured cross-module demand** (D-98.4).
|
|
392
|
+
* `register` names its contributor and is the extension point: a deployment's
|
|
393
|
+
* own gateway module contributes exactly as `tpay`, `stripe`, `payu`, `autopay`
|
|
394
|
+
* and `payments`' built-ins do. `get` and `ownerOf` are the two reads `orders`
|
|
395
|
+
* makes. `get` filters on the contributor's effective state and **returns
|
|
396
|
+
* `undefined` when the key is unregistered or its owner is absent** — one
|
|
397
|
+
* answer for both, which is what a cross-module caller has to handle — while
|
|
398
|
+
* `ownerOf` deliberately does not filter, because an admin screen has to keep
|
|
399
|
+
* showing a method *and* the reason it is unavailable. That sentence is why
|
|
400
|
+
* `ownerOf` is published at all.
|
|
401
|
+
*
|
|
402
|
+
* **The enumeration and throwing-resolution halves are the owner's own**, and
|
|
403
|
+
* this says so rather than leaving them to be restored as an oversight.
|
|
404
|
+
* `list` and `isAvailable` are how the catalogue decides what a buyer may pick;
|
|
405
|
+
* `listAll` is how the admin screen shows a method whose gateway is off;
|
|
406
|
+
* `isRegistered` is `payment_methods`' own route guard; `resolve` is the
|
|
407
|
+
* throwing twin `get` exists to avoid across a boundary. They are correct
|
|
408
|
+
* methods on a correct class — which keeps all nine and keeps `implements` —
|
|
409
|
+
* and a cross-module caller gets `get` and handles `undefined`. `unregister` is
|
|
410
|
+
* the same and stronger: withdrawing another module's contribution is the
|
|
411
|
+
* deactivation axis wearing a method name. (`entry` is on the class too and
|
|
412
|
+
* never was on this interface.)
|
|
413
|
+
*
|
|
414
|
+
* A member returns here when a cross-module caller can be quoted for it with
|
|
415
|
+
* `file:line` — the standard D-98.4 sets for every widening, not just this one.
|
|
416
|
+
*
|
|
417
|
+
* **Owner off:** nothing throws here. This is a **contribution seam**, a plain
|
|
418
|
+
* `di.register` rather than a `providePort`, so a push still lands and
|
|
419
|
+
* `payment_methods` filters by contributor when it enumerates. Converting it to
|
|
420
|
+
* `providePort` would move every edge into it from `contributes` to
|
|
421
|
+
* `fails-closed` in the deactivation-consequence ledger, and change the
|
|
422
|
+
* sentence the operator's confirmation dialog renders.
|
|
423
|
+
*/
|
|
424
|
+
export interface PaymentAdapterRegistryPort {
|
|
425
|
+
/** Contribute an adapter, naming the module it belongs to. */
|
|
426
|
+
register(adapter: PaymentAdapter, module: string): void;
|
|
427
|
+
/** The adapter, or `undefined` when unregistered or its owner is absent. */
|
|
428
|
+
get(adapterKey: string): PaymentAdapter | undefined;
|
|
429
|
+
/** Which module contributed the key, or `null` when nobody did. */
|
|
430
|
+
ownerOf(adapterKey: string): string | null;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Container name: `paymentOrderStatusRegistry`. Owner: `payment_methods`.
|
|
434
|
+
* Container name: `shippingOrderStatusRegistry`. Owner: `delivery_methods`.
|
|
435
|
+
*
|
|
436
|
+
* **One shape, two providers, and that is why the type is declared once.** Both
|
|
437
|
+
* modules map an outcome onto an order status, and each registers its own
|
|
438
|
+
* `EnumOrderStatusRegistry` under its own container name; the interface was
|
|
439
|
+
* declared twice, in the same words, until feature 075's Phase P moved it here.
|
|
440
|
+
* A consumer resolves whichever of the two names belongs to the outcome it is
|
|
441
|
+
* mapping — `payments` the payment one, `shipments` the shipping one — and
|
|
442
|
+
* neither name is a substitute for the other.
|
|
443
|
+
*
|
|
444
|
+
* `statusOnPending` / `statusOnSuccess` / `statusOnFailure` on a payment method
|
|
445
|
+
* reference *order statuses*. This port answers which codes are nameable, and
|
|
446
|
+
* consumers depend only on it — so the eventual admin-configurable registry
|
|
447
|
+
* drops in with no change here.
|
|
448
|
+
*
|
|
449
|
+
* It deliberately does not touch the order: applying a status is done by the
|
|
450
|
+
* caller, which already owns it (Principle I).
|
|
451
|
+
*
|
|
452
|
+
* **The absent-owner policy is honour, and the reason is that there is nothing
|
|
453
|
+
* to skip** (issue #129). The option set is fixed at compile time, so the
|
|
454
|
+
* registry holds no per-contributor state an operator's flip could invalidate.
|
|
455
|
+
* The reads are guards, not surfaces: `payments` asks `has` before moving an
|
|
456
|
+
* order into the status a settled payment names, so a skip would silently
|
|
457
|
+
* leave a paid order in its old status and a throw would make a PSP webhook
|
|
458
|
+
* retry forever. A status a live order is in has to stay nameable while the
|
|
459
|
+
* module holding the table is off. `shipments` reads the shipping name the
|
|
460
|
+
* same way and for the same reason, which is why **both** registrations are
|
|
461
|
+
* ordinary `ctx.di.register` calls rather than gated ports: publication says
|
|
462
|
+
* what the name promises, not whether a gate stands in front of it.
|
|
463
|
+
*/
|
|
464
|
+
export interface OrderStatusRegistry {
|
|
465
|
+
/** The selectable order-status options (code + human label). */
|
|
466
|
+
list(): OrderStatusOption[];
|
|
467
|
+
/** True when `code` is a known order status. */
|
|
468
|
+
has(code: string): boolean;
|
|
469
|
+
/** Throws when `code` is not a known order status. */
|
|
470
|
+
assertValid(code: string): void;
|
|
471
|
+
}
|
|
472
|
+
//# sourceMappingURL=payment-methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-methods.d.ts","sourceRoot":"","sources":["../src/payment-methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEhF;;;;;;;GAOG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB;;;;;EAA0B,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,uCAEwD,CAAC;AAC7F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;iBAWpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,K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IAAI,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,mBAAmB;IAClC,gEAAgE;IAChE,IAAI,IAAI,iBAAiB,EAAE,CAAC;IAC5B,gDAAgD;IAChD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,sDAAsD;IACtD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { uuidSchema } from './common.js';
|
|
3
|
+
import { ModulePresenceSchema } from './modules.js';
|
|
4
|
+
import { paymentMethodKindSchema } from './payments.js';
|
|
5
|
+
/**
|
|
6
|
+
* Payment Method adapter framework (feature 034 — Metoda Płatności).
|
|
7
|
+
*
|
|
8
|
+
* Source-of-truth schemas for the admin-managed payment-method entry and the
|
|
9
|
+
* adapter ingress, plus the behavioural `PaymentAdapter` contract a module
|
|
10
|
+
* implements to act as a payment method. The adapter `type` mirrors the
|
|
11
|
+
* existing `PaymentMethod.kind`.
|
|
12
|
+
*/
|
|
13
|
+
/** Adapter type — kept aligned with the existing `PaymentMethod.kind`. */
|
|
14
|
+
export const paymentAdapterTypeSchema = paymentMethodKindSchema;
|
|
15
|
+
/**
|
|
16
|
+
* Localised name: a non-empty record of `lang → label`. A surface in language
|
|
17
|
+
* `xx` uses `name[xx]` when present; otherwise the `default` key, otherwise the
|
|
18
|
+
* first available value (see the backend name-resolver). Kept as an open record
|
|
19
|
+
* for compatibility with the existing locale-keyed payloads (`en-US`, `pl-PL`).
|
|
20
|
+
*/
|
|
21
|
+
export const paymentMethodNameSchema = z
|
|
22
|
+
.record(z.string(), z.string().min(1))
|
|
23
|
+
.refine((r) => Object.keys(r).length > 0, { message: 'name requires at least one entry' });
|
|
24
|
+
/** One selectable Order-status option (from the OrderStatusRegistry port). */
|
|
25
|
+
export const orderStatusOptionSchema = z.object({
|
|
26
|
+
code: z.string().min(1).max(64),
|
|
27
|
+
label: z.string().min(1),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Admin upsert body for a payment-method entry. `kind` is required (the core
|
|
31
|
+
* discriminator); `adapter` defaults to `kind` and `statusOn*` to the seed
|
|
32
|
+
* order statuses when omitted — keeping the pre-feature-034 payload
|
|
33
|
+
* (`{ code, name, kind }`) valid while letting the richer admin form send the
|
|
34
|
+
* full configuration.
|
|
35
|
+
*/
|
|
36
|
+
export const paymentMethodUpsertSchema = z.object({
|
|
37
|
+
code: z.string().min(1).max(64).optional(),
|
|
38
|
+
name: paymentMethodNameSchema,
|
|
39
|
+
kind: paymentAdapterTypeSchema,
|
|
40
|
+
adapter: z.string().min(1).max(64).optional(),
|
|
41
|
+
additionalPrice: z.number().finite().nonnegative().optional(),
|
|
42
|
+
status: z.enum(['active', 'inactive']).optional(),
|
|
43
|
+
statusOnPending: z.string().min(1).max(64).optional(),
|
|
44
|
+
statusOnSuccess: z.string().min(1).max(64).optional(),
|
|
45
|
+
statusOnFailure: z.string().min(1).max(64).optional(),
|
|
46
|
+
salesChannelIds: z.array(uuidSchema).optional(),
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Whether the method is offered to buyers — feature 076, D-82.
|
|
50
|
+
*
|
|
51
|
+
* Its own body, because it is its own operation. `paymentMethodUpsertSchema`
|
|
52
|
+
* requires `name` and `kind`, so a toggle expressed through the `PUT` would
|
|
53
|
+
* have to resend the whole record, and a stale client that did would clobber a
|
|
54
|
+
* concurrent edit of fields it never meant to touch.
|
|
55
|
+
*
|
|
56
|
+
* `status` stays on the upsert as well: a full edit that happens to include
|
|
57
|
+
* availability is one legitimate operation, and removing it there would force
|
|
58
|
+
* two round trips for one form.
|
|
59
|
+
*/
|
|
60
|
+
export const paymentMethodStatusPatchSchema = z.object({
|
|
61
|
+
status: z.enum(['active', 'inactive']),
|
|
62
|
+
});
|
|
63
|
+
/** Admin detail (full config) response. */
|
|
64
|
+
export const paymentMethodAdminSchema = z.object({
|
|
65
|
+
id: uuidSchema,
|
|
66
|
+
code: z.string(),
|
|
67
|
+
adapter: z.string(),
|
|
68
|
+
kind: paymentAdapterTypeSchema,
|
|
69
|
+
name: paymentMethodNameSchema,
|
|
70
|
+
status: z.enum(['active', 'inactive']),
|
|
71
|
+
additionalPrice: z.number(),
|
|
72
|
+
statusOnPending: z.string(),
|
|
73
|
+
statusOnSuccess: z.string(),
|
|
74
|
+
statusOnFailure: z.string(),
|
|
75
|
+
salesChannelIds: z.array(uuidSchema),
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Why a method can — or cannot — be offered to a buyer (issue #96).
|
|
79
|
+
*
|
|
80
|
+
* A payment method is realised by an adapter, and an adapter is contributed by
|
|
81
|
+
* a module. When that module is absent on either axis the method disappears
|
|
82
|
+
* from cart and checkout entirely, because a buyer must never be shown a
|
|
83
|
+
* payment option that cannot take their money. The *admin* keeps seeing the
|
|
84
|
+
* row — off is not uninstall — so it needs the reason, and the reason is the
|
|
85
|
+
* owning module's presence, carried verbatim rather than restated: an admin
|
|
86
|
+
* that renders `/platform/modules` can render this without learning a second
|
|
87
|
+
* vocabulary.
|
|
88
|
+
*
|
|
89
|
+
* `ownerModule` is `null` when no module contributes the method's adapter at
|
|
90
|
+
* all (a legacy row, or a module removed from the deployment); `ownerPresence`
|
|
91
|
+
* is then `null` too, and `available` is false.
|
|
92
|
+
*/
|
|
93
|
+
export const paymentMethodAvailabilitySchema = z.object({
|
|
94
|
+
ownerModule: z.string().nullable(),
|
|
95
|
+
/** Registered AND its owning module effectively present. */
|
|
96
|
+
available: z.boolean(),
|
|
97
|
+
ownerPresence: ModulePresenceSchema.nullable(),
|
|
98
|
+
});
|
|
99
|
+
/** One row of the admin payment-method list: the stored config plus its availability. */
|
|
100
|
+
export const paymentMethodAdminListItemSchema = paymentMethodAdminSchema.extend({
|
|
101
|
+
rendererKey: z.string().nullable(),
|
|
102
|
+
availability: paymentMethodAvailabilitySchema,
|
|
103
|
+
});
|
|
104
|
+
/** Storefront list item — what checkout needs to render an eligible method. */
|
|
105
|
+
export const paymentMethodListItemSchema = z.object({
|
|
106
|
+
id: uuidSchema,
|
|
107
|
+
code: z.string(),
|
|
108
|
+
adapter: z.string(),
|
|
109
|
+
kind: paymentAdapterTypeSchema,
|
|
110
|
+
name: paymentMethodNameSchema,
|
|
111
|
+
additionalPrice: z.number(),
|
|
112
|
+
rendererKey: z.string().nullable(),
|
|
113
|
+
});
|
|
114
|
+
/**
|
|
115
|
+
* The fields a settlement carries whichever door it arrives through. Split out
|
|
116
|
+
* so the operator's HTTP body and the gateway modules' in-code payload differ
|
|
117
|
+
* in exactly one place — `providerDetails` — and cannot drift anywhere else.
|
|
118
|
+
*/
|
|
119
|
+
const receivePaymentBaseShape = {
|
|
120
|
+
paymentId: uuidSchema.optional(),
|
|
121
|
+
orderId: uuidSchema.optional(),
|
|
122
|
+
externalReference: z.string().max(255).nullish(),
|
|
123
|
+
outcome: z.enum(['success', 'failure']),
|
|
124
|
+
failureReason: z.string().max(2000).nullish(),
|
|
125
|
+
};
|
|
126
|
+
const RECEIVE_PAYMENT_IDENTIFIER_MESSAGE = 'paymentId or (orderId + externalReference) is required';
|
|
127
|
+
const hasReceivePaymentIdentifier = (d) => Boolean(d.paymentId) || Boolean(d.orderId && d.externalReference);
|
|
128
|
+
/** `receive_payment` ingress payload (FR-022). */
|
|
129
|
+
export const receivePaymentSchema = z
|
|
130
|
+
.object({
|
|
131
|
+
...receivePaymentBaseShape,
|
|
132
|
+
providerDetails: z.record(z.string(), z.unknown()).optional(),
|
|
133
|
+
})
|
|
134
|
+
.refine(hasReceivePaymentIdentifier, { message: RECEIVE_PAYMENT_IDENTIFIER_MESSAGE });
|
|
135
|
+
/**
|
|
136
|
+
* What an **operator** may write into `payments.provider_details`.
|
|
137
|
+
*
|
|
138
|
+
* That column is a JSON bag, and `POST /api/v1/payments/receive` is one of the
|
|
139
|
+
* paths that fills it — the caller-supplied one. It took
|
|
140
|
+
* `z.record(z.string(), z.unknown())` and persisted the result verbatim, which
|
|
141
|
+
* is the caller deciding what the platform stores: any JSON document, of any
|
|
142
|
+
* depth and any size, echoed back in full by
|
|
143
|
+
* `GET /api/v1/admin/orders/:id/payments`. What we persist there has to be
|
|
144
|
+
* bounded by our schema rather than by somebody else's.
|
|
145
|
+
*
|
|
146
|
+
* A flat map of scalars is the bound, not a named field set, and the reason is
|
|
147
|
+
* that the column has several authors. The key vocabulary belongs to whichever
|
|
148
|
+
* adapter wrote the row — `refundedAt` and `refundReference` are the two the
|
|
149
|
+
* platform itself reads back — so enumerating keys here would be this route
|
|
150
|
+
* claiming an ownership it does not have. What it can refuse is the part that
|
|
151
|
+
* makes an unbounded bag dangerous: arbitrary nesting, unbounded strings and an
|
|
152
|
+
* unbounded number of entries. An operator settling an offline payment by hand
|
|
153
|
+
* records a bank statement line or a reference, which this admits.
|
|
154
|
+
*
|
|
155
|
+
* The bound is on the route body only. The gateway modules build `ReceivePayment`
|
|
156
|
+
* in code with their own shapes, including nested ones, and bounding *their*
|
|
157
|
+
* writes is a different repair with a different owner.
|
|
158
|
+
*/
|
|
159
|
+
export const operatorProviderDetailsSchema = z
|
|
160
|
+
.record(z.string().min(1).max(64), z.union([z.string().max(1000), z.number().finite(), z.boolean(), z.null()]))
|
|
161
|
+
.refine((details) => Object.keys(details).length <= 50, {
|
|
162
|
+
message: 'providerDetails may carry at most 50 entries',
|
|
163
|
+
});
|
|
164
|
+
/**
|
|
165
|
+
* The body of `POST /api/v1/payments/receive` — `receivePaymentSchema` with the
|
|
166
|
+
* operator's bound on `providerDetails`. Its output is assignable to
|
|
167
|
+
* `ReceivePayment`, so the handler is unchanged.
|
|
168
|
+
*/
|
|
169
|
+
export const receivePaymentRequestSchema = z
|
|
170
|
+
.object({
|
|
171
|
+
...receivePaymentBaseShape,
|
|
172
|
+
providerDetails: operatorProviderDetailsSchema.optional(),
|
|
173
|
+
})
|
|
174
|
+
.refine(hasReceivePaymentIdentifier, { message: RECEIVE_PAYMENT_IDENTIFIER_MESSAGE });
|
|
175
|
+
//# sourceMappingURL=payment-methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-methods.js","sourceRoot":"","sources":["../src/payment-methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAA0B,MAAM,eAAe,CAAC;AAEhF;;;;;;;GAOG;AAEH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAGhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACrC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC,CAAC;AAG7F,8EAA8E;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,C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