@wix/headless-bookings 0.0.70 → 0.0.72

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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared mock data for payment service tests
3
+ */
4
+ import type { CalculateTotalsResponse } from '@wix/auto_sdk_ecom_totals-calculator';
5
+ /**
6
+ * Mock CalculateTotals response with single line item
7
+ */
8
+ export declare const mockCalculateTotalsResponse: CalculateTotalsResponse;
9
+ /**
10
+ * Mock CalculateTotals response with deposit
11
+ */
12
+ export declare const mockCalculateTotalsResponseWithDeposit: CalculateTotalsResponse;
13
+ /**
14
+ * Mock CalculateTotals response with multiple line items
15
+ */
16
+ export declare const mockCalculateTotalsResponseMultipleItems: CalculateTotalsResponse;
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Shared mock data for payment service tests
3
+ */
4
+ /**
5
+ * Mock CalculateTotals response with single line item
6
+ */
7
+ export const mockCalculateTotalsResponse = {
8
+ calculatedLineItems: [
9
+ {
10
+ lineItemId: 'line-item-1',
11
+ pricesBreakdown: {
12
+ totalPriceAfterTax: { amount: '50.00' },
13
+ fullPrice: { amount: '45.00' },
14
+ taxDetails: {
15
+ totalTax: { amount: '5.00' },
16
+ },
17
+ totalDiscount: { amount: '0.00' },
18
+ },
19
+ },
20
+ ],
21
+ priceSummary: {
22
+ subtotal: {
23
+ amount: '50.00',
24
+ convertedAmount: '50.00',
25
+ formattedAmount: '$50.00',
26
+ formattedConvertedAmount: '$50.00',
27
+ },
28
+ total: {
29
+ amount: '50.00',
30
+ convertedAmount: '50.00',
31
+ formattedAmount: '$50.00',
32
+ formattedConvertedAmount: '$50.00',
33
+ },
34
+ tax: {
35
+ amount: '5.00',
36
+ convertedAmount: '5.00',
37
+ formattedAmount: '$5.00',
38
+ formattedConvertedAmount: '$5.00',
39
+ },
40
+ discount: {
41
+ amount: '0.00',
42
+ convertedAmount: '0.00',
43
+ formattedAmount: '$0.00',
44
+ formattedConvertedAmount: '$0.00',
45
+ },
46
+ },
47
+ payNow: {
48
+ total: {
49
+ amount: '50.00',
50
+ convertedAmount: '50.00',
51
+ formattedAmount: '$50.00',
52
+ formattedConvertedAmount: '$50.00',
53
+ },
54
+ },
55
+ payLater: {
56
+ total: {
57
+ amount: '0.00',
58
+ convertedAmount: '0.00',
59
+ formattedAmount: '$0.00',
60
+ formattedConvertedAmount: '$0.00',
61
+ },
62
+ },
63
+ currency: 'USD',
64
+ };
65
+ /**
66
+ * Mock CalculateTotals response with deposit
67
+ */
68
+ export const mockCalculateTotalsResponseWithDeposit = {
69
+ calculatedLineItems: [
70
+ {
71
+ lineItemId: 'line-item-1',
72
+ pricesBreakdown: {
73
+ totalPriceAfterTax: { amount: '100.00' },
74
+ fullPrice: { amount: '90.00' },
75
+ taxDetails: {
76
+ totalTax: { amount: '10.00' },
77
+ },
78
+ totalDiscount: { amount: '0.00' },
79
+ depositAmount: { amount: '30.00' },
80
+ },
81
+ },
82
+ ],
83
+ priceSummary: {
84
+ subtotal: {
85
+ amount: '100.00',
86
+ convertedAmount: '100.00',
87
+ formattedAmount: '$100.00',
88
+ formattedConvertedAmount: '$100.00',
89
+ },
90
+ total: {
91
+ amount: '100.00',
92
+ convertedAmount: '100.00',
93
+ formattedAmount: '$100.00',
94
+ formattedConvertedAmount: '$100.00',
95
+ },
96
+ tax: {
97
+ amount: '10.00',
98
+ convertedAmount: '10.00',
99
+ formattedAmount: '$10.00',
100
+ formattedConvertedAmount: '$10.00',
101
+ },
102
+ discount: {
103
+ amount: '0.00',
104
+ convertedAmount: '0.00',
105
+ formattedAmount: '$0.00',
106
+ formattedConvertedAmount: '$0.00',
107
+ },
108
+ },
109
+ payNow: {
110
+ total: {
111
+ amount: '30.00',
112
+ convertedAmount: '30.00',
113
+ formattedAmount: '$30.00',
114
+ formattedConvertedAmount: '$30.00',
115
+ },
116
+ },
117
+ payLater: {
118
+ total: {
119
+ amount: '70.00',
120
+ convertedAmount: '70.00',
121
+ formattedAmount: '$70.00',
122
+ formattedConvertedAmount: '$70.00',
123
+ },
124
+ },
125
+ currency: 'USD',
126
+ };
127
+ /**
128
+ * Mock CalculateTotals response with multiple line items
129
+ */
130
+ export const mockCalculateTotalsResponseMultipleItems = {
131
+ calculatedLineItems: [
132
+ {
133
+ lineItemId: 'line-item-1',
134
+ pricesBreakdown: {
135
+ totalPriceAfterTax: { amount: '50.00' },
136
+ fullPrice: { amount: '45.00' },
137
+ taxDetails: {
138
+ totalTax: { amount: '5.00' },
139
+ },
140
+ totalDiscount: { amount: '0.00' },
141
+ },
142
+ },
143
+ {
144
+ lineItemId: 'line-item-2',
145
+ pricesBreakdown: {
146
+ totalPriceAfterTax: { amount: '75.00' },
147
+ fullPrice: { amount: '67.50' },
148
+ taxDetails: {
149
+ totalTax: { amount: '7.50' },
150
+ },
151
+ totalDiscount: { amount: '0.00' },
152
+ },
153
+ },
154
+ ],
155
+ priceSummary: {
156
+ subtotal: {
157
+ amount: '125.00',
158
+ convertedAmount: '125.00',
159
+ formattedAmount: '$125.00',
160
+ formattedConvertedAmount: '$125.00',
161
+ },
162
+ total: {
163
+ amount: '125.00',
164
+ convertedAmount: '125.00',
165
+ formattedAmount: '$125.00',
166
+ formattedConvertedAmount: '$125.00',
167
+ },
168
+ tax: {
169
+ amount: '12.50',
170
+ convertedAmount: '12.50',
171
+ formattedAmount: '$12.50',
172
+ formattedConvertedAmount: '$12.50',
173
+ },
174
+ discount: {
175
+ amount: '0.00',
176
+ convertedAmount: '0.00',
177
+ formattedAmount: '$0.00',
178
+ formattedConvertedAmount: '$0.00',
179
+ },
180
+ },
181
+ payNow: {
182
+ total: {
183
+ amount: '125.00',
184
+ convertedAmount: '125.00',
185
+ formattedAmount: '$125.00',
186
+ formattedConvertedAmount: '$125.00',
187
+ },
188
+ },
189
+ payLater: {
190
+ total: {
191
+ amount: '0.00',
192
+ convertedAmount: '0.00',
193
+ formattedAmount: '$0.00',
194
+ formattedConvertedAmount: '$0.00',
195
+ },
196
+ },
197
+ currency: 'USD',
198
+ };
@@ -131,3 +131,11 @@ export declare const mockSingleStaffMemberListConfig: StaffMemberListServiceConf
131
131
  * Helper to create a large list of staff members for tests
132
132
  */
133
133
  export declare function createLargeStaffMemberList(count: number): StaffMember[];
134
+ /**
135
+ * Mock service with deposit configured
136
+ */
137
+ export declare const mockServiceWithDeposit: Service;
138
+ /**
139
+ * Mock service with in-person payment option
140
+ */
141
+ export declare const mockServiceInPerson: Service;
@@ -442,3 +442,47 @@ export function createLargeStaffMemberList(count) {
442
442
  },
443
443
  }));
444
444
  }
445
+ // ============================================================================
446
+ // Payment Service Mocks
447
+ // ============================================================================
448
+ /**
449
+ * Mock service with deposit configured
450
+ */
451
+ export const mockServiceWithDeposit = {
452
+ ...mockService,
453
+ _id: 'test-service-deposit',
454
+ name: 'Service with Deposit',
455
+ payment: {
456
+ rateType: RateType.FIXED,
457
+ fixed: {
458
+ price: {
459
+ value: '100.00',
460
+ currency: 'USD',
461
+ },
462
+ deposit: {
463
+ value: '30.00',
464
+ currency: 'USD',
465
+ },
466
+ },
467
+ },
468
+ };
469
+ /**
470
+ * Mock service with in-person payment option
471
+ */
472
+ export const mockServiceInPerson = {
473
+ ...mockService,
474
+ _id: 'test-service-in-person',
475
+ name: 'In Person Payment Service',
476
+ payment: {
477
+ rateType: RateType.FIXED,
478
+ fixed: {
479
+ price: {
480
+ value: '50.00',
481
+ currency: 'USD',
482
+ },
483
+ },
484
+ options: {
485
+ inPerson: true,
486
+ },
487
+ },
488
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared mock data for payment service tests
3
+ */
4
+ import type { CalculateTotalsResponse } from '@wix/auto_sdk_ecom_totals-calculator';
5
+ /**
6
+ * Mock CalculateTotals response with single line item
7
+ */
8
+ export declare const mockCalculateTotalsResponse: CalculateTotalsResponse;
9
+ /**
10
+ * Mock CalculateTotals response with deposit
11
+ */
12
+ export declare const mockCalculateTotalsResponseWithDeposit: CalculateTotalsResponse;
13
+ /**
14
+ * Mock CalculateTotals response with multiple line items
15
+ */
16
+ export declare const mockCalculateTotalsResponseMultipleItems: CalculateTotalsResponse;
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Shared mock data for payment service tests
3
+ */
4
+ /**
5
+ * Mock CalculateTotals response with single line item
6
+ */
7
+ export const mockCalculateTotalsResponse = {
8
+ calculatedLineItems: [
9
+ {
10
+ lineItemId: 'line-item-1',
11
+ pricesBreakdown: {
12
+ totalPriceAfterTax: { amount: '50.00' },
13
+ fullPrice: { amount: '45.00' },
14
+ taxDetails: {
15
+ totalTax: { amount: '5.00' },
16
+ },
17
+ totalDiscount: { amount: '0.00' },
18
+ },
19
+ },
20
+ ],
21
+ priceSummary: {
22
+ subtotal: {
23
+ amount: '50.00',
24
+ convertedAmount: '50.00',
25
+ formattedAmount: '$50.00',
26
+ formattedConvertedAmount: '$50.00',
27
+ },
28
+ total: {
29
+ amount: '50.00',
30
+ convertedAmount: '50.00',
31
+ formattedAmount: '$50.00',
32
+ formattedConvertedAmount: '$50.00',
33
+ },
34
+ tax: {
35
+ amount: '5.00',
36
+ convertedAmount: '5.00',
37
+ formattedAmount: '$5.00',
38
+ formattedConvertedAmount: '$5.00',
39
+ },
40
+ discount: {
41
+ amount: '0.00',
42
+ convertedAmount: '0.00',
43
+ formattedAmount: '$0.00',
44
+ formattedConvertedAmount: '$0.00',
45
+ },
46
+ },
47
+ payNow: {
48
+ total: {
49
+ amount: '50.00',
50
+ convertedAmount: '50.00',
51
+ formattedAmount: '$50.00',
52
+ formattedConvertedAmount: '$50.00',
53
+ },
54
+ },
55
+ payLater: {
56
+ total: {
57
+ amount: '0.00',
58
+ convertedAmount: '0.00',
59
+ formattedAmount: '$0.00',
60
+ formattedConvertedAmount: '$0.00',
61
+ },
62
+ },
63
+ currency: 'USD',
64
+ };
65
+ /**
66
+ * Mock CalculateTotals response with deposit
67
+ */
68
+ export const mockCalculateTotalsResponseWithDeposit = {
69
+ calculatedLineItems: [
70
+ {
71
+ lineItemId: 'line-item-1',
72
+ pricesBreakdown: {
73
+ totalPriceAfterTax: { amount: '100.00' },
74
+ fullPrice: { amount: '90.00' },
75
+ taxDetails: {
76
+ totalTax: { amount: '10.00' },
77
+ },
78
+ totalDiscount: { amount: '0.00' },
79
+ depositAmount: { amount: '30.00' },
80
+ },
81
+ },
82
+ ],
83
+ priceSummary: {
84
+ subtotal: {
85
+ amount: '100.00',
86
+ convertedAmount: '100.00',
87
+ formattedAmount: '$100.00',
88
+ formattedConvertedAmount: '$100.00',
89
+ },
90
+ total: {
91
+ amount: '100.00',
92
+ convertedAmount: '100.00',
93
+ formattedAmount: '$100.00',
94
+ formattedConvertedAmount: '$100.00',
95
+ },
96
+ tax: {
97
+ amount: '10.00',
98
+ convertedAmount: '10.00',
99
+ formattedAmount: '$10.00',
100
+ formattedConvertedAmount: '$10.00',
101
+ },
102
+ discount: {
103
+ amount: '0.00',
104
+ convertedAmount: '0.00',
105
+ formattedAmount: '$0.00',
106
+ formattedConvertedAmount: '$0.00',
107
+ },
108
+ },
109
+ payNow: {
110
+ total: {
111
+ amount: '30.00',
112
+ convertedAmount: '30.00',
113
+ formattedAmount: '$30.00',
114
+ formattedConvertedAmount: '$30.00',
115
+ },
116
+ },
117
+ payLater: {
118
+ total: {
119
+ amount: '70.00',
120
+ convertedAmount: '70.00',
121
+ formattedAmount: '$70.00',
122
+ formattedConvertedAmount: '$70.00',
123
+ },
124
+ },
125
+ currency: 'USD',
126
+ };
127
+ /**
128
+ * Mock CalculateTotals response with multiple line items
129
+ */
130
+ export const mockCalculateTotalsResponseMultipleItems = {
131
+ calculatedLineItems: [
132
+ {
133
+ lineItemId: 'line-item-1',
134
+ pricesBreakdown: {
135
+ totalPriceAfterTax: { amount: '50.00' },
136
+ fullPrice: { amount: '45.00' },
137
+ taxDetails: {
138
+ totalTax: { amount: '5.00' },
139
+ },
140
+ totalDiscount: { amount: '0.00' },
141
+ },
142
+ },
143
+ {
144
+ lineItemId: 'line-item-2',
145
+ pricesBreakdown: {
146
+ totalPriceAfterTax: { amount: '75.00' },
147
+ fullPrice: { amount: '67.50' },
148
+ taxDetails: {
149
+ totalTax: { amount: '7.50' },
150
+ },
151
+ totalDiscount: { amount: '0.00' },
152
+ },
153
+ },
154
+ ],
155
+ priceSummary: {
156
+ subtotal: {
157
+ amount: '125.00',
158
+ convertedAmount: '125.00',
159
+ formattedAmount: '$125.00',
160
+ formattedConvertedAmount: '$125.00',
161
+ },
162
+ total: {
163
+ amount: '125.00',
164
+ convertedAmount: '125.00',
165
+ formattedAmount: '$125.00',
166
+ formattedConvertedAmount: '$125.00',
167
+ },
168
+ tax: {
169
+ amount: '12.50',
170
+ convertedAmount: '12.50',
171
+ formattedAmount: '$12.50',
172
+ formattedConvertedAmount: '$12.50',
173
+ },
174
+ discount: {
175
+ amount: '0.00',
176
+ convertedAmount: '0.00',
177
+ formattedAmount: '$0.00',
178
+ formattedConvertedAmount: '$0.00',
179
+ },
180
+ },
181
+ payNow: {
182
+ total: {
183
+ amount: '125.00',
184
+ convertedAmount: '125.00',
185
+ formattedAmount: '$125.00',
186
+ formattedConvertedAmount: '$125.00',
187
+ },
188
+ },
189
+ payLater: {
190
+ total: {
191
+ amount: '0.00',
192
+ convertedAmount: '0.00',
193
+ formattedAmount: '$0.00',
194
+ formattedConvertedAmount: '$0.00',
195
+ },
196
+ },
197
+ currency: 'USD',
198
+ };
@@ -131,3 +131,11 @@ export declare const mockSingleStaffMemberListConfig: StaffMemberListServiceConf
131
131
  * Helper to create a large list of staff members for tests
132
132
  */
133
133
  export declare function createLargeStaffMemberList(count: number): StaffMember[];
134
+ /**
135
+ * Mock service with deposit configured
136
+ */
137
+ export declare const mockServiceWithDeposit: Service;
138
+ /**
139
+ * Mock service with in-person payment option
140
+ */
141
+ export declare const mockServiceInPerson: Service;
@@ -442,3 +442,47 @@ export function createLargeStaffMemberList(count) {
442
442
  },
443
443
  }));
444
444
  }
445
+ // ============================================================================
446
+ // Payment Service Mocks
447
+ // ============================================================================
448
+ /**
449
+ * Mock service with deposit configured
450
+ */
451
+ export const mockServiceWithDeposit = {
452
+ ...mockService,
453
+ _id: 'test-service-deposit',
454
+ name: 'Service with Deposit',
455
+ payment: {
456
+ rateType: RateType.FIXED,
457
+ fixed: {
458
+ price: {
459
+ value: '100.00',
460
+ currency: 'USD',
461
+ },
462
+ deposit: {
463
+ value: '30.00',
464
+ currency: 'USD',
465
+ },
466
+ },
467
+ },
468
+ };
469
+ /**
470
+ * Mock service with in-person payment option
471
+ */
472
+ export const mockServiceInPerson = {
473
+ ...mockService,
474
+ _id: 'test-service-in-person',
475
+ name: 'In Person Payment Service',
476
+ payment: {
477
+ rateType: RateType.FIXED,
478
+ fixed: {
479
+ price: {
480
+ value: '50.00',
481
+ currency: 'USD',
482
+ },
483
+ },
484
+ options: {
485
+ inPerson: true,
486
+ },
487
+ },
488
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-bookings",
3
- "version": "0.0.70",
3
+ "version": "0.0.72",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -37,7 +37,7 @@
37
37
  "@wix/auto_sdk_bookings_event-time-slots": "^1.0.64",
38
38
  "@wix/auto_sdk_ecom_checkout": "^1.0.104",
39
39
  "@wix/form-public": "https://cdn.dev.wixpress.com/@wix/form-public/5e033ab77775b2277d596c4663a1446228270e3fc9afa7b2b85c4a94.tar.gz",
40
- "@wix/headless-forms": "0.0.20",
40
+ "@wix/headless-forms": "0.0.21",
41
41
  "@wix/headless-media": "0.0.18",
42
42
  "@wix/headless-utils": "0.0.8",
43
43
  "@wix/services-definitions": "^0.1.4",
@@ -72,5 +72,5 @@
72
72
  "groupId": "com.wixpress.headless-components"
73
73
  }
74
74
  },
75
- "falconPackageHash": "f52a35bc9181ed04c0310b7449e0422171fd803813aa9ac41a48e0c2"
75
+ "falconPackageHash": "fba67207f62950f205edc9cf8dd4f0cd00a1aba8aba35b2ba034c3f2"
76
76
  }