@auto-engineer/server-generator-apollo-emmett 0.2.0 → 0.8.2
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +5 -108
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/codegen/extract/commands.d.ts +11 -5
- package/dist/codegen/extract/commands.d.ts.map +1 -1
- package/dist/codegen/extract/commands.js +27 -12
- package/dist/codegen/extract/commands.js.map +1 -1
- package/dist/codegen/extract/data-sink.d.ts.map +1 -1
- package/dist/codegen/extract/data-sink.js +52 -28
- package/dist/codegen/extract/data-sink.js.map +1 -1
- package/dist/codegen/extract/gwt.d.ts.map +1 -1
- package/dist/codegen/extract/gwt.js +37 -6
- package/dist/codegen/extract/gwt.js.map +1 -1
- package/dist/codegen/extract/messages.d.ts.map +1 -1
- package/dist/codegen/extract/messages.js +38 -6
- package/dist/codegen/extract/messages.js.map +1 -1
- package/dist/codegen/extract/query.d.ts.map +1 -1
- package/dist/codegen/extract/query.js +9 -2
- package/dist/codegen/extract/query.js.map +1 -1
- package/dist/codegen/scaffoldFromSchema.d.ts.map +1 -1
- package/dist/codegen/scaffoldFromSchema.js +21 -6
- package/dist/codegen/scaffoldFromSchema.js.map +1 -1
- package/dist/codegen/templates/command/commands.specs.ts +28 -19
- package/dist/codegen/templates/command/decide.specs.specs.ts +75 -57
- package/dist/codegen/templates/command/decide.specs.ts +147 -110
- package/dist/codegen/templates/command/events.specs.ts +38 -29
- package/dist/codegen/templates/command/evolve.specs.ts +33 -24
- package/dist/codegen/templates/command/handle.specs.ts +61 -43
- package/dist/codegen/templates/command/mutation.resolver.specs.ts +28 -19
- package/dist/codegen/templates/command/register.specs.ts +34 -25
- package/dist/codegen/templates/command/state.specs.ts +34 -25
- package/dist/codegen/templates/query/projection.specs.specs..ts +100 -80
- package/dist/codegen/templates/query/projection.specs.ts +101 -81
- package/dist/codegen/templates/query/query.resolver.specs.ts +2 -2
- package/dist/codegen/templates/query/state.specs.ts +1 -1
- package/dist/codegen/templates/react/react.specs.specs.ts +86 -68
- package/dist/codegen/templates/react/react.specs.ts +123 -96
- package/dist/codegen/templates/react/react.specs.ts.ejs +9 -1
- package/dist/codegen/templates/react/react.ts.ejs +8 -1
- package/dist/codegen/templates/react/register.specs.ts +123 -96
- package/dist/codegen/templates/react/register.ts.ejs +8 -1
- package/dist/codegen/test-data/specVariant1.d.ts.map +1 -1
- package/dist/codegen/test-data/specVariant1.js +92 -65
- package/dist/codegen/test-data/specVariant1.js.map +1 -1
- package/dist/codegen/types.d.ts +4 -4
- package/dist/codegen/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/codegen/extract/commands.ts +48 -19
- package/src/codegen/extract/data-sink.ts +68 -31
- package/src/codegen/extract/gwt.ts +45 -10
- package/src/codegen/extract/messages.ts +49 -7
- package/src/codegen/extract/query.ts +15 -2
- package/src/codegen/scaffoldFromSchema.ts +27 -6
- package/src/codegen/templates/command/commands.specs.ts +28 -19
- package/src/codegen/templates/command/decide.specs.specs.ts +75 -57
- package/src/codegen/templates/command/decide.specs.ts +147 -110
- package/src/codegen/templates/command/events.specs.ts +38 -29
- package/src/codegen/templates/command/evolve.specs.ts +33 -24
- package/src/codegen/templates/command/handle.specs.ts +61 -43
- package/src/codegen/templates/command/mutation.resolver.specs.ts +28 -19
- package/src/codegen/templates/command/register.specs.ts +34 -25
- package/src/codegen/templates/command/state.specs.ts +34 -25
- package/src/codegen/templates/query/projection.specs.specs..ts +100 -80
- package/src/codegen/templates/query/projection.specs.ts +101 -81
- package/src/codegen/templates/query/query.resolver.specs.ts +2 -2
- package/src/codegen/templates/query/state.specs.ts +1 -1
- package/src/codegen/templates/react/react.specs.specs.ts +86 -68
- package/src/codegen/templates/react/react.specs.ts +123 -96
- package/src/codegen/templates/react/react.specs.ts.ejs +9 -1
- package/src/codegen/templates/react/react.ts.ejs +8 -1
- package/src/codegen/templates/react/register.specs.ts +123 -96
- package/src/codegen/templates/react/register.ts.ejs +8 -1
- package/src/codegen/test-data/specVariant1.ts +92 -65
- package/src/codegen/types.ts +4 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -20,46 +20,56 @@ describe('projection.ts.ejs', () => {
|
|
|
20
20
|
},
|
|
21
21
|
server: {
|
|
22
22
|
description: 'handles create/remove listing',
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
specs: {
|
|
24
|
+
name: 'Create/remove listing command',
|
|
25
|
+
rules: [
|
|
26
|
+
{
|
|
27
|
+
description: 'Should handle listing operations',
|
|
28
|
+
examples: [
|
|
29
|
+
{
|
|
30
|
+
description: 'User creates listing successfully',
|
|
31
|
+
when: {
|
|
32
|
+
commandRef: 'CreateListing',
|
|
33
|
+
exampleData: {
|
|
34
|
+
propertyId: 'listing_123',
|
|
35
|
+
title: 'Sea View Flat',
|
|
36
|
+
pricePerNight: 120,
|
|
37
|
+
location: 'Brighton',
|
|
38
|
+
maxGuests: 4,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
then: [
|
|
42
|
+
{
|
|
43
|
+
eventRef: 'ListingCreated',
|
|
44
|
+
exampleData: {
|
|
45
|
+
propertyId: 'listing_123',
|
|
46
|
+
title: 'Sea View Flat',
|
|
47
|
+
pricePerNight: 120,
|
|
48
|
+
location: 'Brighton',
|
|
49
|
+
maxGuests: 4,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
],
|
|
44
53
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
{
|
|
55
|
+
description: 'User removes listing successfully',
|
|
56
|
+
when: {
|
|
57
|
+
commandRef: 'RemoveListing',
|
|
58
|
+
exampleData: {
|
|
59
|
+
propertyId: 'listing_123',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
then: [
|
|
63
|
+
{
|
|
64
|
+
eventRef: 'ListingRemoved',
|
|
65
|
+
exampleData: {},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
54
70
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
eventRef: 'ListingRemoved',
|
|
58
|
-
exampleData: {},
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
],
|
|
71
|
+
],
|
|
72
|
+
},
|
|
63
73
|
},
|
|
64
74
|
},
|
|
65
75
|
{
|
|
@@ -85,50 +95,60 @@ describe('projection.ts.ejs', () => {
|
|
|
85
95
|
},
|
|
86
96
|
},
|
|
87
97
|
],
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
specs: {
|
|
99
|
+
name: 'Search listings query',
|
|
100
|
+
rules: [
|
|
101
|
+
{
|
|
102
|
+
description: 'Should project listings correctly',
|
|
103
|
+
examples: [
|
|
104
|
+
{
|
|
105
|
+
description: 'Listing created shows in search results',
|
|
106
|
+
when: [
|
|
107
|
+
{
|
|
108
|
+
eventRef: 'ListingCreated',
|
|
109
|
+
exampleData: {
|
|
110
|
+
propertyId: 'listing_123',
|
|
111
|
+
title: 'Sea View Flat',
|
|
112
|
+
pricePerNight: 120,
|
|
113
|
+
location: 'Brighton',
|
|
114
|
+
maxGuests: 4,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
then: [
|
|
119
|
+
{
|
|
120
|
+
stateRef: 'AvailableListings',
|
|
121
|
+
exampleData: {
|
|
122
|
+
propertyId: 'listing_123',
|
|
123
|
+
title: 'Sea View Flat',
|
|
124
|
+
pricePerNight: 120,
|
|
125
|
+
location: 'Brighton',
|
|
126
|
+
maxGuests: 4,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
111
130
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
{
|
|
132
|
+
description: 'Listing removed disappears from search results',
|
|
133
|
+
when: [
|
|
134
|
+
{
|
|
135
|
+
eventRef: 'ListingRemoved',
|
|
136
|
+
exampleData: {
|
|
137
|
+
propertyId: 'listing_123',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
then: [
|
|
142
|
+
{
|
|
143
|
+
stateRef: 'AvailableListings',
|
|
144
|
+
exampleData: {},
|
|
145
|
+
},
|
|
146
|
+
],
|
|
121
147
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
stateRef: 'AvailableListings',
|
|
127
|
-
exampleData: {},
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
},
|
|
131
|
-
],
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
132
152
|
},
|
|
133
153
|
},
|
|
134
154
|
],
|
|
@@ -279,7 +299,7 @@ describe('projection.ts.ejs', () => {
|
|
|
279
299
|
},
|
|
280
300
|
},
|
|
281
301
|
],
|
|
282
|
-
|
|
302
|
+
specs: { name: '', rules: [] },
|
|
283
303
|
},
|
|
284
304
|
},
|
|
285
305
|
],
|
|
@@ -43,7 +43,7 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
],
|
|
46
|
-
|
|
46
|
+
specs: { name: '', rules: [] },
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
],
|
|
@@ -166,7 +166,7 @@ describe('query.resolver.ts.ejs', () => {
|
|
|
166
166
|
},
|
|
167
167
|
},
|
|
168
168
|
],
|
|
169
|
-
|
|
169
|
+
specs: { name: '', rules: [] },
|
|
170
170
|
},
|
|
171
171
|
},
|
|
172
172
|
],
|
|
@@ -16,41 +16,50 @@ describe('react.specs.ts.ejs (react slice)', () => {
|
|
|
16
16
|
client: { description: '', specs: [] },
|
|
17
17
|
server: {
|
|
18
18
|
description: '',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
19
|
+
specs: {
|
|
20
|
+
name: 'Guest submits booking request command',
|
|
21
|
+
rules: [
|
|
22
|
+
{
|
|
23
|
+
description: 'Should handle booking request successfully',
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
description: 'User submits booking request successfully',
|
|
27
|
+
when: {
|
|
28
|
+
commandRef: 'RequestBooking',
|
|
29
|
+
exampleData: {
|
|
30
|
+
propertyId: 'listing_123',
|
|
31
|
+
hostId: 'host_123',
|
|
32
|
+
guestId: 'guest_456',
|
|
33
|
+
checkIn: '2025-07-15',
|
|
34
|
+
checkOut: '2025-07-18',
|
|
35
|
+
guests: 2,
|
|
36
|
+
message: 'Looking forward to my stay!',
|
|
37
|
+
metadata: { now: 'bar', bookingId: '123' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
then: [
|
|
41
|
+
{
|
|
42
|
+
eventRef: 'BookingRequested',
|
|
43
|
+
exampleData: {
|
|
44
|
+
bookingId: 'book_xyz789',
|
|
45
|
+
hostId: 'host_123',
|
|
46
|
+
propertyId: 'prop_789',
|
|
47
|
+
guestId: 'guest_456',
|
|
48
|
+
checkIn: '2025-07-15',
|
|
49
|
+
checkOut: '2025-07-18',
|
|
50
|
+
guests: 2,
|
|
51
|
+
message: 'Hey',
|
|
52
|
+
status: 'pending_host_approval',
|
|
53
|
+
requestedAt: '2025-06-10T16:30:00.000Z',
|
|
54
|
+
expiresAt: '2025-06-11T16:30:00.000Z',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
49
58
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
54
63
|
},
|
|
55
64
|
},
|
|
56
65
|
{
|
|
@@ -64,41 +73,50 @@ describe('react.specs.ts.ejs (react slice)', () => {
|
|
|
64
73
|
destination: { type: 'stream', pattern: 'booking-${hostId}' },
|
|
65
74
|
},
|
|
66
75
|
],
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
specs: {
|
|
77
|
+
name: 'Send notification to host reaction',
|
|
78
|
+
rules: [
|
|
79
|
+
{
|
|
80
|
+
description: 'Should send host notification on booking request',
|
|
81
|
+
examples: [
|
|
82
|
+
{
|
|
83
|
+
description: 'Booking request triggers host notification',
|
|
84
|
+
when: [
|
|
85
|
+
{
|
|
86
|
+
eventRef: 'BookingRequested',
|
|
87
|
+
exampleData: {
|
|
88
|
+
bookingId: 'book_xyz789',
|
|
89
|
+
hostId: 'host_123',
|
|
90
|
+
propertyId: 'prop_789',
|
|
91
|
+
guestId: 'guest_456',
|
|
92
|
+
checkIn: '2025-07-15',
|
|
93
|
+
checkOut: '2025-07-18',
|
|
94
|
+
guests: 2,
|
|
95
|
+
message: 'Hey',
|
|
96
|
+
status: 'pending_host_approval',
|
|
97
|
+
requestedAt: '2025-06-10T16:30:00.000Z',
|
|
98
|
+
expiresAt: '2025-06-11T16:30:00.000Z',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
then: [
|
|
103
|
+
{
|
|
104
|
+
commandRef: 'NotifyHost',
|
|
105
|
+
exampleData: {
|
|
106
|
+
hostId: 'host_123',
|
|
107
|
+
notificationType: 'booking_request',
|
|
108
|
+
priority: 'high',
|
|
109
|
+
channels: ['email', 'push'],
|
|
110
|
+
message: 'A guest has requested to book your place.',
|
|
111
|
+
actionRequired: true,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
97
115
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
102
120
|
},
|
|
103
121
|
},
|
|
104
122
|
],
|
|
@@ -16,41 +16,50 @@ describe('handle.ts.ejs (react slice)', () => {
|
|
|
16
16
|
client: { description: '', specs: [] },
|
|
17
17
|
server: {
|
|
18
18
|
description: '',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
19
|
+
specs: {
|
|
20
|
+
name: 'Guest submits booking request command',
|
|
21
|
+
rules: [
|
|
22
|
+
{
|
|
23
|
+
description: 'Should handle booking request successfully',
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
description: 'User submits booking request successfully',
|
|
27
|
+
when: {
|
|
28
|
+
commandRef: 'RequestBooking',
|
|
29
|
+
exampleData: {
|
|
30
|
+
propertyId: 'listing_123',
|
|
31
|
+
hostId: 'host_123',
|
|
32
|
+
guestId: 'guest_456',
|
|
33
|
+
checkIn: '2025-07-15',
|
|
34
|
+
checkOut: '2025-07-18',
|
|
35
|
+
guests: 2,
|
|
36
|
+
message: 'Looking forward to my stay!',
|
|
37
|
+
metadata: { now: 'bar', bookingId: '123' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
then: [
|
|
41
|
+
{
|
|
42
|
+
eventRef: 'BookingRequested',
|
|
43
|
+
exampleData: {
|
|
44
|
+
bookingId: 'book_xyz789',
|
|
45
|
+
hostId: 'host_123',
|
|
46
|
+
propertyId: 'prop_789',
|
|
47
|
+
guestId: 'guest_456',
|
|
48
|
+
checkIn: '2025-07-15',
|
|
49
|
+
checkOut: '2025-07-18',
|
|
50
|
+
guests: 2,
|
|
51
|
+
message: 'Hey',
|
|
52
|
+
status: 'pending_host_approval',
|
|
53
|
+
requestedAt: '2025-06-10T16:30:00.000Z',
|
|
54
|
+
expiresAt: '2025-06-11T16:30:00.000Z',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
49
58
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
54
63
|
},
|
|
55
64
|
},
|
|
56
65
|
{
|
|
@@ -58,41 +67,50 @@ describe('handle.ts.ejs (react slice)', () => {
|
|
|
58
67
|
name: 'Send notification to host',
|
|
59
68
|
server: {
|
|
60
69
|
description: 'Sends a host notification command in response to BookingRequested',
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
specs: {
|
|
71
|
+
name: 'Send notification to host reaction',
|
|
72
|
+
rules: [
|
|
73
|
+
{
|
|
74
|
+
description: 'Should send host notification on booking request',
|
|
75
|
+
examples: [
|
|
76
|
+
{
|
|
77
|
+
description: 'Booking request triggers host notification',
|
|
78
|
+
when: [
|
|
79
|
+
{
|
|
80
|
+
eventRef: 'BookingRequested',
|
|
81
|
+
exampleData: {
|
|
82
|
+
bookingId: 'book_xyz789',
|
|
83
|
+
hostId: 'host_123',
|
|
84
|
+
propertyId: 'prop_789',
|
|
85
|
+
guestId: 'guest_456',
|
|
86
|
+
checkIn: '2025-07-15',
|
|
87
|
+
checkOut: '2025-07-18',
|
|
88
|
+
guests: 2,
|
|
89
|
+
message: 'Hey',
|
|
90
|
+
status: 'pending_host_approval',
|
|
91
|
+
requestedAt: '2025-06-10T16:30:00.000Z',
|
|
92
|
+
expiresAt: '2025-06-11T16:30:00.000Z',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
then: [
|
|
97
|
+
{
|
|
98
|
+
commandRef: 'NotifyHost',
|
|
99
|
+
exampleData: {
|
|
100
|
+
hostId: 'host_123',
|
|
101
|
+
notificationType: 'booking_request',
|
|
102
|
+
priority: 'high',
|
|
103
|
+
channels: ['email', 'push'],
|
|
104
|
+
message: 'A guest has requested to book your place.',
|
|
105
|
+
actionRequired: true,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
],
|
|
91
109
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
96
114
|
},
|
|
97
115
|
},
|
|
98
116
|
{
|
|
@@ -101,35 +119,44 @@ describe('handle.ts.ejs (react slice)', () => {
|
|
|
101
119
|
client: { description: '', specs: [] },
|
|
102
120
|
server: {
|
|
103
121
|
description: '',
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
specs: {
|
|
123
|
+
name: 'Notify host command',
|
|
124
|
+
rules: [
|
|
125
|
+
{
|
|
126
|
+
description: 'Should notify host successfully',
|
|
127
|
+
examples: [
|
|
128
|
+
{
|
|
129
|
+
description: 'Host notification sent successfully',
|
|
130
|
+
when: {
|
|
131
|
+
commandRef: 'NotifyHost',
|
|
132
|
+
exampleData: {
|
|
133
|
+
hostId: 'host_123',
|
|
134
|
+
notificationType: 'booking_request',
|
|
135
|
+
priority: 'high',
|
|
136
|
+
channels: ['email', 'push'],
|
|
137
|
+
message: 'A guest has requested to book your place.',
|
|
138
|
+
actionRequired: true,
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
then: [
|
|
142
|
+
{
|
|
143
|
+
eventRef: 'HostNotified',
|
|
144
|
+
exampleData: {
|
|
145
|
+
bookingId: 'book_xyz789',
|
|
146
|
+
hostId: 'host_123',
|
|
147
|
+
notificationType: 'booking_request',
|
|
148
|
+
channels: ['email', 'push'],
|
|
149
|
+
message: 'hi.',
|
|
150
|
+
notifiedAt: '2025-06-10T16:30:00.000Z',
|
|
151
|
+
actionRequired: true,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
],
|
|
128
155
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
133
160
|
},
|
|
134
161
|
},
|
|
135
162
|
],
|