types-salon-management 1.0.59 → 1.0.60
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/api/checkout-orders/checkout-order.constants.d.ts +33 -0
- package/dist/api/checkout-orders/checkout-order.constants.d.ts.map +1 -0
- package/dist/api/checkout-orders/checkout-order.constants.js +32 -0
- package/dist/api/checkout-orders/checkout-order.constants.js.map +1 -0
- package/dist/api/checkout-orders/checkout-order.dto.d.ts +84 -0
- package/dist/api/checkout-orders/checkout-order.dto.d.ts.map +1 -0
- package/dist/api/checkout-orders/checkout-order.dto.js +3 -0
- package/dist/api/checkout-orders/checkout-order.dto.js.map +1 -0
- package/dist/api/checkout-orders/checkout-order.requests.d.ts +116 -0
- package/dist/api/checkout-orders/checkout-order.requests.d.ts.map +1 -0
- package/dist/api/checkout-orders/checkout-order.requests.js +3 -0
- package/dist/api/checkout-orders/checkout-order.requests.js.map +1 -0
- package/dist/api/checkout-orders/index.d.ts +4 -0
- package/dist/api/checkout-orders/index.d.ts.map +1 -0
- package/dist/api/checkout-orders/index.js +20 -0
- package/dist/api/checkout-orders/index.js.map +1 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/checkout-orders/checkout-order.constants.ts +43 -0
- package/src/api/checkout-orders/checkout-order.dto.ts +91 -0
- package/src/api/checkout-orders/checkout-order.requests.ts +143 -0
- package/src/api/checkout-orders/index.ts +3 -0
- package/src/api/index.ts +1 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Checkout order lifecycle — distinct from invoice status. */
|
|
2
|
+
export declare const CheckoutOrderStatus: {
|
|
3
|
+
readonly OPEN: "open";
|
|
4
|
+
readonly ABANDONED: "abandoned";
|
|
5
|
+
readonly FINALIZED: "finalized";
|
|
6
|
+
};
|
|
7
|
+
export type CheckoutOrderStatus = (typeof CheckoutOrderStatus)[keyof typeof CheckoutOrderStatus];
|
|
8
|
+
/** How the checkout order was started — informational for analytics and UI. */
|
|
9
|
+
export declare const CheckoutOrderSource: {
|
|
10
|
+
readonly QUICK_SALE: "quick_sale";
|
|
11
|
+
readonly APPOINTMENT_CHECKOUT: "appointment_checkout";
|
|
12
|
+
readonly MIXED: "mixed";
|
|
13
|
+
};
|
|
14
|
+
export type CheckoutOrderSource = (typeof CheckoutOrderSource)[keyof typeof CheckoutOrderSource];
|
|
15
|
+
/** Discriminator for add-to-cart intent — not a persisted entity. */
|
|
16
|
+
export declare const AddCheckoutLineKind: {
|
|
17
|
+
readonly CATALOG_SERVICE: "catalog_service";
|
|
18
|
+
readonly CATALOG_COMBO: "catalog_combo";
|
|
19
|
+
readonly APPOINTMENT_ROW: "appointment_row";
|
|
20
|
+
readonly GIFT_CARD: "gift_card";
|
|
21
|
+
readonly CATALOG_PRODUCT: "catalog_product";
|
|
22
|
+
readonly PACKAGE: "package";
|
|
23
|
+
};
|
|
24
|
+
export type AddCheckoutLineKind = (typeof AddCheckoutLineKind)[keyof typeof AddCheckoutLineKind];
|
|
25
|
+
/** Persisted line item types — ADR exclusive arc (appointment = service + refs in v1). */
|
|
26
|
+
export declare const CheckoutOrderLineItemType: {
|
|
27
|
+
readonly SERVICE: "service";
|
|
28
|
+
readonly GIFT_CARD: "gift_card";
|
|
29
|
+
readonly PRODUCT: "product";
|
|
30
|
+
readonly PACKAGE: "package";
|
|
31
|
+
};
|
|
32
|
+
export type CheckoutOrderLineItemType = (typeof CheckoutOrderLineItemType)[keyof typeof CheckoutOrderLineItemType];
|
|
33
|
+
//# sourceMappingURL=checkout-order.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-order.constants.d.ts","sourceRoot":"","sources":["../../../src/api/checkout-orders/checkout-order.constants.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,qEAAqE;AACrE,eAAO,MAAM,mBAAmB;;;;;;;CAOtB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,0FAA0F;AAC1F,eAAO,MAAM,yBAAyB;;;;;CAK5B,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckoutOrderLineItemType = exports.AddCheckoutLineKind = exports.CheckoutOrderSource = exports.CheckoutOrderStatus = void 0;
|
|
4
|
+
/** Checkout order lifecycle — distinct from invoice status. */
|
|
5
|
+
exports.CheckoutOrderStatus = {
|
|
6
|
+
OPEN: 'open',
|
|
7
|
+
ABANDONED: 'abandoned',
|
|
8
|
+
FINALIZED: 'finalized',
|
|
9
|
+
};
|
|
10
|
+
/** How the checkout order was started — informational for analytics and UI. */
|
|
11
|
+
exports.CheckoutOrderSource = {
|
|
12
|
+
QUICK_SALE: 'quick_sale',
|
|
13
|
+
APPOINTMENT_CHECKOUT: 'appointment_checkout',
|
|
14
|
+
MIXED: 'mixed',
|
|
15
|
+
};
|
|
16
|
+
/** Discriminator for add-to-cart intent — not a persisted entity. */
|
|
17
|
+
exports.AddCheckoutLineKind = {
|
|
18
|
+
CATALOG_SERVICE: 'catalog_service',
|
|
19
|
+
CATALOG_COMBO: 'catalog_combo',
|
|
20
|
+
APPOINTMENT_ROW: 'appointment_row',
|
|
21
|
+
GIFT_CARD: 'gift_card',
|
|
22
|
+
CATALOG_PRODUCT: 'catalog_product',
|
|
23
|
+
PACKAGE: 'package',
|
|
24
|
+
};
|
|
25
|
+
/** Persisted line item types — ADR exclusive arc (appointment = service + refs in v1). */
|
|
26
|
+
exports.CheckoutOrderLineItemType = {
|
|
27
|
+
SERVICE: 'service',
|
|
28
|
+
GIFT_CARD: 'gift_card',
|
|
29
|
+
PRODUCT: 'product',
|
|
30
|
+
PACKAGE: 'package',
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=checkout-order.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-order.constants.js","sourceRoot":"","sources":["../../../src/api/checkout-orders/checkout-order.constants.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAClD,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;CACd,CAAC;AAKX,+EAA+E;AAClE,QAAA,mBAAmB,GAAG;IACjC,UAAU,EAAE,YAAY;IACxB,oBAAoB,EAAE,sBAAsB;IAC5C,KAAK,EAAE,OAAO;CACN,CAAC;AAKX,qEAAqE;AACxD,QAAA,mBAAmB,GAAG;IACjC,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,eAAe,EAAE,iBAAiB;IAClC,SAAS,EAAE,WAAW;IACtB,eAAe,EAAE,iBAAiB;IAClC,OAAO,EAAE,SAAS;CACV,CAAC;AAKX,0FAA0F;AAC7E,QAAA,yBAAyB,GAAG;IACvC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { PhoneNumberModel } from '../../models/phone-number-model';
|
|
2
|
+
import type { DiscountType } from '../../enum/discount-type';
|
|
3
|
+
import type { ClientKind } from '../client-kind';
|
|
4
|
+
import type { TaxDetailDto } from '../invoices/invoice.dto';
|
|
5
|
+
import type { CheckoutOrderLineItemType, CheckoutOrderSource, CheckoutOrderStatus } from './checkout-order.constants';
|
|
6
|
+
export interface CheckoutOrderPreviewLineDto {
|
|
7
|
+
lineId: string;
|
|
8
|
+
itemType: CheckoutOrderLineItemType;
|
|
9
|
+
itemName: string;
|
|
10
|
+
staffId: string;
|
|
11
|
+
staffName: string;
|
|
12
|
+
staffId2: string | null;
|
|
13
|
+
staffName2: string | null;
|
|
14
|
+
quantity: string;
|
|
15
|
+
sortOrder: number;
|
|
16
|
+
unitPrice: string;
|
|
17
|
+
lineSubtotal: string;
|
|
18
|
+
lineDiscountType: DiscountType | null;
|
|
19
|
+
lineDiscountValue: string | null;
|
|
20
|
+
lineDiscountAmount: string;
|
|
21
|
+
cartDiscountAmount: string;
|
|
22
|
+
lineNet: string;
|
|
23
|
+
taxAmount: string;
|
|
24
|
+
lineTotal: string;
|
|
25
|
+
taxDetails: TaxDetailDto[];
|
|
26
|
+
/** Set when line belongs to a combo bundle */
|
|
27
|
+
comboId: string | null;
|
|
28
|
+
comboName: string | null;
|
|
29
|
+
/** Service line catalog refs */
|
|
30
|
+
serviceId: string | null;
|
|
31
|
+
serviceVariantId: string | null;
|
|
32
|
+
durationMinutes: number | null;
|
|
33
|
+
appointmentId: string | null;
|
|
34
|
+
appointmentItemId: string | null;
|
|
35
|
+
/** Gift card line refs */
|
|
36
|
+
giftCardProductId: string | null;
|
|
37
|
+
faceValue: string | null;
|
|
38
|
+
salePrice: string | null;
|
|
39
|
+
isGift: boolean | null;
|
|
40
|
+
customCode: string | null;
|
|
41
|
+
/** True when line discount is blocked (combo-group lines) */
|
|
42
|
+
lineDiscountDisabled: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface CheckoutOrderPreviewDto {
|
|
45
|
+
subtotal: string;
|
|
46
|
+
lineDiscountTotal: string;
|
|
47
|
+
cartDiscountTotal: string;
|
|
48
|
+
discountTotal: string;
|
|
49
|
+
taxTotal: string;
|
|
50
|
+
grandTotal: string;
|
|
51
|
+
lines: CheckoutOrderPreviewLineDto[];
|
|
52
|
+
}
|
|
53
|
+
export interface CheckoutOrderSummaryDto {
|
|
54
|
+
id: string;
|
|
55
|
+
orderNumber: string;
|
|
56
|
+
status: CheckoutOrderStatus;
|
|
57
|
+
source: CheckoutOrderSource;
|
|
58
|
+
locationId: string;
|
|
59
|
+
locationName: string;
|
|
60
|
+
clientType: ClientKind;
|
|
61
|
+
clientId: string | null;
|
|
62
|
+
clientDisplayName: string | null;
|
|
63
|
+
isDraft: boolean;
|
|
64
|
+
draftSavedAt: string | null;
|
|
65
|
+
lastActivityAt: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
/** Preview grand total — from last preview cache */
|
|
68
|
+
previewTotal: string | null;
|
|
69
|
+
}
|
|
70
|
+
export interface CheckoutOrderDetailDto extends CheckoutOrderSummaryDto {
|
|
71
|
+
clientPhone: PhoneNumberModel | null;
|
|
72
|
+
clientEmail: string | null;
|
|
73
|
+
cartDiscountType: DiscountType | null;
|
|
74
|
+
cartDiscountValue: string | null;
|
|
75
|
+
receivedByStaffId: string;
|
|
76
|
+
receivedByStaffName: string;
|
|
77
|
+
createdByStaffId: string;
|
|
78
|
+
invoiceDate: string | null;
|
|
79
|
+
note: string | null;
|
|
80
|
+
abandonedAt: string | null;
|
|
81
|
+
finalizedInvoiceId: string | null;
|
|
82
|
+
preview: CheckoutOrderPreviewDto;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=checkout-order.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-order.dto.d.ts","sourceRoot":"","sources":["../../../src/api/checkout-orders/checkout-order.dto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,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,CAAC;IAC3B,gBAAgB,EAAE,YAAY,GAAG,IAAI,CAAC;IACtC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,uBAAuB,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-order.dto.js","sourceRoot":"","sources":["../../../src/api/checkout-orders/checkout-order.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { PhoneNumberModel } from '../../models/phone-number-model';
|
|
2
|
+
import type { DiscountType } from '../../enum/discount-type';
|
|
3
|
+
import type { ClientKind } from '../client-kind';
|
|
4
|
+
import type { PaginatedResult } from '../pagination';
|
|
5
|
+
import type { FinalizeInvoicePaymentRequest, FinalizeInvoicePreview } from '../invoices/invoice.requests';
|
|
6
|
+
import type { InvoiceSettlementMode } from '../invoices/invoice.constants';
|
|
7
|
+
import type { InvoiceDetailDto } from '../invoices/invoice.dto';
|
|
8
|
+
import type { AddCheckoutLineKind, CheckoutOrderSource, CheckoutOrderStatus } from './checkout-order.constants';
|
|
9
|
+
import type { CheckoutOrderDetailDto, CheckoutOrderSummaryDto } from './checkout-order.dto';
|
|
10
|
+
export interface CreateCheckoutOrderRequest {
|
|
11
|
+
locationId: string;
|
|
12
|
+
source?: CheckoutOrderSource;
|
|
13
|
+
/** Seed appointment checkout — optional at create */
|
|
14
|
+
appointmentIds?: string[];
|
|
15
|
+
clientType?: ClientKind;
|
|
16
|
+
clientId?: string | null;
|
|
17
|
+
clientDisplayName?: string | null;
|
|
18
|
+
clientPhone?: PhoneNumberModel | null;
|
|
19
|
+
clientEmail?: string | null;
|
|
20
|
+
receivedByStaffId?: string;
|
|
21
|
+
invoiceDate?: string | null;
|
|
22
|
+
note?: string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface AddCatalogServiceLineRequest {
|
|
25
|
+
kind: typeof AddCheckoutLineKind.CATALOG_SERVICE;
|
|
26
|
+
serviceVariantId: string;
|
|
27
|
+
staffId: string;
|
|
28
|
+
staffId2?: string | null;
|
|
29
|
+
quantity?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface AddCatalogComboLineRequest {
|
|
32
|
+
kind: typeof AddCheckoutLineKind.CATALOG_COMBO;
|
|
33
|
+
comboId: string;
|
|
34
|
+
staffId: string;
|
|
35
|
+
staffId2?: string | null;
|
|
36
|
+
}
|
|
37
|
+
export interface AddAppointmentRowLineRequest {
|
|
38
|
+
kind: typeof AddCheckoutLineKind.APPOINTMENT_ROW;
|
|
39
|
+
/** Cart selection key — groupId for groups, else appointment id */
|
|
40
|
+
rowId?: string;
|
|
41
|
+
/** Alternative: explicit appointment ids when row already resolved client-side */
|
|
42
|
+
appointmentIds?: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface AddGiftCardLineRequest {
|
|
45
|
+
kind: typeof AddCheckoutLineKind.GIFT_CARD;
|
|
46
|
+
giftCardProductId: string;
|
|
47
|
+
faceValue: string;
|
|
48
|
+
salePrice: string;
|
|
49
|
+
isGift: boolean;
|
|
50
|
+
customCode?: string | null;
|
|
51
|
+
staffId: string;
|
|
52
|
+
}
|
|
53
|
+
export interface AddCatalogProductLineRequest {
|
|
54
|
+
kind: typeof AddCheckoutLineKind.CATALOG_PRODUCT;
|
|
55
|
+
productId: string;
|
|
56
|
+
staffId: string;
|
|
57
|
+
quantity?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface AddPackageLineRequest {
|
|
60
|
+
kind: typeof AddCheckoutLineKind.PACKAGE;
|
|
61
|
+
packageId: string;
|
|
62
|
+
staffId: string;
|
|
63
|
+
}
|
|
64
|
+
export type AddCheckoutLineRequest = AddCatalogServiceLineRequest | AddCatalogComboLineRequest | AddAppointmentRowLineRequest | AddGiftCardLineRequest | AddCatalogProductLineRequest | AddPackageLineRequest;
|
|
65
|
+
export interface UpdateCheckoutOrderRequest {
|
|
66
|
+
clientType?: ClientKind;
|
|
67
|
+
clientId?: string | null;
|
|
68
|
+
clientDisplayName?: string | null;
|
|
69
|
+
clientPhone?: PhoneNumberModel | null;
|
|
70
|
+
clientEmail?: string | null;
|
|
71
|
+
receivedByStaffId?: string;
|
|
72
|
+
invoiceDate?: string | null;
|
|
73
|
+
note?: string | null;
|
|
74
|
+
cartDiscountType?: DiscountType | null;
|
|
75
|
+
cartDiscountValue?: string | null;
|
|
76
|
+
isDraft?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface UpdateCheckoutOrderLineRequest {
|
|
79
|
+
staffId?: string;
|
|
80
|
+
staffId2?: string | null;
|
|
81
|
+
quantity?: string;
|
|
82
|
+
lineDiscountType?: DiscountType | null;
|
|
83
|
+
lineDiscountValue?: string | null;
|
|
84
|
+
}
|
|
85
|
+
export interface ListCheckoutOrdersQuery {
|
|
86
|
+
page?: number;
|
|
87
|
+
pageSize?: number;
|
|
88
|
+
status?: CheckoutOrderStatus;
|
|
89
|
+
isDraft?: boolean;
|
|
90
|
+
locationId?: string;
|
|
91
|
+
}
|
|
92
|
+
export type CheckoutOrderListResult = PaginatedResult<CheckoutOrderSummaryDto>;
|
|
93
|
+
export interface FinalizeCheckoutOrderRequest {
|
|
94
|
+
/** Calendar date in company timezone — YYYY-MM-DD */
|
|
95
|
+
invoiceDate: string;
|
|
96
|
+
clientType: ClientKind;
|
|
97
|
+
clientId?: string | null;
|
|
98
|
+
clientDisplayName?: string | null;
|
|
99
|
+
clientPhone?: PhoneNumberModel | null;
|
|
100
|
+
clientEmail?: string | null;
|
|
101
|
+
note?: string | null;
|
|
102
|
+
receivedByStaffId: string;
|
|
103
|
+
cartDiscountValue?: string;
|
|
104
|
+
cartDiscountType?: DiscountType | null;
|
|
105
|
+
settlementMode: InvoiceSettlementMode;
|
|
106
|
+
payments?: FinalizeInvoicePaymentRequest[];
|
|
107
|
+
preview: FinalizeInvoicePreview;
|
|
108
|
+
}
|
|
109
|
+
export type FinalizeCheckoutOrderResponse = InvoiceDetailDto;
|
|
110
|
+
export type CreateCheckoutOrderResponse = CheckoutOrderDetailDto;
|
|
111
|
+
export type GetCheckoutOrderResponse = CheckoutOrderDetailDto;
|
|
112
|
+
export type AddCheckoutLineResponse = CheckoutOrderDetailDto;
|
|
113
|
+
export type UpdateCheckoutOrderResponse = CheckoutOrderDetailDto;
|
|
114
|
+
export type UpdateCheckoutOrderLineResponse = CheckoutOrderDetailDto;
|
|
115
|
+
export type PreviewCheckoutOrderResponse = CheckoutOrderDetailDto;
|
|
116
|
+
//# sourceMappingURL=checkout-order.requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-order.requests.d.ts","sourceRoot":"","sources":["../../../src/api/checkout-orders/checkout-order.requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EACV,6BAA6B,EAC7B,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EA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CAAC;AACjE,MAAM,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC9D,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAC7D,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,CAAC;AACjE,MAAM,MAAM,+BAA+B,GAAG,sBAAsB,CAAC;AACrE,MAAM,MAAM,4BAA4B,GAAG,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout-order.requests.js","sourceRoot":"","sources":["../../../src/api/checkout-orders/checkout-order.requests.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/checkout-orders/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./checkout-order.constants"), exports);
|
|
18
|
+
__exportStar(require("./checkout-order.dto"), exports);
|
|
19
|
+
__exportStar(require("./checkout-order.requests"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/checkout-orders/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,uDAAqC;AACrC,4DAA0C"}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * from './permissions/index';
|
|
|
31
31
|
export * from './payment-methods/index';
|
|
32
32
|
export * from './clients/index';
|
|
33
33
|
export * from './invoices/index';
|
|
34
|
+
export * from './checkout-orders/index';
|
|
34
35
|
export * from './payment-transactions/index';
|
|
35
36
|
export * from './gift-cards/index';
|
|
36
37
|
export * from './reports/gift-cards/index';
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,C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ACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
|
package/dist/api/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __exportStar(require("./permissions/index"), exports);
|
|
|
47
47
|
__exportStar(require("./payment-methods/index"), exports);
|
|
48
48
|
__exportStar(require("./clients/index"), exports);
|
|
49
49
|
__exportStar(require("./invoices/index"), exports);
|
|
50
|
+
__exportStar(require("./checkout-orders/index"), exports);
|
|
50
51
|
__exportStar(require("./payment-transactions/index"), exports);
|
|
51
52
|
__exportStar(require("./gift-cards/index"), exports);
|
|
52
53
|
__exportStar(require("./reports/gift-cards/index"), exports);
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,gDAA8B;AAC9B,0CAAwB;AACxB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,2CAAyB;AACzB,+CAA6B;AAC7B,8CAA4B;AAC5B,qDAAmC;AACnC,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC;AACrC,6DAA2C;AAC3C,uDAAqC;AACrC,mDAAiC;AACjC,6CAA2B;AAC3B,mDAAiC;AACjC,+CAA6B;AAC7B,2DAAyC;AACzC,oDAAkC;AAClC,gDAA8B;AAC9B,uDAAqC;AACrC,oDAAkC;AAClC,4DAA0C;AAC1C,6DAA2C;AAC3C,mDAAiC;AACjC,yDAAuC;AACvC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,kDAAgC;AAChC,mDAAiC;AACjC,+DAA6C;AAC7C,qDAAmC;AACnC,6DAA2C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAqE;AACrE,gDAA8B;AAC9B,0CAAwB;AACxB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,2CAAyB;AACzB,+CAA6B;AAC7B,8CAA4B;AAC5B,qDAAmC;AACnC,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC;AACrC,6DAA2C;AAC3C,uDAAqC;AACrC,mDAAiC;AACjC,6CAA2B;AAC3B,mDAAiC;AACjC,+CAA6B;AAC7B,2DAAyC;AACzC,oDAAkC;AAClC,gDAA8B;AAC9B,uDAAqC;AACrC,oDAAkC;AAClC,4DAA0C;AAC1C,6DAA2C;AAC3C,mDAAiC;AACjC,yDAAuC;AACvC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,kDAAgC;AAChC,mDAAiC;AACjC,0DAAwC;AACxC,+DAA6C;AAC7C,qDAAmC;AACnC,6DAA2C"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Checkout order lifecycle — distinct from invoice status. */
|
|
2
|
+
export const CheckoutOrderStatus = {
|
|
3
|
+
OPEN: 'open',
|
|
4
|
+
ABANDONED: 'abandoned',
|
|
5
|
+
FINALIZED: 'finalized',
|
|
6
|
+
} as const;
|
|
7
|
+
|
|
8
|
+
export type CheckoutOrderStatus =
|
|
9
|
+
(typeof CheckoutOrderStatus)[keyof typeof CheckoutOrderStatus];
|
|
10
|
+
|
|
11
|
+
/** How the checkout order was started — informational for analytics and UI. */
|
|
12
|
+
export const CheckoutOrderSource = {
|
|
13
|
+
QUICK_SALE: 'quick_sale',
|
|
14
|
+
APPOINTMENT_CHECKOUT: 'appointment_checkout',
|
|
15
|
+
MIXED: 'mixed',
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export type CheckoutOrderSource =
|
|
19
|
+
(typeof CheckoutOrderSource)[keyof typeof CheckoutOrderSource];
|
|
20
|
+
|
|
21
|
+
/** Discriminator for add-to-cart intent — not a persisted entity. */
|
|
22
|
+
export const AddCheckoutLineKind = {
|
|
23
|
+
CATALOG_SERVICE: 'catalog_service',
|
|
24
|
+
CATALOG_COMBO: 'catalog_combo',
|
|
25
|
+
APPOINTMENT_ROW: 'appointment_row',
|
|
26
|
+
GIFT_CARD: 'gift_card',
|
|
27
|
+
CATALOG_PRODUCT: 'catalog_product',
|
|
28
|
+
PACKAGE: 'package',
|
|
29
|
+
} as const;
|
|
30
|
+
|
|
31
|
+
export type AddCheckoutLineKind =
|
|
32
|
+
(typeof AddCheckoutLineKind)[keyof typeof AddCheckoutLineKind];
|
|
33
|
+
|
|
34
|
+
/** Persisted line item types — ADR exclusive arc (appointment = service + refs in v1). */
|
|
35
|
+
export const CheckoutOrderLineItemType = {
|
|
36
|
+
SERVICE: 'service',
|
|
37
|
+
GIFT_CARD: 'gift_card',
|
|
38
|
+
PRODUCT: 'product',
|
|
39
|
+
PACKAGE: 'package',
|
|
40
|
+
} as const;
|
|
41
|
+
|
|
42
|
+
export type CheckoutOrderLineItemType =
|
|
43
|
+
(typeof CheckoutOrderLineItemType)[keyof typeof CheckoutOrderLineItemType];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { PhoneNumberModel } from '../../models/phone-number-model';
|
|
2
|
+
import type { DiscountType } from '../../enum/discount-type';
|
|
3
|
+
import type { ClientKind } from '../client-kind';
|
|
4
|
+
import type { TaxDetailDto } from '../invoices/invoice.dto';
|
|
5
|
+
import type {
|
|
6
|
+
CheckoutOrderLineItemType,
|
|
7
|
+
CheckoutOrderSource,
|
|
8
|
+
CheckoutOrderStatus,
|
|
9
|
+
} from './checkout-order.constants';
|
|
10
|
+
|
|
11
|
+
export interface CheckoutOrderPreviewLineDto {
|
|
12
|
+
lineId: string;
|
|
13
|
+
itemType: CheckoutOrderLineItemType;
|
|
14
|
+
itemName: string;
|
|
15
|
+
staffId: string;
|
|
16
|
+
staffName: string;
|
|
17
|
+
staffId2: string | null;
|
|
18
|
+
staffName2: string | null;
|
|
19
|
+
quantity: string;
|
|
20
|
+
sortOrder: number;
|
|
21
|
+
unitPrice: string;
|
|
22
|
+
lineSubtotal: string;
|
|
23
|
+
lineDiscountType: DiscountType | null;
|
|
24
|
+
lineDiscountValue: string | null;
|
|
25
|
+
lineDiscountAmount: string;
|
|
26
|
+
cartDiscountAmount: string;
|
|
27
|
+
lineNet: string;
|
|
28
|
+
taxAmount: string;
|
|
29
|
+
lineTotal: string;
|
|
30
|
+
taxDetails: TaxDetailDto[];
|
|
31
|
+
/** Set when line belongs to a combo bundle */
|
|
32
|
+
comboId: string | null;
|
|
33
|
+
comboName: string | null;
|
|
34
|
+
/** Service line catalog refs */
|
|
35
|
+
serviceId: string | null;
|
|
36
|
+
serviceVariantId: string | null;
|
|
37
|
+
durationMinutes: number | null;
|
|
38
|
+
appointmentId: string | null;
|
|
39
|
+
appointmentItemId: string | null;
|
|
40
|
+
/** Gift card line refs */
|
|
41
|
+
giftCardProductId: string | null;
|
|
42
|
+
faceValue: string | null;
|
|
43
|
+
salePrice: string | null;
|
|
44
|
+
isGift: boolean | null;
|
|
45
|
+
customCode: string | null;
|
|
46
|
+
/** True when line discount is blocked (combo-group lines) */
|
|
47
|
+
lineDiscountDisabled: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CheckoutOrderPreviewDto {
|
|
51
|
+
subtotal: string;
|
|
52
|
+
lineDiscountTotal: string;
|
|
53
|
+
cartDiscountTotal: string;
|
|
54
|
+
discountTotal: string;
|
|
55
|
+
taxTotal: string;
|
|
56
|
+
grandTotal: string;
|
|
57
|
+
lines: CheckoutOrderPreviewLineDto[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface CheckoutOrderSummaryDto {
|
|
61
|
+
id: string;
|
|
62
|
+
orderNumber: string;
|
|
63
|
+
status: CheckoutOrderStatus;
|
|
64
|
+
source: CheckoutOrderSource;
|
|
65
|
+
locationId: string;
|
|
66
|
+
locationName: string;
|
|
67
|
+
clientType: ClientKind;
|
|
68
|
+
clientId: string | null;
|
|
69
|
+
clientDisplayName: string | null;
|
|
70
|
+
isDraft: boolean;
|
|
71
|
+
draftSavedAt: string | null;
|
|
72
|
+
lastActivityAt: string;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
/** Preview grand total — from last preview cache */
|
|
75
|
+
previewTotal: string | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface CheckoutOrderDetailDto extends CheckoutOrderSummaryDto {
|
|
79
|
+
clientPhone: PhoneNumberModel | null;
|
|
80
|
+
clientEmail: string | null;
|
|
81
|
+
cartDiscountType: DiscountType | null;
|
|
82
|
+
cartDiscountValue: string | null;
|
|
83
|
+
receivedByStaffId: string;
|
|
84
|
+
receivedByStaffName: string;
|
|
85
|
+
createdByStaffId: string;
|
|
86
|
+
invoiceDate: string | null;
|
|
87
|
+
note: string | null;
|
|
88
|
+
abandonedAt: string | null;
|
|
89
|
+
finalizedInvoiceId: string | null;
|
|
90
|
+
preview: CheckoutOrderPreviewDto;
|
|
91
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { PhoneNumberModel } from '../../models/phone-number-model';
|
|
2
|
+
import type { DiscountType } from '../../enum/discount-type';
|
|
3
|
+
import type { ClientKind } from '../client-kind';
|
|
4
|
+
import type { PaginatedResult } from '../pagination';
|
|
5
|
+
import type {
|
|
6
|
+
FinalizeInvoicePaymentRequest,
|
|
7
|
+
FinalizeInvoicePreview,
|
|
8
|
+
} from '../invoices/invoice.requests';
|
|
9
|
+
import type { InvoiceSettlementMode } from '../invoices/invoice.constants';
|
|
10
|
+
import type { InvoiceDetailDto } from '../invoices/invoice.dto';
|
|
11
|
+
import type {
|
|
12
|
+
AddCheckoutLineKind,
|
|
13
|
+
CheckoutOrderSource,
|
|
14
|
+
CheckoutOrderStatus,
|
|
15
|
+
} from './checkout-order.constants';
|
|
16
|
+
import type { CheckoutOrderDetailDto, CheckoutOrderSummaryDto } from './checkout-order.dto';
|
|
17
|
+
|
|
18
|
+
export interface CreateCheckoutOrderRequest {
|
|
19
|
+
locationId: string;
|
|
20
|
+
source?: CheckoutOrderSource;
|
|
21
|
+
/** Seed appointment checkout — optional at create */
|
|
22
|
+
appointmentIds?: string[];
|
|
23
|
+
clientType?: ClientKind;
|
|
24
|
+
clientId?: string | null;
|
|
25
|
+
clientDisplayName?: string | null;
|
|
26
|
+
clientPhone?: PhoneNumberModel | null;
|
|
27
|
+
clientEmail?: string | null;
|
|
28
|
+
receivedByStaffId?: string;
|
|
29
|
+
invoiceDate?: string | null;
|
|
30
|
+
note?: string | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface AddCatalogServiceLineRequest {
|
|
34
|
+
kind: typeof AddCheckoutLineKind.CATALOG_SERVICE;
|
|
35
|
+
serviceVariantId: string;
|
|
36
|
+
staffId: string;
|
|
37
|
+
staffId2?: string | null;
|
|
38
|
+
quantity?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface AddCatalogComboLineRequest {
|
|
42
|
+
kind: typeof AddCheckoutLineKind.CATALOG_COMBO;
|
|
43
|
+
comboId: string;
|
|
44
|
+
staffId: string;
|
|
45
|
+
staffId2?: string | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface AddAppointmentRowLineRequest {
|
|
49
|
+
kind: typeof AddCheckoutLineKind.APPOINTMENT_ROW;
|
|
50
|
+
/** Cart selection key — groupId for groups, else appointment id */
|
|
51
|
+
rowId?: string;
|
|
52
|
+
/** Alternative: explicit appointment ids when row already resolved client-side */
|
|
53
|
+
appointmentIds?: string[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface AddGiftCardLineRequest {
|
|
57
|
+
kind: typeof AddCheckoutLineKind.GIFT_CARD;
|
|
58
|
+
giftCardProductId: string;
|
|
59
|
+
faceValue: string;
|
|
60
|
+
salePrice: string;
|
|
61
|
+
isGift: boolean;
|
|
62
|
+
customCode?: string | null;
|
|
63
|
+
staffId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface AddCatalogProductLineRequest {
|
|
67
|
+
kind: typeof AddCheckoutLineKind.CATALOG_PRODUCT;
|
|
68
|
+
productId: string;
|
|
69
|
+
staffId: string;
|
|
70
|
+
quantity?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface AddPackageLineRequest {
|
|
74
|
+
kind: typeof AddCheckoutLineKind.PACKAGE;
|
|
75
|
+
packageId: string;
|
|
76
|
+
staffId: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type AddCheckoutLineRequest =
|
|
80
|
+
| AddCatalogServiceLineRequest
|
|
81
|
+
| AddCatalogComboLineRequest
|
|
82
|
+
| AddAppointmentRowLineRequest
|
|
83
|
+
| AddGiftCardLineRequest
|
|
84
|
+
| AddCatalogProductLineRequest
|
|
85
|
+
| AddPackageLineRequest;
|
|
86
|
+
|
|
87
|
+
export interface UpdateCheckoutOrderRequest {
|
|
88
|
+
clientType?: ClientKind;
|
|
89
|
+
clientId?: string | null;
|
|
90
|
+
clientDisplayName?: string | null;
|
|
91
|
+
clientPhone?: PhoneNumberModel | null;
|
|
92
|
+
clientEmail?: string | null;
|
|
93
|
+
receivedByStaffId?: string;
|
|
94
|
+
invoiceDate?: string | null;
|
|
95
|
+
note?: string | null;
|
|
96
|
+
cartDiscountType?: DiscountType | null;
|
|
97
|
+
cartDiscountValue?: string | null;
|
|
98
|
+
isDraft?: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface UpdateCheckoutOrderLineRequest {
|
|
102
|
+
staffId?: string;
|
|
103
|
+
staffId2?: string | null;
|
|
104
|
+
quantity?: string;
|
|
105
|
+
lineDiscountType?: DiscountType | null;
|
|
106
|
+
lineDiscountValue?: string | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface ListCheckoutOrdersQuery {
|
|
110
|
+
page?: number;
|
|
111
|
+
pageSize?: number;
|
|
112
|
+
status?: CheckoutOrderStatus;
|
|
113
|
+
isDraft?: boolean;
|
|
114
|
+
locationId?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type CheckoutOrderListResult = PaginatedResult<CheckoutOrderSummaryDto>;
|
|
118
|
+
|
|
119
|
+
export interface FinalizeCheckoutOrderRequest {
|
|
120
|
+
/** Calendar date in company timezone — YYYY-MM-DD */
|
|
121
|
+
invoiceDate: string;
|
|
122
|
+
clientType: ClientKind;
|
|
123
|
+
clientId?: string | null;
|
|
124
|
+
clientDisplayName?: string | null;
|
|
125
|
+
clientPhone?: PhoneNumberModel | null;
|
|
126
|
+
clientEmail?: string | null;
|
|
127
|
+
note?: string | null;
|
|
128
|
+
receivedByStaffId: string;
|
|
129
|
+
cartDiscountValue?: string;
|
|
130
|
+
cartDiscountType?: DiscountType | null;
|
|
131
|
+
settlementMode: InvoiceSettlementMode;
|
|
132
|
+
payments?: FinalizeInvoicePaymentRequest[];
|
|
133
|
+
preview: FinalizeInvoicePreview;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type FinalizeCheckoutOrderResponse = InvoiceDetailDto;
|
|
137
|
+
|
|
138
|
+
export type CreateCheckoutOrderResponse = CheckoutOrderDetailDto;
|
|
139
|
+
export type GetCheckoutOrderResponse = CheckoutOrderDetailDto;
|
|
140
|
+
export type AddCheckoutLineResponse = CheckoutOrderDetailDto;
|
|
141
|
+
export type UpdateCheckoutOrderResponse = CheckoutOrderDetailDto;
|
|
142
|
+
export type UpdateCheckoutOrderLineResponse = CheckoutOrderDetailDto;
|
|
143
|
+
export type PreviewCheckoutOrderResponse = CheckoutOrderDetailDto;
|
package/src/api/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * from './permissions/index';
|
|
|
31
31
|
export * from './payment-methods/index';
|
|
32
32
|
export * from './clients/index';
|
|
33
33
|
export * from './invoices/index';
|
|
34
|
+
export * from './checkout-orders/index';
|
|
34
35
|
export * from './payment-transactions/index';
|
|
35
36
|
export * from './gift-cards/index';
|
|
36
37
|
export * from './reports/gift-cards/index';
|