platform-types 1.10.723 → 1.10.725
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account.d.ts +6 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/systemCustomer.js +31 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/subscription.d.ts +36 -2
- package/dist/systemCustomer.d.ts +27 -0
- package/dist/systemCustomer.js +27 -0
- package/package.json +1 -1
package/dist/account.d.ts
CHANGED
|
@@ -198,6 +198,12 @@ declare global {
|
|
|
198
198
|
* and attach the token here. The approval binds the raw body minus the token,
|
|
199
199
|
* which is why the keys marked accepted and IGNORED below are declared at all.
|
|
200
200
|
*
|
|
201
|
+
* A `customerId` equal to `SYSTEM_CUSTOMER_ID` (the walk-in, see
|
|
202
|
+
* `isSystemCustomer`) is refused `403 SYSTEM_CUSTOMER_PROTECTED`, credit and
|
|
203
|
+
* debit alike, with no business row read or written: the walk-in has no cuenta
|
|
204
|
+
* corriente. Collect a walk-in order's cash through
|
|
205
|
+
* `POST /orders { mode: 'tender' }` instead.
|
|
206
|
+
*
|
|
201
207
|
* Held to its schema by `AssertAccountPostRequestMatchesSchema`.
|
|
202
208
|
*/
|
|
203
209
|
interface AccountPostRequest extends TerminalElevationAuthorization {
|
package/dist/cjs/index.js
CHANGED
|
@@ -114,6 +114,7 @@ __exportStar(require("./terminal.js"), exports);
|
|
|
114
114
|
__exportStar(require("./supplier.js"), exports);
|
|
115
115
|
__exportStar(require("./supplierClaim.js"), exports);
|
|
116
116
|
__exportStar(require("./survey.js"), exports);
|
|
117
|
+
__exportStar(require("./systemCustomer.js"), exports);
|
|
117
118
|
__exportStar(require("./user.js"), exports);
|
|
118
119
|
__exportStar(require("./userActivity.js"), exports);
|
|
119
120
|
__exportStar(require("./valuation.js"), exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSystemCustomer = exports.SYSTEM_CUSTOMER_ID = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The walk-in ("Consumidor Final") system customer — the ONE definition.
|
|
6
|
+
*
|
|
7
|
+
* Every store mints a single CUSTOMER row under this fixed id the first time it
|
|
8
|
+
* records a walk-in POS sale, so a walk-in order still carries a non-null
|
|
9
|
+
* `Order.customerId`. It carries no real identity and has no cuenta corriente.
|
|
10
|
+
* Operator writes that refuse it with `403 SYSTEM_CUSTOMER_PROTECTED` include
|
|
11
|
+
* `POST /customers` and its merge mode, the address book, contacts and notes
|
|
12
|
+
* (create and edit), a movement or a balance reprojection on `POST /account`,
|
|
13
|
+
* a payment link whose target is the customer, and the customer data-rights
|
|
14
|
+
* modes (data export, anonymize). Map the code wherever it appears; this is
|
|
15
|
+
* not a closed list.
|
|
16
|
+
*
|
|
17
|
+
* A client routes on it instead of hard-coding the literal: collecting cash on a
|
|
18
|
+
* delivered walk-in order is `POST /orders { mode: 'tender' }`, never a
|
|
19
|
+
* cuenta-corriente movement.
|
|
20
|
+
*
|
|
21
|
+
* ⚠️ Zero imports, deliberately: the server re-exports it from the leaf
|
|
22
|
+
* `stacks/helpers/protectSystemCustomer.ts` (imported by services and crons),
|
|
23
|
+
* and a client bundles it without any other contract module.
|
|
24
|
+
*
|
|
25
|
+
* The id sits outside the mintable range: the customer counter starts at 1 and
|
|
26
|
+
* a store's seeded placeholder rows hold `CUST000001`–`CUST000006`.
|
|
27
|
+
*/
|
|
28
|
+
exports.SYSTEM_CUSTOMER_ID = 'CUST000000';
|
|
29
|
+
/** `true` exactly when `customerId` is the walk-in system customer. */
|
|
30
|
+
const isSystemCustomer = (customerId) => customerId === exports.SYSTEM_CUSTOMER_ID;
|
|
31
|
+
exports.isSystemCustomer = isSystemCustomer;
|
package/dist/index.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ export * from './terminal.ts';
|
|
|
90
90
|
export * from './supplier.ts';
|
|
91
91
|
export * from './supplierClaim.ts';
|
|
92
92
|
export * from './survey.ts';
|
|
93
|
+
export * from './systemCustomer.ts';
|
|
93
94
|
export * from './user.ts';
|
|
94
95
|
export * from './userActivity.ts';
|
|
95
96
|
export * from './valuation.ts';
|
package/dist/index.js
CHANGED
|
@@ -98,6 +98,7 @@ export * from "./terminal.js";
|
|
|
98
98
|
export * from "./supplier.js";
|
|
99
99
|
export * from "./supplierClaim.js";
|
|
100
100
|
export * from "./survey.js";
|
|
101
|
+
export * from "./systemCustomer.js";
|
|
101
102
|
export * from "./user.js";
|
|
102
103
|
export * from "./userActivity.js";
|
|
103
104
|
export * from "./valuation.js";
|
package/dist/subscription.d.ts
CHANGED
|
@@ -882,8 +882,12 @@ declare global {
|
|
|
882
882
|
* non-null value for one is refused (`PLAN_GRANT_UNKNOWN_KEY`).
|
|
883
883
|
*/
|
|
884
884
|
grants: Record<string, Partial<Record<PlanTier, PlanGrantValue | null>>>;
|
|
885
|
-
/**
|
|
886
|
-
|
|
885
|
+
/**
|
|
886
|
+
* Optional on a draft edit: the reason that lands in the permanent audit
|
|
887
|
+
* rows is the publish's (`PlanCataloguePublishInput.reason`). Still
|
|
888
|
+
* screened when sent (10-500 characters, no personal data).
|
|
889
|
+
*/
|
|
890
|
+
reason?: string;
|
|
887
891
|
/**
|
|
888
892
|
* Accepted and NOT checked: a grant edit writes the draft, and the echo that
|
|
889
893
|
* gates what readers see is the publish's (`PlanCataloguePublishInput.confirm`).
|
|
@@ -891,6 +895,36 @@ declare global {
|
|
|
891
895
|
confirm?: string;
|
|
892
896
|
/** `true` writes nothing and returns the impact plus the `confirm` string. */
|
|
893
897
|
dryRun?: boolean;
|
|
898
|
+
/**
|
|
899
|
+
* The draft revision the editor read (`GET /platform/billing/plans/draft`),
|
|
900
|
+
* or `null` when there was no draft. Checked when sent: a stale one is
|
|
901
|
+
* `409 PLAN_CATALOGUE_REVISION_CONFLICT` and nothing is written.
|
|
902
|
+
*/
|
|
903
|
+
expectedDraftRevision?: string | null;
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* The body of `PATCH /platform/billing/plans/{tier}`: template fields written
|
|
907
|
+
* to the DRAFT catalogue only (customers see them after a publish). Every
|
|
908
|
+
* field is optional; a `null` clears a nullable one. Grants go through
|
|
909
|
+
* `PATCH /platform/billing/plans/grants` (a body carrying `features` or
|
|
910
|
+
* `grants` is `400 PLAN_GRANTS_USE_GRANTS_ROUTE`), and the retired `bullets`
|
|
911
|
+
* copy is refused.
|
|
912
|
+
*/
|
|
913
|
+
interface PlanTemplatePatchRequest {
|
|
914
|
+
name?: string;
|
|
915
|
+
description?: string;
|
|
916
|
+
displayOrder?: number;
|
|
917
|
+
isActive?: boolean;
|
|
918
|
+
isPopular?: boolean;
|
|
919
|
+
/** `#rgb` or `#rrggbb`; `null` clears it. */
|
|
920
|
+
color?: string | null;
|
|
921
|
+
priceMonthlyCents?: number | null;
|
|
922
|
+
priceAnnualCents?: number | null;
|
|
923
|
+
currency?: Plan['currency'];
|
|
924
|
+
/** Optional on a draft edit; still screened when sent. The audited reason is the publish's. */
|
|
925
|
+
reason?: string;
|
|
926
|
+
/** As on {@link PlanGrantsWriteRequest.expectedDraftRevision}. */
|
|
927
|
+
expectedDraftRevision?: string | null;
|
|
894
928
|
}
|
|
895
929
|
/** One key's effective grant on one tier, before and after the write. */
|
|
896
930
|
interface PlanGrantChange {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The walk-in ("Consumidor Final") system customer — the ONE definition.
|
|
3
|
+
*
|
|
4
|
+
* Every store mints a single CUSTOMER row under this fixed id the first time it
|
|
5
|
+
* records a walk-in POS sale, so a walk-in order still carries a non-null
|
|
6
|
+
* `Order.customerId`. It carries no real identity and has no cuenta corriente.
|
|
7
|
+
* Operator writes that refuse it with `403 SYSTEM_CUSTOMER_PROTECTED` include
|
|
8
|
+
* `POST /customers` and its merge mode, the address book, contacts and notes
|
|
9
|
+
* (create and edit), a movement or a balance reprojection on `POST /account`,
|
|
10
|
+
* a payment link whose target is the customer, and the customer data-rights
|
|
11
|
+
* modes (data export, anonymize). Map the code wherever it appears; this is
|
|
12
|
+
* not a closed list.
|
|
13
|
+
*
|
|
14
|
+
* A client routes on it instead of hard-coding the literal: collecting cash on a
|
|
15
|
+
* delivered walk-in order is `POST /orders { mode: 'tender' }`, never a
|
|
16
|
+
* cuenta-corriente movement.
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ Zero imports, deliberately: the server re-exports it from the leaf
|
|
19
|
+
* `stacks/helpers/protectSystemCustomer.ts` (imported by services and crons),
|
|
20
|
+
* and a client bundles it without any other contract module.
|
|
21
|
+
*
|
|
22
|
+
* The id sits outside the mintable range: the customer counter starts at 1 and
|
|
23
|
+
* a store's seeded placeholder rows hold `CUST000001`–`CUST000006`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SYSTEM_CUSTOMER_ID: "CUST000000";
|
|
26
|
+
/** `true` exactly when `customerId` is the walk-in system customer. */
|
|
27
|
+
export declare const isSystemCustomer: (customerId: string | undefined | null) => customerId is typeof SYSTEM_CUSTOMER_ID;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The walk-in ("Consumidor Final") system customer — the ONE definition.
|
|
3
|
+
*
|
|
4
|
+
* Every store mints a single CUSTOMER row under this fixed id the first time it
|
|
5
|
+
* records a walk-in POS sale, so a walk-in order still carries a non-null
|
|
6
|
+
* `Order.customerId`. It carries no real identity and has no cuenta corriente.
|
|
7
|
+
* Operator writes that refuse it with `403 SYSTEM_CUSTOMER_PROTECTED` include
|
|
8
|
+
* `POST /customers` and its merge mode, the address book, contacts and notes
|
|
9
|
+
* (create and edit), a movement or a balance reprojection on `POST /account`,
|
|
10
|
+
* a payment link whose target is the customer, and the customer data-rights
|
|
11
|
+
* modes (data export, anonymize). Map the code wherever it appears; this is
|
|
12
|
+
* not a closed list.
|
|
13
|
+
*
|
|
14
|
+
* A client routes on it instead of hard-coding the literal: collecting cash on a
|
|
15
|
+
* delivered walk-in order is `POST /orders { mode: 'tender' }`, never a
|
|
16
|
+
* cuenta-corriente movement.
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ Zero imports, deliberately: the server re-exports it from the leaf
|
|
19
|
+
* `stacks/helpers/protectSystemCustomer.ts` (imported by services and crons),
|
|
20
|
+
* and a client bundles it without any other contract module.
|
|
21
|
+
*
|
|
22
|
+
* The id sits outside the mintable range: the customer counter starts at 1 and
|
|
23
|
+
* a store's seeded placeholder rows hold `CUST000001`–`CUST000006`.
|
|
24
|
+
*/
|
|
25
|
+
export const SYSTEM_CUSTOMER_ID = 'CUST000000';
|
|
26
|
+
/** `true` exactly when `customerId` is the walk-in system customer. */
|
|
27
|
+
export const isSystemCustomer = (customerId) => customerId === SYSTEM_CUSTOMER_ID;
|