@final-commerce/command-frame 0.7.0-staging.6 → 0.7.0-staging.8
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/CommonTypes.d.ts +15 -0
- package/dist/actions/get-context/mock.js +4 -0
- package/dist/actions/get-refund-plan/types.d.ts +5 -2
- package/dist/actions/get-remaining-refundable-quantities/mock.js +1 -0
- package/dist/actions/get-remaining-refundable-quantities/types.d.ts +8 -0
- package/dist/actions/process-partial-refund/types.d.ts +2 -2
- package/package.json +1 -1
package/dist/CommonTypes.d.ts
CHANGED
|
@@ -116,6 +116,21 @@ export interface CFContextRender {
|
|
|
116
116
|
stationName: string | null;
|
|
117
117
|
outletId: string | null;
|
|
118
118
|
outletName: string | null;
|
|
119
|
+
/**
|
|
120
|
+
* IANA zone the SHOP keeps, resolved as the outlet's own zone, else the
|
|
121
|
+
* company's — never the device's. A booking is stored as an instant, so which
|
|
122
|
+
* hour and which DAY it reads as is decided entirely by the zone it is printed
|
|
123
|
+
* in, and the screen's own machine is the one zone that is certainly wrong: a
|
|
124
|
+
* 17:00 Monday appointment in Vancouver is 21:30 for a till in St John's, and
|
|
125
|
+
* for some viewers it lands on Tuesday. Without this an app cannot label a
|
|
126
|
+
* slot or an appointment honestly — it can only guess, and it guesses wrong
|
|
127
|
+
* for every business that does not sit in the same zone as its screen.
|
|
128
|
+
*
|
|
129
|
+
* `null` when neither the outlet nor the company has one configured. Say so
|
|
130
|
+
* rather than falling back to the device: a missing timezone is a setup
|
|
131
|
+
* problem, and printing the machine's clock hides it.
|
|
132
|
+
*/
|
|
133
|
+
timeZone: string | null;
|
|
119
134
|
buildId: string | null;
|
|
120
135
|
buildName: string | null;
|
|
121
136
|
buildVersion: string | null;
|
|
@@ -11,6 +11,10 @@ export const mockGetContext = () => {
|
|
|
11
11
|
stationName: MOCK_STATION.name,
|
|
12
12
|
outletId: MOCK_OUTLET.id,
|
|
13
13
|
outletName: MOCK_OUTLET.name || null,
|
|
14
|
+
// Deliberately NOT the developer's own zone: an app that quietly formats with
|
|
15
|
+
// the machine's clock looks correct in preview and is wrong on every till that
|
|
16
|
+
// sits in a different city. Here it cannot look correct by accident.
|
|
17
|
+
timeZone: "America/Vancouver",
|
|
14
18
|
buildId: "mock_build_id",
|
|
15
19
|
buildName: "Mock Build",
|
|
16
20
|
buildVersion: "1.0.0-mock",
|
|
@@ -18,11 +18,14 @@ export interface GetRefundPlanParams {
|
|
|
18
18
|
* nothing staged, no `allocation` comes back.
|
|
19
19
|
*/
|
|
20
20
|
items?: {
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* `internalId` / `variantId` for a product, `customSaleId`, cart-fee id, tip
|
|
23
|
+
* `transactionId`, or a booking's own `internalId` on `order.reservations[]`.
|
|
24
|
+
*/
|
|
22
25
|
itemKey: string;
|
|
23
26
|
quantity: number;
|
|
24
27
|
/** Optional hint; inferred from the order when omitted. */
|
|
25
|
-
type?: 'product' | 'customSale' | 'fee' | 'tip';
|
|
28
|
+
type?: 'product' | 'customSale' | 'fee' | 'tip' | 'reservation';
|
|
26
29
|
}[];
|
|
27
30
|
}
|
|
28
31
|
export interface RefundPlanSource {
|
|
@@ -18,6 +18,14 @@ export interface GetRemainingRefundableQuantitiesResponse {
|
|
|
18
18
|
* 0/1 semantics: `1` = still refundable, `0` = already refunded.
|
|
19
19
|
*/
|
|
20
20
|
tips: Record<string, number>;
|
|
21
|
+
/**
|
|
22
|
+
* Remaining refundable bookings, keyed by `order.reservations[].internalId` —
|
|
23
|
+
* the same key `processPartialRefund` takes for `type: 'reservation'` items.
|
|
24
|
+
* A service is sold as a reservation rather than a line item, so without this
|
|
25
|
+
* map a refund screen can show everything on the order EXCEPT the appointment.
|
|
26
|
+
* 0/1 semantics: `1` = still refundable, `0` = already refunded.
|
|
27
|
+
*/
|
|
28
|
+
reservations: Record<string, number>;
|
|
21
29
|
timestamp: string;
|
|
22
30
|
}
|
|
23
31
|
export type GetRemainingRefundableQuantities = (params?: GetRemainingRefundableQuantitiesParams) => Promise<GetRemainingRefundableQuantitiesResponse>;
|
|
@@ -131,10 +131,10 @@ export interface ProcessPartialRefundParams {
|
|
|
131
131
|
};
|
|
132
132
|
/** Optional items to refund. */
|
|
133
133
|
items?: {
|
|
134
|
-
/** internalId or variantId or
|
|
134
|
+
/** internalId or variantId, customSaleId, or a booking's own internalId. */
|
|
135
135
|
itemKey: string;
|
|
136
136
|
quantity: number;
|
|
137
|
-
type?: 'product' | 'customSale' | 'fee' | 'tip';
|
|
137
|
+
type?: 'product' | 'customSale' | 'fee' | 'tip' | 'reservation';
|
|
138
138
|
/**
|
|
139
139
|
* Per-item stock disposition for a refunded **product** line — the
|
|
140
140
|
* headless equivalent of the old refund popup's per-row restock/damaged
|