@openlup/platform 0.27.0 → 0.29.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/CHANGELOG.md +386 -127
- package/README.md +251 -9
- package/dist/account-support/accountReadFacade.d.ts +8 -0
- package/dist/account-support/accountReadFacade.js +10 -0
- package/dist/account-support/accountReadModels.d.ts +69 -0
- package/dist/account-support/accountReadModels.js +272 -0
- package/dist/account-support/bindings.d.ts +23 -0
- package/dist/account-support/bindings.js +16 -0
- package/dist/account-support/contracts/account.d.ts +281 -0
- package/dist/account-support/contracts/account.js +1 -0
- package/dist/account-support/contracts/capabilities.d.ts +44 -0
- package/dist/account-support/contracts/capabilities.js +1 -0
- package/dist/account-support/contracts/commands.d.ts +307 -0
- package/dist/account-support/contracts/commands.js +1 -0
- package/dist/account-support/contracts/customer360.d.ts +154 -0
- package/dist/account-support/contracts/customer360.js +1 -0
- package/dist/account-support/contracts/index.d.ts +10 -0
- package/dist/account-support/contracts/index.js +1 -0
- package/dist/account-support/contracts/invoice.d.ts +79 -0
- package/dist/account-support/contracts/invoice.js +1 -0
- package/dist/account-support/contracts/operator.d.ts +289 -0
- package/dist/account-support/contracts/operator.js +1 -0
- package/dist/account-support/contribution.d.ts +24 -0
- package/dist/account-support/contribution.js +22 -0
- package/dist/account-support/customer360.d.ts +106 -0
- package/dist/account-support/customer360.js +163 -0
- package/dist/account-support/customerAccountReadDiagnostics.d.ts +11 -0
- package/dist/account-support/customerAccountReadDiagnostics.js +71 -0
- package/dist/account-support/index.d.ts +26 -0
- package/dist/account-support/index.js +15 -0
- package/dist/account-support/invoiceAccess.d.ts +57 -0
- package/dist/account-support/invoiceAccess.js +40 -0
- package/dist/account-support/migrations.d.ts +14 -0
- package/dist/account-support/migrations.js +7 -0
- package/dist/account-support/operatorAuthority.d.ts +67 -0
- package/dist/account-support/operatorAuthority.js +379 -0
- package/dist/account-support/operatorRecovery.d.ts +66 -0
- package/dist/account-support/operatorRecovery.js +129 -0
- package/dist/account-support/orderHistory.d.ts +50 -0
- package/dist/account-support/orderHistory.js +188 -0
- package/dist/account-support/paymentMethodComposition.d.ts +5 -0
- package/dist/account-support/paymentMethodComposition.js +4 -0
- package/dist/account-support/postgresOperatorAuthority.d.ts +16 -0
- package/dist/account-support/postgresOperatorAuthority.js +93 -0
- package/dist/account-support/selfService.d.ts +6 -0
- package/dist/account-support/selfService.js +81 -0
- package/dist/account-support/subscriptionCommandCodec.d.ts +10 -0
- package/dist/account-support/subscriptionCommandCodec.js +38 -0
- package/dist/catalog/draftSchemas.d.ts +1 -1
- package/dist/catalog/foundationSchemas.d.ts +3 -3
- package/dist/catalog/resolvedSkuProjection.d.ts +2 -2
- package/dist/catalog/sellableSchemas.d.ts +2 -2
- package/dist/commerce/checkoutCommandSchemas.d.ts +2 -2
- package/dist/commerce/checkoutResumeSchemas.d.ts +6 -6
- package/dist/commerce/checkoutSchemas.d.ts +12 -12
- package/dist/commerce/commerceReturnsPort.d.ts +2 -2
- package/dist/commerce/configuratorIntentSchemas.d.ts +2 -2
- package/dist/commerce/contractPrimitives.d.ts +8 -8
- package/dist/commerce/customerDefaultsSnapshotSchemas.d.ts +4 -4
- package/dist/commerce/model/omsReadModelHelpers.d.ts +4 -4
- package/dist/commerce/offerAvailabilitySchemas.d.ts +1 -1
- package/dist/commerce/oms/omsContractBase.d.ts +15 -15
- package/dist/commerce/oms/omsContractReadAuxSchemas.d.ts +11 -11
- package/dist/commerce/oms/omsContractReadSchemas.d.ts +121 -121
- package/dist/commerce/oms/omsContractRequests.d.ts +13 -13
- package/dist/commerce/oms/omsControlPlane.d.ts +22 -22
- package/dist/commerce/oms/omsFulfillmentContractSchemas.d.ts +12 -12
- package/dist/commerce/oms/omsFulfillmentDebugSchemas.d.ts +12 -12
- package/dist/commerce/orderReviewContracts.d.ts +33 -33
- package/dist/commerce/outboxEventSchemas.d.ts +4 -4
- package/dist/commerce/schemas.d.ts +21 -21
- package/dist/commerce/server/orderReviewHandlers.d.ts +10 -10
- package/dist/communications/consentPurposeRegistry.d.ts +1 -1
- package/dist/communications/newsletterIntegrationContracts.d.ts +8 -8
- package/dist/composition/accountSupportContribution.d.ts +18 -0
- package/dist/composition/accountSupportContribution.js +21 -0
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/index.js +2 -0
- package/dist/composition/marketingContribution.d.ts +21 -0
- package/dist/composition/marketingContribution.js +29 -0
- package/dist/fulfillment/handlerSchemas.d.ts +40 -40
- package/dist/identity/customerContracts.d.ts +2 -2
- package/dist/invoicing/snapshot.d.ts +1 -1
- package/dist/marketing/acquisitionCaseSchemas.d.ts +103 -0
- package/dist/marketing/acquisitionCaseSchemas.js +53 -0
- package/dist/marketing/acquisitionEvidenceSchemas.d.ts +105 -0
- package/dist/marketing/acquisitionEvidenceSchemas.js +55 -0
- package/dist/marketing/analytics/dataLayer.d.ts +18 -0
- package/dist/marketing/analytics/dataLayer.js +111 -0
- package/dist/marketing/analytics/noop.d.ts +9 -0
- package/dist/marketing/analytics/noop.js +8 -0
- package/dist/marketing/analytics/purchaseFacts.d.ts +4 -0
- package/dist/marketing/analytics/purchaseFacts.js +69 -0
- package/dist/marketing/analytics/routePolicy.d.ts +10 -0
- package/dist/marketing/analytics/routePolicy.js +59 -0
- package/dist/marketing/consentEvidence.d.ts +8 -0
- package/dist/marketing/consentEvidence.js +32 -0
- package/dist/marketing/contactLegal.d.ts +14 -0
- package/dist/marketing/contactLegal.js +19 -0
- package/dist/marketing/contracts/acquisition.d.ts +88 -0
- package/dist/marketing/contracts/acquisition.js +1 -0
- package/dist/marketing/contracts/acquisitionPorts.d.ts +49 -0
- package/dist/marketing/contracts/acquisitionPorts.js +1 -0
- package/dist/marketing/contracts/analytics.d.ts +144 -0
- package/dist/marketing/contracts/analytics.js +1 -0
- package/dist/marketing/contracts/contactLegal.d.ts +53 -0
- package/dist/marketing/contracts/contactLegal.js +1 -0
- package/dist/marketing/contracts/index.d.ts +6 -0
- package/dist/marketing/contracts/index.js +1 -0
- package/dist/marketing/contracts/prelaunch.d.ts +39 -0
- package/dist/marketing/contracts/prelaunch.js +1 -0
- package/dist/marketing/index.d.ts +16 -0
- package/dist/marketing/index.js +14 -0
- package/dist/marketing/prelaunchAcquisitionSchemas.d.ts +116 -0
- package/dist/marketing/prelaunchAcquisitionSchemas.js +51 -0
- package/dist/marketing/seo/jsonLd.d.ts +157 -0
- package/dist/marketing/seo/jsonLd.js +127 -0
- package/dist/marketing/seo/metadata.d.ts +41 -0
- package/dist/marketing/seo/metadata.js +36 -0
- package/dist/marketing/seo/serializeJsonLd.d.ts +1 -0
- package/dist/marketing/seo/serializeJsonLd.js +6 -0
- package/dist/marketing/seo/urls.d.ts +14 -0
- package/dist/marketing/seo/urls.js +23 -0
- package/dist/marketing/server/acquisitionCaseDirect.d.ts +4 -0
- package/dist/marketing/server/acquisitionCaseDirect.js +88 -0
- package/dist/marketing/server/acquisitionCaseHandlers.d.ts +28 -0
- package/dist/marketing/server/acquisitionCaseHandlers.js +40 -0
- package/dist/marketing/server/acquisitionCasePorts.d.ts +42 -0
- package/dist/marketing/server/acquisitionCasePorts.js +1 -0
- package/dist/marketing/server/acquisitionEvidenceDirect.d.ts +5 -0
- package/dist/marketing/server/acquisitionEvidenceDirect.js +100 -0
- package/dist/marketing/server/analyticsContext.d.ts +3 -0
- package/dist/marketing/server/analyticsContext.js +65 -0
- package/dist/marketing/server/analyticsContextPorts.d.ts +31 -0
- package/dist/marketing/server/analyticsContextPorts.js +1 -0
- package/dist/marketing/server/bindings.d.ts +14 -0
- package/dist/marketing/server/bindings.js +18 -0
- package/dist/marketing/server/directPorts.d.ts +26 -0
- package/dist/marketing/server/directPorts.js +1 -0
- package/dist/marketing/server/index.d.ts +14 -0
- package/dist/marketing/server/index.js +11 -0
- package/dist/marketing/server/postgres/acquisitionCaseRoutines.d.ts +10 -0
- package/dist/marketing/server/postgres/acquisitionCaseRoutines.js +204 -0
- package/dist/marketing/server/postgres/acquisitionEvidenceRoutines.d.ts +10 -0
- package/dist/marketing/server/postgres/acquisitionEvidenceRoutines.js +107 -0
- package/dist/marketing/server/postgres/index.d.ts +3 -0
- package/dist/marketing/server/postgres/index.js +3 -0
- package/dist/marketing/server/prelaunchAcquisitionDirect.d.ts +4 -0
- package/dist/marketing/server/prelaunchAcquisitionDirect.js +122 -0
- package/dist/marketing/server/privacyContributor.d.ts +66 -0
- package/dist/marketing/server/privacyContributor.js +87 -0
- package/dist/marketing/server/research/adminSurveyResponsesHandler.d.ts +9 -0
- package/dist/marketing/server/research/adminSurveyResponsesHandler.js +53 -0
- package/dist/marketing/server/research/managedSurveyResponseSubmit.d.ts +39 -0
- package/dist/marketing/server/research/managedSurveyResponseSubmit.js +102 -0
- package/dist/marketing/server/research/surveyResponseSubmitHandler.d.ts +8 -0
- package/dist/marketing/server/research/surveyResponseSubmitHandler.js +41 -0
- package/dist/marketing/validation.d.ts +2 -0
- package/dist/marketing/validation.js +3 -0
- package/dist/pricing/acquisitionQuoteBinding.d.ts +1 -1
- package/dist/pricing/catalogFactsSchemas.d.ts +1 -1
- package/dist/pricing/quotePromotionEvidence.d.ts +1 -1
- package/dist/pricing/quoteSchemas.d.ts +56 -56
- package/dist/promotions/adminPromotionCodesContracts.d.ts +30 -30
- package/dist/promotions/adminPromotionsContracts.d.ts +14 -14
- package/package.json +32 -2
- package/release-gates.json +99 -4
- package/sql/20261026120000_account_support_operator_authority.sql +693 -0
- package/src/account-support/accountReadFacade.ts +15 -0
- package/src/account-support/accountReadModels.ts +371 -0
- package/src/account-support/bindings.ts +28 -0
- package/src/account-support/contracts/account.ts +306 -0
- package/src/account-support/contracts/capabilities.ts +30 -0
- package/src/account-support/contracts/commands.ts +243 -0
- package/src/account-support/contracts/customer360.ts +150 -0
- package/src/account-support/contracts/index.ts +141 -0
- package/src/account-support/contracts/invoice.ts +44 -0
- package/src/account-support/contracts/operator.ts +123 -0
- package/src/account-support/contribution.ts +35 -0
- package/src/account-support/customer360.ts +268 -0
- package/src/account-support/customerAccountReadDiagnostics.ts +83 -0
- package/src/account-support/index.ts +72 -0
- package/src/account-support/invoiceAccess.ts +63 -0
- package/src/account-support/migrations.ts +7 -0
- package/src/account-support/operatorAuthority.ts +393 -0
- package/src/account-support/operatorRecovery.ts +136 -0
- package/src/account-support/orderHistory.ts +309 -0
- package/src/account-support/paymentMethodComposition.ts +8 -0
- package/src/account-support/postgresOperatorAuthority.ts +92 -0
- package/src/account-support/selfService.ts +83 -0
- package/src/account-support/subscriptionCommandCodec.ts +48 -0
- package/src/composition/accountSupportContribution.ts +28 -0
- package/src/composition/index.ts +2 -0
- package/src/composition/marketingContribution.ts +37 -0
- package/src/marketing/acquisitionCaseSchemas.ts +75 -0
- package/src/marketing/acquisitionEvidenceSchemas.ts +72 -0
- package/src/marketing/analytics/dataLayer.ts +100 -0
- package/src/marketing/analytics/noop.ts +14 -0
- package/src/marketing/analytics/purchaseFacts.ts +63 -0
- package/src/marketing/analytics/routePolicy.ts +55 -0
- package/src/marketing/consentEvidence.ts +36 -0
- package/src/marketing/contactLegal.ts +22 -0
- package/src/marketing/contracts/acquisition.ts +50 -0
- package/src/marketing/contracts/acquisitionPorts.ts +48 -0
- package/src/marketing/contracts/analytics.ts +88 -0
- package/src/marketing/contracts/contactLegal.ts +41 -0
- package/src/marketing/contracts/index.ts +17 -0
- package/src/marketing/contracts/prelaunch.ts +15 -0
- package/src/marketing/index.ts +16 -0
- package/src/marketing/prelaunchAcquisitionSchemas.ts +64 -0
- package/src/marketing/seo/jsonLd.ts +153 -0
- package/src/marketing/seo/metadata.ts +62 -0
- package/src/marketing/seo/serializeJsonLd.ts +6 -0
- package/src/marketing/seo/urls.ts +34 -0
- package/src/marketing/server/acquisitionCaseDirect.ts +67 -0
- package/src/marketing/server/acquisitionCaseHandlers.ts +57 -0
- package/src/marketing/server/acquisitionCasePorts.ts +42 -0
- package/src/marketing/server/acquisitionEvidenceDirect.ts +76 -0
- package/src/marketing/server/analyticsContext.ts +55 -0
- package/src/marketing/server/analyticsContextPorts.ts +28 -0
- package/src/marketing/server/bindings.ts +27 -0
- package/src/marketing/server/directPorts.ts +27 -0
- package/src/marketing/server/index.ts +14 -0
- package/src/marketing/server/postgres/acquisitionCaseRoutines.ts +218 -0
- package/src/marketing/server/postgres/acquisitionEvidenceRoutines.ts +103 -0
- package/src/marketing/server/postgres/index.ts +3 -0
- package/src/marketing/server/prelaunchAcquisitionDirect.ts +121 -0
- package/src/marketing/server/privacyContributor.ts +123 -0
- package/src/marketing/server/research/adminSurveyResponsesHandler.ts +78 -0
- package/src/marketing/server/research/managedSurveyResponseSubmit.ts +158 -0
- package/src/marketing/server/research/surveyResponseSubmitHandler.ts +57 -0
- package/src/marketing/validation.ts +3 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Contribution, RequiredSchema } from "@openlup/core/readiness";
|
|
2
|
+
/** Describe existing selected marketing callables; never install another executor. */
|
|
3
|
+
export declare function createMarketingContribution(input: {
|
|
4
|
+
version: string;
|
|
5
|
+
requiredSchema: RequiredSchema;
|
|
6
|
+
marketing: Readonly<Record<string, ((...args: never[]) => unknown) | null>>;
|
|
7
|
+
handlers: Contribution["handlers"];
|
|
8
|
+
schedules: Contribution["schedules"];
|
|
9
|
+
routes: Contribution["routes"];
|
|
10
|
+
}): {
|
|
11
|
+
contributions: Contribution[];
|
|
12
|
+
ports: {
|
|
13
|
+
[k: string]: ((...args: never[]) => unknown) | null;
|
|
14
|
+
};
|
|
15
|
+
routes: {
|
|
16
|
+
[k: string]: (...args: never[]) => unknown;
|
|
17
|
+
};
|
|
18
|
+
triggers: {
|
|
19
|
+
[k: string]: (...args: never[]) => unknown;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Describe existing selected marketing callables; never install another executor. */
|
|
2
|
+
export function createMarketingContribution(input) {
|
|
3
|
+
for (const [kind, names] of [
|
|
4
|
+
["handler", input.handlers.map(handler => handler.eventType)],
|
|
5
|
+
["schedule", input.schedules.map(schedule => schedule.id)],
|
|
6
|
+
["route", input.routes.map(route => route.id)],
|
|
7
|
+
]) {
|
|
8
|
+
if (new Set(names).size !== names.length)
|
|
9
|
+
throw new Error(`marketing_duplicate_${kind}`);
|
|
10
|
+
}
|
|
11
|
+
const contribution = {
|
|
12
|
+
manifest: {
|
|
13
|
+
name: "@openlup/platform", version: input.version, kind: "rail",
|
|
14
|
+
module: { id: "marketing", kind: "capability", provides: ["./marketing", "./marketing/contracts", "./marketing/server"],
|
|
15
|
+
// The server entry validates obligations with identity's runtime contract schema.
|
|
16
|
+
dependsOn: [{ module: "identity", entries: ["./identity/contracts"] }] },
|
|
17
|
+
emits: [], handles: input.handlers.map(handler => handler.eventType),
|
|
18
|
+
schedules: input.schedules.map(({ id, cadenceSeconds }) => ({ id, cadenceSeconds })), env: [],
|
|
19
|
+
requiredPorts: Object.keys(input.marketing), routes: input.routes.map(route => route.id), requiredSchema: input.requiredSchema,
|
|
20
|
+
},
|
|
21
|
+
handlers: input.handlers.map(({ eventType, timeoutMs }) => Object.freeze({ eventType, timeoutMs })), schedules: input.schedules, routes: input.routes,
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
contributions: [contribution],
|
|
25
|
+
ports: Object.fromEntries(Object.entries(input.marketing).filter(([, fn]) => typeof fn === "function").map(([name, fn]) => [`@openlup/platform/marketing:${name}`, fn])),
|
|
26
|
+
routes: Object.fromEntries(input.routes.map(route => [`@openlup/platform/marketing:${route.id}`, route.handle])),
|
|
27
|
+
triggers: Object.fromEntries(input.schedules.map(schedule => [`@openlup/platform/marketing:${schedule.id}`, schedule.run])),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -4,19 +4,19 @@ export declare const COMMERCE_FULFILLMENT_STATUSES: readonly ["created", "packed
|
|
|
4
4
|
export declare const COMMERCE_FULFILLMENT_OPERATION_TYPES: readonly ["created", "packed", "provider_attempt_recorded", "label_created", "handed_over", "tracking_event_recorded", "cancelled"];
|
|
5
5
|
export declare const COMMERCE_FULFILLMENT_PROVIDER_ATTEMPT_STATUSES: readonly ["recorded", "succeeded", "failed"];
|
|
6
6
|
export declare const commerceFulfillmentStatusSchema: z.ZodEnum<{
|
|
7
|
-
created: "created";
|
|
8
7
|
cancelled: "cancelled";
|
|
9
8
|
delivered: "delivered";
|
|
9
|
+
exception: "exception";
|
|
10
|
+
created: "created";
|
|
10
11
|
packed: "packed";
|
|
11
12
|
label_pending: "label_pending";
|
|
12
13
|
label_created: "label_created";
|
|
13
14
|
handed_over: "handed_over";
|
|
14
15
|
in_transit: "in_transit";
|
|
15
|
-
exception: "exception";
|
|
16
16
|
}>;
|
|
17
17
|
export declare const commerceFulfillmentOperationTypeSchema: z.ZodEnum<{
|
|
18
|
-
created: "created";
|
|
19
18
|
cancelled: "cancelled";
|
|
19
|
+
created: "created";
|
|
20
20
|
packed: "packed";
|
|
21
21
|
label_created: "label_created";
|
|
22
22
|
handed_over: "handed_over";
|
|
@@ -29,23 +29,23 @@ export declare const commerceFulfillmentProviderAttemptStatusSchema: z.ZodEnum<{
|
|
|
29
29
|
recorded: "recorded";
|
|
30
30
|
}>;
|
|
31
31
|
export declare const commerceFulfillmentPaymentStatusSchema: z.ZodEnum<{
|
|
32
|
-
|
|
33
|
-
created: "created";
|
|
32
|
+
requires_action: "requires_action";
|
|
34
33
|
failed: "failed";
|
|
35
34
|
cancelled: "cancelled";
|
|
35
|
+
created: "created";
|
|
36
|
+
expired: "expired";
|
|
36
37
|
refunded: "refunded";
|
|
37
38
|
not_started: "not_started";
|
|
38
|
-
requires_action: "requires_action";
|
|
39
39
|
processing: "processing";
|
|
40
40
|
partially_refunded: "partially_refunded";
|
|
41
41
|
disputed: "disputed";
|
|
42
42
|
succeeded: "succeeded";
|
|
43
43
|
}>;
|
|
44
44
|
export declare const commerceFulfillmentInventoryStatusSchema: z.ZodEnum<{
|
|
45
|
+
missing: "missing";
|
|
45
46
|
expired: "expired";
|
|
46
47
|
not_checked: "not_checked";
|
|
47
48
|
reserved: "reserved";
|
|
48
|
-
missing: "missing";
|
|
49
49
|
released: "released";
|
|
50
50
|
consumed: "consumed";
|
|
51
51
|
review_required: "review_required";
|
|
@@ -82,13 +82,13 @@ export declare const commerceFulfillmentLineSchema: z.ZodObject<{
|
|
|
82
82
|
export declare const commerceFulfillmentPaymentSummarySchema: z.ZodObject<{
|
|
83
83
|
paymentIntentId: z.ZodGUID;
|
|
84
84
|
paymentStatus: z.ZodEnum<{
|
|
85
|
-
|
|
86
|
-
created: "created";
|
|
85
|
+
requires_action: "requires_action";
|
|
87
86
|
failed: "failed";
|
|
88
87
|
cancelled: "cancelled";
|
|
88
|
+
created: "created";
|
|
89
|
+
expired: "expired";
|
|
89
90
|
refunded: "refunded";
|
|
90
91
|
not_started: "not_started";
|
|
91
|
-
requires_action: "requires_action";
|
|
92
92
|
processing: "processing";
|
|
93
93
|
partially_refunded: "partially_refunded";
|
|
94
94
|
disputed: "disputed";
|
|
@@ -98,10 +98,10 @@ export declare const commerceFulfillmentPaymentSummarySchema: z.ZodObject<{
|
|
|
98
98
|
}, z.core.$strict>;
|
|
99
99
|
export declare const commerceFulfillmentInventorySummarySchema: z.ZodObject<{
|
|
100
100
|
status: z.ZodEnum<{
|
|
101
|
+
missing: "missing";
|
|
101
102
|
expired: "expired";
|
|
102
103
|
not_checked: "not_checked";
|
|
103
104
|
reserved: "reserved";
|
|
104
|
-
missing: "missing";
|
|
105
105
|
released: "released";
|
|
106
106
|
consumed: "consumed";
|
|
107
107
|
review_required: "review_required";
|
|
@@ -132,8 +132,8 @@ export declare const commerceFulfillmentOmsEligibilitySchema: z.ZodObject<{
|
|
|
132
132
|
export declare const commerceFulfillmentOperationSchema: z.ZodObject<{
|
|
133
133
|
id: z.ZodGUID;
|
|
134
134
|
type: z.ZodEnum<{
|
|
135
|
-
created: "created";
|
|
136
135
|
cancelled: "cancelled";
|
|
136
|
+
created: "created";
|
|
137
137
|
packed: "packed";
|
|
138
138
|
label_created: "label_created";
|
|
139
139
|
handed_over: "handed_over";
|
|
@@ -149,15 +149,15 @@ export declare const commerceFulfillmentOrderSchema: z.ZodObject<{
|
|
|
149
149
|
orderId: z.ZodGUID;
|
|
150
150
|
clientId: z.ZodNullable<z.ZodGUID>;
|
|
151
151
|
status: z.ZodEnum<{
|
|
152
|
-
created: "created";
|
|
153
152
|
cancelled: "cancelled";
|
|
154
153
|
delivered: "delivered";
|
|
154
|
+
exception: "exception";
|
|
155
|
+
created: "created";
|
|
155
156
|
packed: "packed";
|
|
156
157
|
label_pending: "label_pending";
|
|
157
158
|
label_created: "label_created";
|
|
158
159
|
handed_over: "handed_over";
|
|
159
160
|
in_transit: "in_transit";
|
|
160
|
-
exception: "exception";
|
|
161
161
|
}>;
|
|
162
162
|
providerKind: z.ZodNullable<z.ZodString>;
|
|
163
163
|
providerTrackingId: z.ZodNullable<z.ZodString>;
|
|
@@ -184,13 +184,13 @@ export declare const commerceFulfillmentOrderSchema: z.ZodObject<{
|
|
|
184
184
|
payment: z.ZodObject<{
|
|
185
185
|
paymentIntentId: z.ZodGUID;
|
|
186
186
|
paymentStatus: z.ZodEnum<{
|
|
187
|
-
|
|
188
|
-
created: "created";
|
|
187
|
+
requires_action: "requires_action";
|
|
189
188
|
failed: "failed";
|
|
190
189
|
cancelled: "cancelled";
|
|
190
|
+
created: "created";
|
|
191
|
+
expired: "expired";
|
|
191
192
|
refunded: "refunded";
|
|
192
193
|
not_started: "not_started";
|
|
193
|
-
requires_action: "requires_action";
|
|
194
194
|
processing: "processing";
|
|
195
195
|
partially_refunded: "partially_refunded";
|
|
196
196
|
disputed: "disputed";
|
|
@@ -200,10 +200,10 @@ export declare const commerceFulfillmentOrderSchema: z.ZodObject<{
|
|
|
200
200
|
}, z.core.$strict>;
|
|
201
201
|
inventory: z.ZodObject<{
|
|
202
202
|
status: z.ZodEnum<{
|
|
203
|
+
missing: "missing";
|
|
203
204
|
expired: "expired";
|
|
204
205
|
not_checked: "not_checked";
|
|
205
206
|
reserved: "reserved";
|
|
206
|
-
missing: "missing";
|
|
207
207
|
released: "released";
|
|
208
208
|
consumed: "consumed";
|
|
209
209
|
review_required: "review_required";
|
|
@@ -234,8 +234,8 @@ export declare const commerceFulfillmentOrderSchema: z.ZodObject<{
|
|
|
234
234
|
latestOperation: z.ZodNullable<z.ZodObject<{
|
|
235
235
|
id: z.ZodGUID;
|
|
236
236
|
type: z.ZodEnum<{
|
|
237
|
-
created: "created";
|
|
238
237
|
cancelled: "cancelled";
|
|
238
|
+
created: "created";
|
|
239
239
|
packed: "packed";
|
|
240
240
|
label_created: "label_created";
|
|
241
241
|
handed_over: "handed_over";
|
|
@@ -253,15 +253,15 @@ export declare const adminCommerceFulfillmentOrdersListRequestSchema: z.ZodObjec
|
|
|
253
253
|
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
254
254
|
pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
255
255
|
status: z.ZodOptional<z.ZodEnum<{
|
|
256
|
-
created: "created";
|
|
257
256
|
cancelled: "cancelled";
|
|
258
257
|
delivered: "delivered";
|
|
258
|
+
exception: "exception";
|
|
259
|
+
created: "created";
|
|
259
260
|
packed: "packed";
|
|
260
261
|
label_pending: "label_pending";
|
|
261
262
|
label_created: "label_created";
|
|
262
263
|
handed_over: "handed_over";
|
|
263
264
|
in_transit: "in_transit";
|
|
264
|
-
exception: "exception";
|
|
265
265
|
}>>;
|
|
266
266
|
}, z.core.$strict>;
|
|
267
267
|
export declare const adminCommerceFulfillmentOrderDetailRequestSchema: z.ZodObject<{
|
|
@@ -307,8 +307,8 @@ export declare const adminCommerceFulfillmentTrackingEventRequestSchema: z.ZodOb
|
|
|
307
307
|
fulfillmentOrderId: z.ZodGUID;
|
|
308
308
|
status: z.ZodEnum<{
|
|
309
309
|
delivered: "delivered";
|
|
310
|
-
in_transit: "in_transit";
|
|
311
310
|
exception: "exception";
|
|
311
|
+
in_transit: "in_transit";
|
|
312
312
|
}>;
|
|
313
313
|
providerTrackingId: z.ZodOptional<z.ZodString>;
|
|
314
314
|
rawEvent: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -327,15 +327,15 @@ export declare const adminCommerceFulfillmentOrdersListResponseSchema: z.ZodObje
|
|
|
327
327
|
orderId: z.ZodGUID;
|
|
328
328
|
clientId: z.ZodNullable<z.ZodGUID>;
|
|
329
329
|
status: z.ZodEnum<{
|
|
330
|
-
created: "created";
|
|
331
330
|
cancelled: "cancelled";
|
|
332
331
|
delivered: "delivered";
|
|
332
|
+
exception: "exception";
|
|
333
|
+
created: "created";
|
|
333
334
|
packed: "packed";
|
|
334
335
|
label_pending: "label_pending";
|
|
335
336
|
label_created: "label_created";
|
|
336
337
|
handed_over: "handed_over";
|
|
337
338
|
in_transit: "in_transit";
|
|
338
|
-
exception: "exception";
|
|
339
339
|
}>;
|
|
340
340
|
providerKind: z.ZodNullable<z.ZodString>;
|
|
341
341
|
providerTrackingId: z.ZodNullable<z.ZodString>;
|
|
@@ -362,13 +362,13 @@ export declare const adminCommerceFulfillmentOrdersListResponseSchema: z.ZodObje
|
|
|
362
362
|
payment: z.ZodObject<{
|
|
363
363
|
paymentIntentId: z.ZodGUID;
|
|
364
364
|
paymentStatus: z.ZodEnum<{
|
|
365
|
-
|
|
366
|
-
created: "created";
|
|
365
|
+
requires_action: "requires_action";
|
|
367
366
|
failed: "failed";
|
|
368
367
|
cancelled: "cancelled";
|
|
368
|
+
created: "created";
|
|
369
|
+
expired: "expired";
|
|
369
370
|
refunded: "refunded";
|
|
370
371
|
not_started: "not_started";
|
|
371
|
-
requires_action: "requires_action";
|
|
372
372
|
processing: "processing";
|
|
373
373
|
partially_refunded: "partially_refunded";
|
|
374
374
|
disputed: "disputed";
|
|
@@ -378,10 +378,10 @@ export declare const adminCommerceFulfillmentOrdersListResponseSchema: z.ZodObje
|
|
|
378
378
|
}, z.core.$strict>;
|
|
379
379
|
inventory: z.ZodObject<{
|
|
380
380
|
status: z.ZodEnum<{
|
|
381
|
+
missing: "missing";
|
|
381
382
|
expired: "expired";
|
|
382
383
|
not_checked: "not_checked";
|
|
383
384
|
reserved: "reserved";
|
|
384
|
-
missing: "missing";
|
|
385
385
|
released: "released";
|
|
386
386
|
consumed: "consumed";
|
|
387
387
|
review_required: "review_required";
|
|
@@ -412,8 +412,8 @@ export declare const adminCommerceFulfillmentOrdersListResponseSchema: z.ZodObje
|
|
|
412
412
|
latestOperation: z.ZodNullable<z.ZodObject<{
|
|
413
413
|
id: z.ZodGUID;
|
|
414
414
|
type: z.ZodEnum<{
|
|
415
|
-
created: "created";
|
|
416
415
|
cancelled: "cancelled";
|
|
416
|
+
created: "created";
|
|
417
417
|
packed: "packed";
|
|
418
418
|
label_created: "label_created";
|
|
419
419
|
handed_over: "handed_over";
|
|
@@ -438,15 +438,15 @@ export declare const adminCommerceFulfillmentOrderDetailResponseSchema: z.ZodObj
|
|
|
438
438
|
orderId: z.ZodGUID;
|
|
439
439
|
clientId: z.ZodNullable<z.ZodGUID>;
|
|
440
440
|
status: z.ZodEnum<{
|
|
441
|
-
created: "created";
|
|
442
441
|
cancelled: "cancelled";
|
|
443
442
|
delivered: "delivered";
|
|
443
|
+
exception: "exception";
|
|
444
|
+
created: "created";
|
|
444
445
|
packed: "packed";
|
|
445
446
|
label_pending: "label_pending";
|
|
446
447
|
label_created: "label_created";
|
|
447
448
|
handed_over: "handed_over";
|
|
448
449
|
in_transit: "in_transit";
|
|
449
|
-
exception: "exception";
|
|
450
450
|
}>;
|
|
451
451
|
providerKind: z.ZodNullable<z.ZodString>;
|
|
452
452
|
providerTrackingId: z.ZodNullable<z.ZodString>;
|
|
@@ -473,13 +473,13 @@ export declare const adminCommerceFulfillmentOrderDetailResponseSchema: z.ZodObj
|
|
|
473
473
|
payment: z.ZodObject<{
|
|
474
474
|
paymentIntentId: z.ZodGUID;
|
|
475
475
|
paymentStatus: z.ZodEnum<{
|
|
476
|
-
|
|
477
|
-
created: "created";
|
|
476
|
+
requires_action: "requires_action";
|
|
478
477
|
failed: "failed";
|
|
479
478
|
cancelled: "cancelled";
|
|
479
|
+
created: "created";
|
|
480
|
+
expired: "expired";
|
|
480
481
|
refunded: "refunded";
|
|
481
482
|
not_started: "not_started";
|
|
482
|
-
requires_action: "requires_action";
|
|
483
483
|
processing: "processing";
|
|
484
484
|
partially_refunded: "partially_refunded";
|
|
485
485
|
disputed: "disputed";
|
|
@@ -489,10 +489,10 @@ export declare const adminCommerceFulfillmentOrderDetailResponseSchema: z.ZodObj
|
|
|
489
489
|
}, z.core.$strict>;
|
|
490
490
|
inventory: z.ZodObject<{
|
|
491
491
|
status: z.ZodEnum<{
|
|
492
|
+
missing: "missing";
|
|
492
493
|
expired: "expired";
|
|
493
494
|
not_checked: "not_checked";
|
|
494
495
|
reserved: "reserved";
|
|
495
|
-
missing: "missing";
|
|
496
496
|
released: "released";
|
|
497
497
|
consumed: "consumed";
|
|
498
498
|
review_required: "review_required";
|
|
@@ -523,8 +523,8 @@ export declare const adminCommerceFulfillmentOrderDetailResponseSchema: z.ZodObj
|
|
|
523
523
|
latestOperation: z.ZodNullable<z.ZodObject<{
|
|
524
524
|
id: z.ZodGUID;
|
|
525
525
|
type: z.ZodEnum<{
|
|
526
|
-
created: "created";
|
|
527
526
|
cancelled: "cancelled";
|
|
527
|
+
created: "created";
|
|
528
528
|
packed: "packed";
|
|
529
529
|
label_created: "label_created";
|
|
530
530
|
handed_over: "handed_over";
|
|
@@ -544,15 +544,15 @@ export declare const adminCommerceFulfillmentMutationResponseSchema: z.ZodObject
|
|
|
544
544
|
fulfillmentOrderId: z.ZodGUID;
|
|
545
545
|
orderId: z.ZodGUID;
|
|
546
546
|
status: z.ZodEnum<{
|
|
547
|
-
created: "created";
|
|
548
547
|
cancelled: "cancelled";
|
|
549
548
|
delivered: "delivered";
|
|
549
|
+
exception: "exception";
|
|
550
|
+
created: "created";
|
|
550
551
|
packed: "packed";
|
|
551
552
|
label_pending: "label_pending";
|
|
552
553
|
label_created: "label_created";
|
|
553
554
|
handed_over: "handed_over";
|
|
554
555
|
in_transit: "in_transit";
|
|
555
|
-
exception: "exception";
|
|
556
556
|
}>;
|
|
557
557
|
replayed: z.ZodBoolean;
|
|
558
558
|
}, z.core.$strict>;
|
|
@@ -574,10 +574,10 @@ export declare const adminCommerceOrderRequestReplacementShipmentRequestSchema:
|
|
|
574
574
|
idempotencyKey: z.ZodString;
|
|
575
575
|
orderId: z.ZodGUID;
|
|
576
576
|
reason: z.ZodEnum<{
|
|
577
|
-
other: "other";
|
|
578
577
|
damaged: "damaged";
|
|
579
578
|
lost: "lost";
|
|
580
579
|
returned_undelivered: "returned_undelivered";
|
|
580
|
+
other: "other";
|
|
581
581
|
}>;
|
|
582
582
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
583
583
|
}, z.core.$strict>;
|
|
@@ -635,10 +635,10 @@ export declare const adminCommerceOrderRequestReplacementShipmentResponseSchema:
|
|
|
635
635
|
sequenceNo: z.ZodNumber;
|
|
636
636
|
replacesFulfillmentOrderId: z.ZodString;
|
|
637
637
|
reason: z.ZodEnum<{
|
|
638
|
-
other: "other";
|
|
639
638
|
damaged: "damaged";
|
|
640
639
|
lost: "lost";
|
|
641
640
|
returned_undelivered: "returned_undelivered";
|
|
641
|
+
other: "other";
|
|
642
642
|
}>;
|
|
643
643
|
status: z.ZodString;
|
|
644
644
|
}, z.core.$strip>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const customerLifecycleStageSchema: z.ZodEnum<{
|
|
3
|
-
inactive: "inactive";
|
|
4
3
|
customer: "customer";
|
|
5
4
|
lead: "lead";
|
|
6
5
|
tester: "tester";
|
|
6
|
+
inactive: "inactive";
|
|
7
7
|
}>;
|
|
8
8
|
export declare const customerMeRequestSchema: z.ZodObject<{}, z.core.$strict>;
|
|
9
9
|
export declare const customerMeResponseSchema: z.ZodObject<{
|
|
@@ -12,10 +12,10 @@ export declare const customerMeResponseSchema: z.ZodObject<{
|
|
|
12
12
|
firstName: z.ZodNullable<z.ZodString>;
|
|
13
13
|
lastName: z.ZodNullable<z.ZodString>;
|
|
14
14
|
lifecycleStage: z.ZodEnum<{
|
|
15
|
-
inactive: "inactive";
|
|
16
15
|
customer: "customer";
|
|
17
16
|
lead: "lead";
|
|
18
17
|
tester: "tester";
|
|
18
|
+
inactive: "inactive";
|
|
19
19
|
}>;
|
|
20
20
|
subscriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
21
21
|
subscriptionId: z.ZodGUID;
|
|
@@ -43,7 +43,7 @@ export declare function mapInvoiceClaimToProviderSnapshot<Seller, Kind, Payment>
|
|
|
43
43
|
documentKind: Kind;
|
|
44
44
|
governmentClearanceRequired: boolean;
|
|
45
45
|
payment: Payment;
|
|
46
|
-
lines: (Pick<import("./contracts/facts.js").InvoiceLine, "quantity" | "
|
|
46
|
+
lines: (Pick<import("./contracts/facts.js").InvoiceLine, "quantity" | "totalNetMinor" | "totalGrossMinor" | "unitGrossMinor" | "unitNetMinor"> & {
|
|
47
47
|
name: string;
|
|
48
48
|
vatRate: string;
|
|
49
49
|
})[];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from "./validation.js";
|
|
2
|
+
export declare const ACQUISITION_CASE_CONTRACT_VERSION: "tester_application_v1";
|
|
3
|
+
export declare const ACQUISITION_CASE_VIEW: "acquisition_case_v1";
|
|
4
|
+
export declare const ACQUISITION_CASE_SOURCE: "tester_application";
|
|
5
|
+
export declare const acquisitionOpaqueReferenceSchema: z.ZodString;
|
|
6
|
+
export declare const acquisitionAddressReferenceSchema: z.ZodObject<{
|
|
7
|
+
source: z.ZodString;
|
|
8
|
+
reference: z.ZodString;
|
|
9
|
+
revision: z.ZodString;
|
|
10
|
+
provenance: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export declare const acquisitionCaseStateSchema: z.ZodEnum<{
|
|
13
|
+
rejected: "rejected";
|
|
14
|
+
active: "active";
|
|
15
|
+
submitted: "submitted";
|
|
16
|
+
withdrawn: "withdrawn";
|
|
17
|
+
approved: "approved";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const acquisitionCaseProjectionSchema: z.ZodObject<{
|
|
20
|
+
contractVersion: z.ZodLiteral<"tester_application_v1">;
|
|
21
|
+
caseRef: z.ZodString;
|
|
22
|
+
contactRef: z.ZodString;
|
|
23
|
+
sourceKind: z.ZodLiteral<"tester_application">;
|
|
24
|
+
consent: z.ZodObject<{
|
|
25
|
+
consentVersion: z.ZodString;
|
|
26
|
+
policyVersion: z.ZodString;
|
|
27
|
+
recordedAt: z.ZodString;
|
|
28
|
+
locale: z.ZodEnum<{
|
|
29
|
+
en: "en";
|
|
30
|
+
pl: "pl";
|
|
31
|
+
}>;
|
|
32
|
+
sourcePath: z.ZodLiteral<"/tester-application">;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
addressReference: z.ZodNullable<z.ZodObject<{
|
|
35
|
+
source: z.ZodString;
|
|
36
|
+
reference: z.ZodString;
|
|
37
|
+
revision: z.ZodString;
|
|
38
|
+
provenance: z.ZodString;
|
|
39
|
+
}, z.core.$strict>>;
|
|
40
|
+
state: z.ZodEnum<{
|
|
41
|
+
rejected: "rejected";
|
|
42
|
+
active: "active";
|
|
43
|
+
submitted: "submitted";
|
|
44
|
+
withdrawn: "withdrawn";
|
|
45
|
+
approved: "approved";
|
|
46
|
+
}>;
|
|
47
|
+
version: z.ZodNumber;
|
|
48
|
+
createdAt: z.ZodString;
|
|
49
|
+
updatedAt: z.ZodString;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export declare const acquisitionCaseListRequestSchema: z.ZodObject<{
|
|
52
|
+
view: z.ZodLiteral<"acquisition_case_v1">;
|
|
53
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
54
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
export declare const acquisitionCaseListResponseSchema: z.ZodObject<{
|
|
57
|
+
contractVersion: z.ZodLiteral<"tester_application_v1">;
|
|
58
|
+
cases: z.ZodArray<z.ZodObject<{
|
|
59
|
+
contractVersion: z.ZodLiteral<"tester_application_v1">;
|
|
60
|
+
caseRef: z.ZodString;
|
|
61
|
+
contactRef: z.ZodString;
|
|
62
|
+
sourceKind: z.ZodLiteral<"tester_application">;
|
|
63
|
+
consent: z.ZodObject<{
|
|
64
|
+
consentVersion: z.ZodString;
|
|
65
|
+
policyVersion: z.ZodString;
|
|
66
|
+
recordedAt: z.ZodString;
|
|
67
|
+
locale: z.ZodEnum<{
|
|
68
|
+
en: "en";
|
|
69
|
+
pl: "pl";
|
|
70
|
+
}>;
|
|
71
|
+
sourcePath: z.ZodLiteral<"/tester-application">;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
addressReference: z.ZodNullable<z.ZodObject<{
|
|
74
|
+
source: z.ZodString;
|
|
75
|
+
reference: z.ZodString;
|
|
76
|
+
revision: z.ZodString;
|
|
77
|
+
provenance: z.ZodString;
|
|
78
|
+
}, z.core.$strict>>;
|
|
79
|
+
state: z.ZodEnum<{
|
|
80
|
+
rejected: "rejected";
|
|
81
|
+
active: "active";
|
|
82
|
+
submitted: "submitted";
|
|
83
|
+
withdrawn: "withdrawn";
|
|
84
|
+
approved: "approved";
|
|
85
|
+
}>;
|
|
86
|
+
version: z.ZodNumber;
|
|
87
|
+
createdAt: z.ZodString;
|
|
88
|
+
updatedAt: z.ZodString;
|
|
89
|
+
}, z.core.$strict>>;
|
|
90
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
export declare const acquisitionCaseActiveCountResponseSchema: z.ZodObject<{
|
|
93
|
+
activeTesterCount: z.ZodNumber;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
export declare const acquisitionIdempotencyKeySchema: z.ZodString;
|
|
96
|
+
export type AcquisitionOpaqueReference = z.infer<typeof acquisitionOpaqueReferenceSchema>;
|
|
97
|
+
export type AcquisitionAddressReference = z.infer<typeof acquisitionAddressReferenceSchema>;
|
|
98
|
+
export type AcquisitionCaseState = z.infer<typeof acquisitionCaseStateSchema>;
|
|
99
|
+
export type AcquisitionCaseProjection = z.infer<typeof acquisitionCaseProjectionSchema>;
|
|
100
|
+
export type AcquisitionCaseListRequest = z.infer<typeof acquisitionCaseListRequestSchema>;
|
|
101
|
+
export type AcquisitionCaseListResponse = z.infer<typeof acquisitionCaseListResponseSchema>;
|
|
102
|
+
export type AcquisitionCaseActiveCountResponse = z.infer<typeof acquisitionCaseActiveCountResponseSchema>;
|
|
103
|
+
export type AcquisitionIdempotencyKey = z.infer<typeof acquisitionIdempotencyKeySchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "./validation.js";
|
|
2
|
+
export const ACQUISITION_CASE_CONTRACT_VERSION = "tester_application_v1";
|
|
3
|
+
export const ACQUISITION_CASE_VIEW = "acquisition_case_v1";
|
|
4
|
+
export const ACQUISITION_CASE_SOURCE = "tester_application";
|
|
5
|
+
export const acquisitionOpaqueReferenceSchema = z.string().trim().min(8).max(160)
|
|
6
|
+
.regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/);
|
|
7
|
+
const dateTimeSchema = z.string().datetime({ offset: true });
|
|
8
|
+
export const acquisitionAddressReferenceSchema = z.object({
|
|
9
|
+
source: z.string().trim().min(1).max(48).regex(/^[a-z][a-z0-9_-]*$/),
|
|
10
|
+
reference: acquisitionOpaqueReferenceSchema,
|
|
11
|
+
revision: z.string().trim().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/),
|
|
12
|
+
provenance: z.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),
|
|
13
|
+
}).strict();
|
|
14
|
+
export const acquisitionCaseStateSchema = z.enum([
|
|
15
|
+
"submitted", "approved", "active", "rejected", "withdrawn",
|
|
16
|
+
]);
|
|
17
|
+
export const acquisitionCaseProjectionSchema = z.object({
|
|
18
|
+
contractVersion: z.literal(ACQUISITION_CASE_CONTRACT_VERSION),
|
|
19
|
+
caseRef: acquisitionOpaqueReferenceSchema,
|
|
20
|
+
contactRef: acquisitionOpaqueReferenceSchema,
|
|
21
|
+
sourceKind: z.literal(ACQUISITION_CASE_SOURCE),
|
|
22
|
+
consent: z.object({
|
|
23
|
+
consentVersion: z.string().min(1).max(64),
|
|
24
|
+
policyVersion: z.string().min(1).max(64),
|
|
25
|
+
recordedAt: dateTimeSchema,
|
|
26
|
+
locale: z.enum(["en", "pl"]),
|
|
27
|
+
sourcePath: z.literal("/tester-application"),
|
|
28
|
+
}).strict(),
|
|
29
|
+
addressReference: acquisitionAddressReferenceSchema.nullable(),
|
|
30
|
+
state: acquisitionCaseStateSchema,
|
|
31
|
+
version: z.number().int().positive(),
|
|
32
|
+
createdAt: dateTimeSchema,
|
|
33
|
+
updatedAt: dateTimeSchema,
|
|
34
|
+
}).strict().superRefine((value, context) => {
|
|
35
|
+
if (value.state !== "withdrawn" && value.addressReference === null) {
|
|
36
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["addressReference"], message: "active case requires address reference" });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export const acquisitionCaseListRequestSchema = z.object({
|
|
40
|
+
view: z.literal(ACQUISITION_CASE_VIEW),
|
|
41
|
+
cursor: acquisitionOpaqueReferenceSchema.optional(),
|
|
42
|
+
limit: z.number().int().min(1).max(100).default(25),
|
|
43
|
+
}).strict();
|
|
44
|
+
export const acquisitionCaseListResponseSchema = z.object({
|
|
45
|
+
contractVersion: z.literal(ACQUISITION_CASE_CONTRACT_VERSION),
|
|
46
|
+
cases: z.array(acquisitionCaseProjectionSchema).max(100),
|
|
47
|
+
nextCursor: acquisitionOpaqueReferenceSchema.nullable(),
|
|
48
|
+
}).strict();
|
|
49
|
+
export const acquisitionCaseActiveCountResponseSchema = z.object({
|
|
50
|
+
activeTesterCount: z.number().int().nonnegative(),
|
|
51
|
+
}).strict();
|
|
52
|
+
export const acquisitionIdempotencyKeySchema = z.string().trim().min(8).max(200)
|
|
53
|
+
.regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from "./validation.js";
|
|
2
|
+
export declare const ACQUISITION_SURVEY_VERSION: "acquisition_survey_v1";
|
|
3
|
+
export declare const ACQUISITION_NEWSLETTER_VERSION: "acquisition_newsletter_consent_v1";
|
|
4
|
+
export declare const acquisitionSurveySubmitSchema: z.ZodObject<{
|
|
5
|
+
view: z.ZodLiteral<"acquisition_survey_v1">;
|
|
6
|
+
caseReference: z.ZodString;
|
|
7
|
+
surveyType: z.ZodEnum<{
|
|
8
|
+
producer: "producer";
|
|
9
|
+
consumer: "consumer";
|
|
10
|
+
}>;
|
|
11
|
+
responseData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const acquisitionSurveyEvidenceSchema: z.ZodObject<{
|
|
14
|
+
evidenceReference: z.ZodString;
|
|
15
|
+
caseReference: z.ZodString;
|
|
16
|
+
contactReference: z.ZodString;
|
|
17
|
+
surveyType: z.ZodEnum<{
|
|
18
|
+
producer: "producer";
|
|
19
|
+
consumer: "consumer";
|
|
20
|
+
}>;
|
|
21
|
+
responseDigest: z.ZodString;
|
|
22
|
+
answerCount: z.ZodNumber;
|
|
23
|
+
recordedAt: z.ZodString;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export declare const acquisitionSurveySubmitResponseSchema: z.ZodObject<{
|
|
26
|
+
contractVersion: z.ZodLiteral<"acquisition_survey_v1">;
|
|
27
|
+
evidence: z.ZodObject<{
|
|
28
|
+
evidenceReference: z.ZodString;
|
|
29
|
+
caseReference: z.ZodString;
|
|
30
|
+
contactReference: z.ZodString;
|
|
31
|
+
surveyType: z.ZodEnum<{
|
|
32
|
+
producer: "producer";
|
|
33
|
+
consumer: "consumer";
|
|
34
|
+
}>;
|
|
35
|
+
responseDigest: z.ZodString;
|
|
36
|
+
answerCount: z.ZodNumber;
|
|
37
|
+
recordedAt: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
replayed: z.ZodBoolean;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export declare const acquisitionSurveyListQuerySchema: z.ZodObject<{
|
|
42
|
+
view: z.ZodLiteral<"acquisition_survey_v1">;
|
|
43
|
+
surveyType: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
producer: "producer";
|
|
45
|
+
consumer: "consumer";
|
|
46
|
+
}>>;
|
|
47
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const acquisitionSurveyListResponseSchema: z.ZodObject<{
|
|
50
|
+
contractVersion: z.ZodLiteral<"acquisition_survey_v1">;
|
|
51
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
52
|
+
evidenceReference: z.ZodString;
|
|
53
|
+
caseReference: z.ZodString;
|
|
54
|
+
contactReference: z.ZodString;
|
|
55
|
+
surveyType: z.ZodEnum<{
|
|
56
|
+
producer: "producer";
|
|
57
|
+
consumer: "consumer";
|
|
58
|
+
}>;
|
|
59
|
+
responseDigest: z.ZodString;
|
|
60
|
+
answerCount: z.ZodNumber;
|
|
61
|
+
recordedAt: z.ZodString;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
totalCount: z.ZodNumber;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export declare const acquisitionNewsletterConsentEventSchema: z.ZodObject<{
|
|
66
|
+
contractVersion: z.ZodLiteral<"acquisition_newsletter_consent_v1">;
|
|
67
|
+
caseReference: z.ZodString;
|
|
68
|
+
contactReference: z.ZodString;
|
|
69
|
+
eventReference: z.ZodString;
|
|
70
|
+
eventType: z.ZodEnum<{
|
|
71
|
+
suppress: "suppress";
|
|
72
|
+
update: "update";
|
|
73
|
+
subscribe: "subscribe";
|
|
74
|
+
unsubscribe: "unsubscribe";
|
|
75
|
+
complaint: "complaint";
|
|
76
|
+
}>;
|
|
77
|
+
purpose: z.ZodEnum<{
|
|
78
|
+
marketing_launch_offer: "marketing_launch_offer";
|
|
79
|
+
marketing_newsletter: "marketing_newsletter";
|
|
80
|
+
}>;
|
|
81
|
+
explicitOptInEvidence: z.ZodDefault<z.ZodBoolean>;
|
|
82
|
+
occurredAt: z.ZodString;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
export declare const acquisitionNewsletterConsentResponseSchema: z.ZodObject<{
|
|
85
|
+
contractVersion: z.ZodLiteral<"acquisition_newsletter_consent_v1">;
|
|
86
|
+
eventReference: z.ZodString;
|
|
87
|
+
outcome: z.ZodEnum<{
|
|
88
|
+
applied: "applied";
|
|
89
|
+
ignored: "ignored";
|
|
90
|
+
stale: "stale";
|
|
91
|
+
}>;
|
|
92
|
+
consentState: z.ZodNullable<z.ZodEnum<{
|
|
93
|
+
suppressed: "suppressed";
|
|
94
|
+
granted: "granted";
|
|
95
|
+
}>>;
|
|
96
|
+
auditReference: z.ZodString;
|
|
97
|
+
replayed: z.ZodBoolean;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export type AcquisitionSurveySubmit = z.infer<typeof acquisitionSurveySubmitSchema>;
|
|
100
|
+
export type AcquisitionSurveyEvidence = z.infer<typeof acquisitionSurveyEvidenceSchema>;
|
|
101
|
+
export type AcquisitionSurveySubmitResponse = z.infer<typeof acquisitionSurveySubmitResponseSchema>;
|
|
102
|
+
export type AcquisitionSurveyListQuery = z.infer<typeof acquisitionSurveyListQuerySchema>;
|
|
103
|
+
export type AcquisitionSurveyListResponse = z.infer<typeof acquisitionSurveyListResponseSchema>;
|
|
104
|
+
export type AcquisitionNewsletterConsentEvent = z.infer<typeof acquisitionNewsletterConsentEventSchema>;
|
|
105
|
+
export type AcquisitionNewsletterConsentResponse = z.infer<typeof acquisitionNewsletterConsentResponseSchema>;
|