@final-commerce/command-frame 0.7.0-staging.5 → 0.7.0-staging.7
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/actions/add-booking-to-cart/mock.js +0 -2
- 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/dist/demo/database.js +3 -3
- package/package.json +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReservationStatus } from '@final-commerce/common';
|
|
2
1
|
import { MOCK_CART, MOCK_PRODUCTS, mockPublishEvent } from '../../demo/database';
|
|
3
2
|
import { mockHoldBooking } from '../hold-booking/mock';
|
|
4
3
|
export const mockAddBookingToCart = async (params) => {
|
|
@@ -27,7 +26,6 @@ export const mockAddBookingToCart = async (params) => {
|
|
|
27
26
|
startAt: booking.startAt,
|
|
28
27
|
endAt: booking.endAt,
|
|
29
28
|
bufferEndAt: booking.bufferEndAt,
|
|
30
|
-
status: ReservationStatus.HELD,
|
|
31
29
|
expiresAt: booking.expiresAt,
|
|
32
30
|
};
|
|
33
31
|
if (!MOCK_CART.reservations)
|
|
@@ -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
|
package/dist/demo/database.js
CHANGED
|
@@ -916,9 +916,9 @@ export const createOrderFromCart = (paymentType, amount, processor = 'cash') =>
|
|
|
916
916
|
bufferEndAt: reservation.bufferEndAt,
|
|
917
917
|
// The mock computes no tax anywhere — line items ship `taxes: []` too.
|
|
918
918
|
taxes: [],
|
|
919
|
-
// `expiresAt`
|
|
920
|
-
//
|
|
921
|
-
|
|
919
|
+
// Neither `expiresAt` nor a status comes along: a booking's state lives on its own
|
|
920
|
+
// row — which is what `getBookings` reads — and a copy frozen on the order would be
|
|
921
|
+
// wrong from the next moment on.
|
|
922
922
|
})),
|
|
923
923
|
customSales: [],
|
|
924
924
|
balance: 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@final-commerce/command-frame",
|
|
3
|
-
"version": "0.7.0-staging.
|
|
3
|
+
"version": "0.7.0-staging.7",
|
|
4
4
|
"description": "Commands Frame library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"ignoreBranchesMissingTickets": true
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@final-commerce/common": "2.3.0-staging.
|
|
60
|
+
"@final-commerce/common": "2.3.0-staging.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@commitlint/cli": "^19.0.0",
|