aves-sdk 1.5.0 → 1.6.0
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/README.md +201 -194
- package/dist/index.d.mts +369 -398
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/docs/guida-implementazione-booking-ops.md +227 -250
- package/package.json +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Guida implementazione — Booking ops AVES SDK 1.
|
|
1
|
+
# Guida implementazione — Booking ops AVES SDK 1.6.0
|
|
2
2
|
|
|
3
|
-
Guida pratica per le operazioni di booking (aves-sdk@1.
|
|
3
|
+
Guida pratica per le operazioni di booking (aves-sdk@1.6.0), derivate dallo spike API AVES XML 1.8.0.
|
|
4
4
|
|
|
5
5
|
**Escluso:** creazione/ricerca del Programma come entità master (gap Datagest — non coperto dai PDF).
|
|
6
6
|
**Incluso:** uso del Programma su pratica, update/delete costi, riassegnazione package, annullamento pratica.
|
|
@@ -10,13 +10,13 @@ Guida pratica per le operazioni di booking (aves-sdk@1.5.0), derivate dallo spik
|
|
|
10
10
|
## Setup client
|
|
11
11
|
|
|
12
12
|
```ts
|
|
13
|
-
import { AvesClient } from
|
|
13
|
+
import { AvesClient } from 'aves-sdk';
|
|
14
14
|
|
|
15
15
|
const client = new AvesClient({
|
|
16
|
-
baseURL:
|
|
17
|
-
hostID:
|
|
18
|
-
xtoken:
|
|
19
|
-
languageCode:
|
|
16
|
+
baseURL: 'https://<aves-host>',
|
|
17
|
+
hostID: '000000', // 6 digit
|
|
18
|
+
xtoken: 'TOKEN000000',
|
|
19
|
+
languageCode: '01', // opzionale
|
|
20
20
|
timeoutMs: 30_000,
|
|
21
21
|
});
|
|
22
22
|
```
|
|
@@ -36,16 +36,16 @@ const data = result.data; // tipizzato
|
|
|
36
36
|
|
|
37
37
|
## Mappa task → metodo SDK
|
|
38
38
|
|
|
39
|
-
| Task spike
|
|
40
|
-
|
|
41
|
-
| Update voci di costo
|
|
42
|
-
| Delete voci / overwrite
|
|
43
|
-
| Assegna / riassegna Programma | `modBookingServices` (`selectedPackageDetail`)
|
|
44
|
-
| Annulla pratica (soft)
|
|
45
|
-
| Annulla pratica (delete)
|
|
46
|
-
| Nullify singola riga
|
|
47
|
-
| Incassi sul booking
|
|
48
|
-
| Header (pax/note/billing)
|
|
39
|
+
| Task spike | Metodo | Endpoint |
|
|
40
|
+
| ----------------------------- | ------------------------------------------------------- | ------------------------------------------------------ |
|
|
41
|
+
| Update voci di costo | `modBookingServices` | `/interop/booking/v2/rest/ModBookingFileServices` |
|
|
42
|
+
| Delete voci / overwrite | `modBookingServices` (+ opz. `setBookingServiceStatus`) | stesso / `SetBookingFileServiceStatus` |
|
|
43
|
+
| Assegna / riassegna Programma | `modBookingServices` (`selectedPackageDetail`) | stesso |
|
|
44
|
+
| Annulla pratica (soft) | `setBookingStatus` | `/interop/booking/v2/rest/SetBookingFileStatus` |
|
|
45
|
+
| Annulla pratica (delete) | `cancelBooking` | `/interop/booking/v2/rest/CancelBookingFile` |
|
|
46
|
+
| Nullify singola riga | `setBookingServiceStatus` | `/interop/booking/v2/rest/SetBookingFileServiceStatus` |
|
|
47
|
+
| Incassi sul booking | `insertFilePaymentList` | `/interop/booking/v2/rest/InsertFilePaymentList` |
|
|
48
|
+
| Header (pax/note/billing) | `modBookingHeader` | `/interop/booking/v2/rest/ModBookingFileHeader` |
|
|
49
49
|
|
|
50
50
|
> **Programma** = Package AVES (`pCode` / `PackageCode`). Non esiste API SDK per create/search package.
|
|
51
51
|
|
|
@@ -57,41 +57,39 @@ Aggiorna una riga già presente: passa `bookedServiceRef` (RPH) e incrementa `av
|
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
59
|
const result = await client.modBookingServices({
|
|
60
|
-
customerRecordCode:
|
|
61
|
-
bookingFileCode:
|
|
62
|
-
selectedServiceList:
|
|
63
|
-
selectedServiceDetail: [
|
|
60
|
+
customerRecordCode: '138311',
|
|
61
|
+
bookingFileCode: '14/036654',
|
|
62
|
+
selectedServiceList: [
|
|
64
63
|
{
|
|
65
|
-
sCode:
|
|
66
|
-
ssCode:
|
|
67
|
-
avesServiceType:
|
|
68
|
-
toServiceType:
|
|
69
|
-
subServiceDesc:
|
|
70
|
-
startDate:
|
|
71
|
-
endDate:
|
|
72
|
-
qty:
|
|
73
|
-
pax:
|
|
74
|
-
paxAssociated: [{ pax:
|
|
75
|
-
avesSession:
|
|
76
|
-
bookedServiceRef:
|
|
64
|
+
sCode: 'HT00110840',
|
|
65
|
+
ssCode: 'DL',
|
|
66
|
+
avesServiceType: 'TOP',
|
|
67
|
+
toServiceType: 'RESIDENCE',
|
|
68
|
+
subServiceDesc: 'DOPPIA DE LUXE',
|
|
69
|
+
startDate: '2015-01-22T00:00:00',
|
|
70
|
+
endDate: '2015-01-25T00:00:00',
|
|
71
|
+
qty: '1',
|
|
72
|
+
pax: '2',
|
|
73
|
+
paxAssociated: [{ pax: '001' }, { pax: '002' }],
|
|
74
|
+
avesSession: '2', // incrementare ad ogni modifica della stessa riga
|
|
75
|
+
bookedServiceRef: '001', // RPH servizio già in pratica
|
|
77
76
|
serviceFare: {
|
|
78
|
-
currencyCode:
|
|
79
|
-
cost:
|
|
80
|
-
costTax:
|
|
81
|
-
costType:
|
|
82
|
-
price:
|
|
83
|
-
priceTax:
|
|
84
|
-
priceType:
|
|
77
|
+
currencyCode: 'EUR',
|
|
78
|
+
cost: '180.00',
|
|
79
|
+
costTax: '0.00',
|
|
80
|
+
costType: 'FORFAIT',
|
|
81
|
+
price: '220.00',
|
|
82
|
+
priceTax: '0.00',
|
|
83
|
+
priceType: 'FORFAIT',
|
|
85
84
|
},
|
|
86
85
|
avesServiceInfo: {
|
|
87
|
-
packageCode:
|
|
88
|
-
packageReference:
|
|
89
|
-
priceListCode:
|
|
90
|
-
costListCode:
|
|
86
|
+
packageCode: '2014MDE0000010',
|
|
87
|
+
packageReference: '05',
|
|
88
|
+
priceListCode: 'G',
|
|
89
|
+
costListCode: 'G',
|
|
91
90
|
},
|
|
92
91
|
},
|
|
93
92
|
],
|
|
94
|
-
},
|
|
95
93
|
});
|
|
96
94
|
|
|
97
95
|
if (result.success) {
|
|
@@ -102,7 +100,7 @@ if (result.success) {
|
|
|
102
100
|
|
|
103
101
|
### Note
|
|
104
102
|
|
|
105
|
-
- `selectedServiceList
|
|
103
|
+
- `selectedServiceList` / `passengerList` / altre `*List` sono **array flat di Detail**; lo SDK wrappa verso AVES (Create ≠ Mod sul wire).
|
|
106
104
|
- `ModBookingFileHeader` **non** aggiorna costi.
|
|
107
105
|
|
|
108
106
|
---
|
|
@@ -113,61 +111,57 @@ Pattern: `DELETE`/`NULLIFY` delle righe esistenti → re-insert del nuovo set ne
|
|
|
113
111
|
|
|
114
112
|
```ts
|
|
115
113
|
const result = await client.modBookingServices({
|
|
116
|
-
customerRecordCode:
|
|
117
|
-
bookingFileCode:
|
|
118
|
-
cancellableBookedServiceList:
|
|
119
|
-
cancellableBookedServiceDetail: [
|
|
114
|
+
customerRecordCode: '138311',
|
|
115
|
+
bookingFileCode: '14/036654',
|
|
116
|
+
cancellableBookedServiceList: [
|
|
120
117
|
{
|
|
121
|
-
cancelOperationType:
|
|
122
|
-
serviceRefType:
|
|
123
|
-
serviceRefValue:
|
|
118
|
+
cancelOperationType: 'DELETE', // o "NULLIFY"
|
|
119
|
+
serviceRefType: 'RPH',
|
|
120
|
+
serviceRefValue: '001',
|
|
124
121
|
},
|
|
125
122
|
{
|
|
126
|
-
cancelOperationType:
|
|
127
|
-
serviceRefType:
|
|
128
|
-
serviceRefValue:
|
|
123
|
+
cancelOperationType: 'DELETE',
|
|
124
|
+
serviceRefType: 'RPH',
|
|
125
|
+
serviceRefValue: '002',
|
|
129
126
|
},
|
|
130
127
|
],
|
|
131
|
-
},
|
|
132
128
|
// nuovo set (obbligatorio: almeno 1 servizio nello schema SDK)
|
|
133
|
-
selectedServiceList:
|
|
134
|
-
selectedServiceDetail: [
|
|
129
|
+
selectedServiceList: [
|
|
135
130
|
{
|
|
136
|
-
sCode:
|
|
137
|
-
avesServiceType:
|
|
138
|
-
toServiceType:
|
|
139
|
-
startDate:
|
|
140
|
-
endDate:
|
|
141
|
-
qty:
|
|
142
|
-
pax:
|
|
131
|
+
sCode: 'VLGENFLEX',
|
|
132
|
+
avesServiceType: 'OTHER',
|
|
133
|
+
toServiceType: 'OTHER',
|
|
134
|
+
startDate: '2015-01-22T00:00:00',
|
|
135
|
+
endDate: '2015-01-25T00:00:00',
|
|
136
|
+
qty: '2',
|
|
137
|
+
pax: '2',
|
|
143
138
|
paxAssociated: [],
|
|
144
|
-
avesSession:
|
|
139
|
+
avesSession: '1',
|
|
145
140
|
serviceFare: {
|
|
146
|
-
currencyCode:
|
|
147
|
-
cost:
|
|
148
|
-
price:
|
|
141
|
+
currencyCode: 'EUR',
|
|
142
|
+
cost: '50.00',
|
|
143
|
+
price: '80.00',
|
|
149
144
|
},
|
|
150
145
|
},
|
|
151
146
|
{
|
|
152
|
-
sCode:
|
|
153
|
-
ssCode:
|
|
154
|
-
avesServiceType:
|
|
155
|
-
toServiceType:
|
|
156
|
-
subServiceDesc:
|
|
157
|
-
startDate:
|
|
158
|
-
endDate:
|
|
159
|
-
qty:
|
|
160
|
-
pax:
|
|
161
|
-
paxAssociated: [{ pax:
|
|
162
|
-
avesSession:
|
|
147
|
+
sCode: 'HT00110840',
|
|
148
|
+
ssCode: 'DIN',
|
|
149
|
+
avesServiceType: 'TOP',
|
|
150
|
+
toServiceType: 'RESIDENCE',
|
|
151
|
+
subServiceDesc: 'CENA ADULTO',
|
|
152
|
+
startDate: '2015-01-22T00:00:00',
|
|
153
|
+
endDate: '2015-01-25T00:00:00',
|
|
154
|
+
qty: '2',
|
|
155
|
+
pax: '2',
|
|
156
|
+
paxAssociated: [{ pax: '001' }, { pax: '002' }],
|
|
157
|
+
avesSession: '1',
|
|
163
158
|
serviceFare: {
|
|
164
|
-
currencyCode:
|
|
165
|
-
cost:
|
|
166
|
-
price:
|
|
159
|
+
currencyCode: 'EUR',
|
|
160
|
+
cost: '40.00',
|
|
161
|
+
price: '60.00',
|
|
167
162
|
},
|
|
168
163
|
},
|
|
169
164
|
],
|
|
170
|
-
},
|
|
171
165
|
});
|
|
172
166
|
```
|
|
173
167
|
|
|
@@ -175,18 +169,18 @@ const result = await client.modBookingServices({
|
|
|
175
169
|
|
|
176
170
|
```ts
|
|
177
171
|
const result = await client.setBookingServiceStatus({
|
|
178
|
-
customerRecordCode:
|
|
179
|
-
bookingFileCode:
|
|
180
|
-
bookingServiceRef:
|
|
181
|
-
bookingFileServiceStatus:
|
|
182
|
-
bookingFileServiceStatusDate:
|
|
172
|
+
customerRecordCode: '000001',
|
|
173
|
+
bookingFileCode: '18/000252',
|
|
174
|
+
bookingServiceRef: '002',
|
|
175
|
+
bookingFileServiceStatus: 'NULLIFIED',
|
|
176
|
+
bookingFileServiceStatusDate: '2018-11-29T12:50:00+01:00',
|
|
183
177
|
});
|
|
184
178
|
```
|
|
185
179
|
|
|
186
|
-
| `cancelOperationType` | Uso tipico
|
|
187
|
-
|
|
188
|
-
| `DELETE`
|
|
189
|
-
| `NULLIFY`
|
|
180
|
+
| `cancelOperationType` | Uso tipico |
|
|
181
|
+
| --------------------- | ------------------------------------------- |
|
|
182
|
+
| `DELETE` | rimozione (wipe + re-insert) |
|
|
183
|
+
| `NULLIFY` | annullamento contabile/operativo della riga |
|
|
190
184
|
|
|
191
185
|
---
|
|
192
186
|
|
|
@@ -197,40 +191,38 @@ Collegare i servizi al package con `avesServiceInfo.packageCode` + `packageRefer
|
|
|
197
191
|
|
|
198
192
|
```ts
|
|
199
193
|
const result = await client.modBookingServices({
|
|
200
|
-
customerRecordCode:
|
|
201
|
-
bookingFileCode:
|
|
194
|
+
customerRecordCode: '138311',
|
|
195
|
+
bookingFileCode: '14/036654',
|
|
202
196
|
selectedPackageDetail: {
|
|
203
|
-
pCode:
|
|
204
|
-
startDate:
|
|
205
|
-
endDate:
|
|
197
|
+
pCode: '2014MDE0000010',
|
|
198
|
+
startDate: '2015-01-22T00:00:00',
|
|
199
|
+
endDate: '2015-01-25T00:00:00',
|
|
206
200
|
getServicesFromPackage: false, // true = auto-carica solo ADV/GRP
|
|
207
201
|
},
|
|
208
|
-
selectedServiceList:
|
|
209
|
-
selectedServiceDetail: [
|
|
202
|
+
selectedServiceList: [
|
|
210
203
|
{
|
|
211
|
-
sCode:
|
|
212
|
-
ssCode:
|
|
213
|
-
avesServiceType:
|
|
214
|
-
toServiceType:
|
|
215
|
-
startDate:
|
|
216
|
-
endDate:
|
|
217
|
-
qty:
|
|
218
|
-
pax:
|
|
219
|
-
paxAssociated: [{ pax:
|
|
220
|
-
avesSession:
|
|
221
|
-
bookedServiceRef:
|
|
204
|
+
sCode: 'HT00110840',
|
|
205
|
+
ssCode: 'DL',
|
|
206
|
+
avesServiceType: 'TOP',
|
|
207
|
+
toServiceType: 'RESIDENCE',
|
|
208
|
+
startDate: '2015-01-22T00:00:00',
|
|
209
|
+
endDate: '2015-01-25T00:00:00',
|
|
210
|
+
qty: '1',
|
|
211
|
+
pax: '2',
|
|
212
|
+
paxAssociated: [{ pax: '001' }, { pax: '002' }],
|
|
213
|
+
avesSession: '1',
|
|
214
|
+
bookedServiceRef: '001', // se aggiorni riga esistente
|
|
222
215
|
avesServiceInfo: {
|
|
223
|
-
packageCode:
|
|
224
|
-
packageReference:
|
|
216
|
+
packageCode: '2014MDE0000010',
|
|
217
|
+
packageReference: '01',
|
|
225
218
|
},
|
|
226
219
|
serviceFare: {
|
|
227
|
-
currencyCode:
|
|
228
|
-
cost:
|
|
229
|
-
price:
|
|
220
|
+
currencyCode: 'EUR',
|
|
221
|
+
cost: '100.00',
|
|
222
|
+
price: '120.00',
|
|
230
223
|
},
|
|
231
224
|
},
|
|
232
225
|
],
|
|
233
|
-
},
|
|
234
226
|
});
|
|
235
227
|
|
|
236
228
|
if (result.success) {
|
|
@@ -243,54 +235,48 @@ if (result.success) {
|
|
|
243
235
|
|
|
244
236
|
```ts
|
|
245
237
|
await client.createBooking({
|
|
246
|
-
customerDetail: { recordCode:
|
|
247
|
-
bookingFileStatus: { value:
|
|
248
|
-
startDate:
|
|
249
|
-
endDate:
|
|
250
|
-
selectedPackageList:
|
|
251
|
-
selectedPackageDetail: [
|
|
238
|
+
customerDetail: { recordCode: '138311' },
|
|
239
|
+
bookingFileStatus: { value: 'QUOTATION' },
|
|
240
|
+
startDate: '2015-01-22T00:00:00',
|
|
241
|
+
endDate: '2015-01-25T00:00:00',
|
|
242
|
+
selectedPackageList: [
|
|
252
243
|
{
|
|
253
|
-
pCode:
|
|
254
|
-
startDate:
|
|
255
|
-
endDate:
|
|
244
|
+
pCode: '2014MDE0000010',
|
|
245
|
+
startDate: '2015-01-22T00:00:00',
|
|
246
|
+
endDate: '2015-01-25T00:00:00',
|
|
256
247
|
},
|
|
257
248
|
],
|
|
258
|
-
},
|
|
259
249
|
selectedServiceList: [
|
|
260
250
|
{
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
pax: "2",
|
|
251
|
+
sCode: 'HT00110840',
|
|
252
|
+
ssCode: 'DL',
|
|
253
|
+
avesServiceType: 'TOP',
|
|
254
|
+
toServiceType: 'RESIDENCE',
|
|
255
|
+
startDate: '2015-01-22T00:00:00',
|
|
256
|
+
endDate: '2015-01-25T00:00:00',
|
|
257
|
+
qty: '1',
|
|
258
|
+
pax: '2',
|
|
270
259
|
paxAssociated: [],
|
|
271
|
-
avesSession:
|
|
260
|
+
avesSession: '1',
|
|
272
261
|
avesServiceInfo: {
|
|
273
|
-
packageCode:
|
|
274
|
-
packageReference:
|
|
262
|
+
packageCode: '2014MDE0000010',
|
|
263
|
+
packageReference: '01',
|
|
275
264
|
},
|
|
276
|
-
}
|
|
277
|
-
},
|
|
265
|
+
}
|
|
278
266
|
],
|
|
279
267
|
passengerList: [
|
|
280
268
|
{
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
},
|
|
269
|
+
rph: '001',
|
|
270
|
+
roomRph: '001',
|
|
271
|
+
name: 'ADULTI 001',
|
|
272
|
+
categoryCode: 'AD', // obbligatorio in create
|
|
273
|
+
sex: 'M',
|
|
274
|
+
}
|
|
289
275
|
],
|
|
290
276
|
});
|
|
291
277
|
```
|
|
292
278
|
|
|
293
|
-
>
|
|
279
|
+
> Input SDK unificato: `selectedServiceList: Detail[]`. Sul wire Create usa array di wrapper, Mod usa oggetto con array.
|
|
294
280
|
|
|
295
281
|
---
|
|
296
282
|
|
|
@@ -301,9 +287,9 @@ await client.createBooking({
|
|
|
301
287
|
```ts
|
|
302
288
|
// CANCELED
|
|
303
289
|
const canceled = await client.setBookingStatus({
|
|
304
|
-
customerRecordCode:
|
|
305
|
-
bookingFileCode:
|
|
306
|
-
fileStatus: { value:
|
|
290
|
+
customerRecordCode: '000170',
|
|
291
|
+
bookingFileCode: '14/000081',
|
|
292
|
+
fileStatus: { value: 'CANCELED' },
|
|
307
293
|
backOfficeRequest: true,
|
|
308
294
|
bookingFileDocument: {
|
|
309
295
|
printDoc: false,
|
|
@@ -313,22 +299,22 @@ const canceled = await client.setBookingStatus({
|
|
|
313
299
|
|
|
314
300
|
// NULLIFIED con penali
|
|
315
301
|
const nullified = await client.setBookingStatus({
|
|
316
|
-
customerRecordCode:
|
|
317
|
-
bookingFileCode:
|
|
318
|
-
fileStatus: { value:
|
|
302
|
+
customerRecordCode: '000170',
|
|
303
|
+
bookingFileCode: '14/000081',
|
|
304
|
+
fileStatus: { value: 'NULLIFIED' },
|
|
319
305
|
backOfficeRequest: true,
|
|
320
306
|
penalty: {
|
|
321
307
|
apply: true, // false = penali automatiche di sistema
|
|
322
|
-
specificCode:
|
|
308
|
+
specificCode: 'ZPENAL', // Top service code penali (se apply=true)
|
|
323
309
|
},
|
|
324
310
|
simulateCancelAndGetPenaltyAmount: false,
|
|
325
311
|
});
|
|
326
312
|
|
|
327
313
|
// Solo simulazione penali
|
|
328
314
|
const simulation = await client.setBookingStatus({
|
|
329
|
-
customerRecordCode:
|
|
330
|
-
bookingFileCode:
|
|
331
|
-
fileStatus: { value:
|
|
315
|
+
customerRecordCode: '000170',
|
|
316
|
+
bookingFileCode: '14/000081',
|
|
317
|
+
fileStatus: { value: 'NULLIFIED' },
|
|
332
318
|
simulateCancelAndGetPenaltyAmount: true,
|
|
333
319
|
});
|
|
334
320
|
if (simulation.success) {
|
|
@@ -343,8 +329,8 @@ Stati `fileStatus.value` ammessi:
|
|
|
343
329
|
|
|
344
330
|
```ts
|
|
345
331
|
const result = await client.cancelBooking({
|
|
346
|
-
bookingFileCode:
|
|
347
|
-
customerRecordCode:
|
|
332
|
+
bookingFileCode: '14/000081',
|
|
333
|
+
customerRecordCode: '000170',
|
|
348
334
|
});
|
|
349
335
|
|
|
350
336
|
if (result.success) {
|
|
@@ -352,10 +338,10 @@ if (result.success) {
|
|
|
352
338
|
}
|
|
353
339
|
```
|
|
354
340
|
|
|
355
|
-
| Metodo
|
|
356
|
-
|
|
357
|
-
| `setBookingStatus` → `CANCELED` / `NULLIFIED` | pratica resta, cambia stato
|
|
358
|
-
| `cancelBooking`
|
|
341
|
+
| Metodo | Effetto |
|
|
342
|
+
| --------------------------------------------- | ---------------------------- |
|
|
343
|
+
| `setBookingStatus` → `CANCELED` / `NULLIFIED` | pratica resta, cambia stato |
|
|
344
|
+
| `cancelBooking` | delete della pratica in AVES |
|
|
359
345
|
|
|
360
346
|
---
|
|
361
347
|
|
|
@@ -363,29 +349,27 @@ if (result.success) {
|
|
|
363
349
|
|
|
364
350
|
```ts
|
|
365
351
|
const result = await client.modBookingHeader({
|
|
366
|
-
bookingFileCode:
|
|
367
|
-
bookingFileStartDate:
|
|
368
|
-
customerRecordCode:
|
|
369
|
-
bookingNote:
|
|
370
|
-
passengerList:
|
|
371
|
-
passengerDetail: [
|
|
352
|
+
bookingFileCode: '14/000043',
|
|
353
|
+
bookingFileStartDate: '2014-04-28',
|
|
354
|
+
customerRecordCode: '103737',
|
|
355
|
+
bookingNote: 'Nota libera max 999 caratteri',
|
|
356
|
+
passengerList: [
|
|
372
357
|
{
|
|
373
|
-
rph:
|
|
374
|
-
name:
|
|
375
|
-
sex:
|
|
376
|
-
birthDate:
|
|
358
|
+
rph: '001',
|
|
359
|
+
name: 'ADULTI 001',
|
|
360
|
+
sex: 'M',
|
|
361
|
+
birthDate: '1964-09-26T00:00:00',
|
|
377
362
|
// categoryCode opzionale in Mod
|
|
378
363
|
},
|
|
379
364
|
{
|
|
380
|
-
rph:
|
|
381
|
-
name:
|
|
382
|
-
sex:
|
|
383
|
-
birthDate:
|
|
365
|
+
rph: '002',
|
|
366
|
+
name: 'ADULTI 002',
|
|
367
|
+
sex: 'F',
|
|
368
|
+
birthDate: '1964-09-26T00:00:00',
|
|
384
369
|
},
|
|
385
370
|
],
|
|
386
|
-
},
|
|
387
371
|
bookingFinancialInfo: {
|
|
388
|
-
customer_PaymentType:
|
|
372
|
+
customer_PaymentType: 'BANK',
|
|
389
373
|
},
|
|
390
374
|
});
|
|
391
375
|
```
|
|
@@ -396,62 +380,58 @@ const result = await client.modBookingHeader({
|
|
|
396
380
|
|
|
397
381
|
Flusso consigliato dopo lo spike:
|
|
398
382
|
|
|
399
|
-
1. Opzionale: `DELETE` voci obsolete
|
|
400
|
-
2. `selectedPackageDetail` con il Programma Lead
|
|
401
|
-
3. Nuovo `selectedServiceList` con costi e `packageCode` sui servizi
|
|
383
|
+
1. Opzionale: `DELETE` voci obsolete
|
|
384
|
+
2. `selectedPackageDetail` con il Programma Lead
|
|
385
|
+
3. Nuovo `selectedServiceList` con costi e `packageCode` sui servizi
|
|
402
386
|
|
|
403
387
|
```ts
|
|
404
388
|
const result = await client.modBookingServices({
|
|
405
|
-
customerRecordCode:
|
|
406
|
-
bookingFileCode:
|
|
389
|
+
customerRecordCode: '138311',
|
|
390
|
+
bookingFileCode: '14/036654',
|
|
407
391
|
selectedPackageDetail: {
|
|
408
|
-
pCode:
|
|
409
|
-
startDate:
|
|
410
|
-
endDate:
|
|
392
|
+
pCode: '2014MDE0000010',
|
|
393
|
+
startDate: '2015-01-22T00:00:00',
|
|
394
|
+
endDate: '2015-01-25T00:00:00',
|
|
411
395
|
},
|
|
412
|
-
cancellableBookedServiceList:
|
|
413
|
-
cancellableBookedServiceDetail: [
|
|
396
|
+
cancellableBookedServiceList: [
|
|
414
397
|
{
|
|
415
|
-
cancelOperationType:
|
|
416
|
-
serviceRefType:
|
|
417
|
-
serviceRefValue:
|
|
398
|
+
cancelOperationType: 'DELETE',
|
|
399
|
+
serviceRefType: 'RPH',
|
|
400
|
+
serviceRefValue: '001',
|
|
418
401
|
},
|
|
419
402
|
{
|
|
420
|
-
cancelOperationType:
|
|
421
|
-
serviceRefType:
|
|
422
|
-
serviceRefValue:
|
|
403
|
+
cancelOperationType: 'DELETE',
|
|
404
|
+
serviceRefType: 'RPH',
|
|
405
|
+
serviceRefValue: '002',
|
|
423
406
|
},
|
|
424
407
|
],
|
|
425
|
-
|
|
426
|
-
selectedServiceList: {
|
|
427
|
-
selectedServiceDetail: [
|
|
408
|
+
selectedServiceList: [
|
|
428
409
|
{
|
|
429
|
-
sCode:
|
|
430
|
-
ssCode:
|
|
431
|
-
avesServiceType:
|
|
432
|
-
toServiceType:
|
|
433
|
-
startDate:
|
|
434
|
-
endDate:
|
|
435
|
-
qty:
|
|
436
|
-
pax:
|
|
437
|
-
paxAssociated: [{ pax:
|
|
438
|
-
avesSession:
|
|
410
|
+
sCode: 'HT00110840',
|
|
411
|
+
ssCode: 'DL',
|
|
412
|
+
avesServiceType: 'TOP',
|
|
413
|
+
toServiceType: 'RESIDENCE',
|
|
414
|
+
startDate: '2015-01-22T00:00:00',
|
|
415
|
+
endDate: '2015-01-25T00:00:00',
|
|
416
|
+
qty: '1',
|
|
417
|
+
pax: '2',
|
|
418
|
+
paxAssociated: [{ pax: '001' }, { pax: '002' }],
|
|
419
|
+
avesSession: '1',
|
|
439
420
|
avesServiceInfo: {
|
|
440
|
-
packageCode:
|
|
441
|
-
packageReference:
|
|
442
|
-
costListCode:
|
|
443
|
-
priceListCode:
|
|
421
|
+
packageCode: '2014MDE0000010',
|
|
422
|
+
packageReference: '01',
|
|
423
|
+
costListCode: 'G',
|
|
424
|
+
priceListCode: 'G',
|
|
444
425
|
},
|
|
445
426
|
serviceFare: {
|
|
446
|
-
currencyCode:
|
|
447
|
-
cost:
|
|
448
|
-
price:
|
|
449
|
-
costType:
|
|
450
|
-
priceType:
|
|
427
|
+
currencyCode: 'EUR',
|
|
428
|
+
cost: '180.00',
|
|
429
|
+
price: '220.00',
|
|
430
|
+
costType: 'FORFAIT',
|
|
431
|
+
priceType: 'FORFAIT',
|
|
451
432
|
},
|
|
452
433
|
},
|
|
453
434
|
],
|
|
454
|
-
},
|
|
455
435
|
});
|
|
456
436
|
```
|
|
457
437
|
|
|
@@ -463,30 +443,29 @@ Registra uno o più pagamenti sul booking file appena creato (flusso Lead confer
|
|
|
463
443
|
|
|
464
444
|
```ts
|
|
465
445
|
const payments = await client.insertFilePaymentList({
|
|
466
|
-
bookingFileCode:
|
|
467
|
-
paymentUser:
|
|
446
|
+
bookingFileCode: '18/000172', // da createBooking → bookingFileDetail.bookingFileCode
|
|
447
|
+
paymentUser: 'MLDN',
|
|
468
448
|
enableMultiplePayments: true,
|
|
469
|
-
operationType:
|
|
470
|
-
filePaymentList:
|
|
471
|
-
filePaymentDetail: [
|
|
449
|
+
operationType: 'AbsoluteAmountsInsertion',
|
|
450
|
+
filePaymentList: [
|
|
472
451
|
{
|
|
473
|
-
paymentDate:
|
|
474
|
-
paymentNote:
|
|
475
|
-
amount:
|
|
476
|
-
paymentType:
|
|
452
|
+
paymentDate: '2018-09-08',
|
|
453
|
+
paymentNote: 'INCASSO LEAD',
|
|
454
|
+
amount: '100.00',
|
|
455
|
+
paymentType: 'B', // C cash | B bank | R credit card | …
|
|
477
456
|
},
|
|
478
457
|
{
|
|
479
|
-
paymentDate:
|
|
480
|
-
paymentNote:
|
|
481
|
-
amount:
|
|
482
|
-
paymentType:
|
|
458
|
+
paymentDate: '2018-10-08',
|
|
459
|
+
paymentNote: 'INCASSO LEAD',
|
|
460
|
+
amount: '800.25',
|
|
461
|
+
paymentType: 'C',
|
|
483
462
|
},
|
|
484
463
|
],
|
|
485
|
-
},
|
|
486
464
|
});
|
|
487
465
|
```
|
|
488
466
|
|
|
489
467
|
`operationType`:
|
|
468
|
+
|
|
490
469
|
- `AbsoluteAmountsInsertion` — inserisce gli importi da incassare (anche multipli)
|
|
491
470
|
- `FinalAmountToAchieve` / `FinalAmountToAchieveWithoutControls` — totale già incassato; AVES calcola la differenza
|
|
492
471
|
|
|
@@ -505,15 +484,13 @@ await saveAvesCodeOnLead(leadId, bookingFileCode);
|
|
|
505
484
|
const paid = await client.insertFilePaymentList({
|
|
506
485
|
bookingFileCode,
|
|
507
486
|
enableMultiplePayments: true,
|
|
508
|
-
operationType:
|
|
509
|
-
filePaymentList: {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
})),
|
|
516
|
-
},
|
|
487
|
+
operationType: 'AbsoluteAmountsInsertion',
|
|
488
|
+
filePaymentList: leadPayments.map((p) => ({
|
|
489
|
+
paymentDate: p.date,
|
|
490
|
+
paymentNote: p.note,
|
|
491
|
+
amount: p.amount,
|
|
492
|
+
paymentType: p.type,
|
|
493
|
+
})),
|
|
517
494
|
});
|
|
518
495
|
|
|
519
496
|
if (!paid.success) {
|
|
@@ -524,7 +501,7 @@ if (!paid.success) {
|
|
|
524
501
|
|
|
525
502
|
---
|
|
526
503
|
|
|
527
|
-
## Tipi esportati (1.
|
|
504
|
+
## Tipi esportati (1.6.0)
|
|
528
505
|
|
|
529
506
|
```ts
|
|
530
507
|
import type {
|
|
@@ -538,14 +515,14 @@ import type {
|
|
|
538
515
|
BookingStatusOnlyRS,
|
|
539
516
|
BookingFileRQ,
|
|
540
517
|
BookingFileRS,
|
|
541
|
-
} from
|
|
518
|
+
} from 'aves-sdk';
|
|
542
519
|
```
|
|
543
520
|
|
|
544
521
|
---
|
|
545
522
|
|
|
546
523
|
## Caveat operativi (da verificare live)
|
|
547
524
|
|
|
548
|
-
1. `DELETE` vs `NULLIFY` — vincoli di stato pratica / documenti / pagamenti.
|
|
549
|
-
2. `selectedPackageDetail` su pratica già con package — replace vs add.
|
|
550
|
-
3. Differenza operativa `cancelBooking` vs status `CANCELED`/`NULLIFIED`.
|
|
525
|
+
1. `DELETE` vs `NULLIFY` — vincoli di stato pratica / documenti / pagamenti.
|
|
526
|
+
2. `selectedPackageDetail` su pratica già con package — replace vs add.
|
|
527
|
+
3. Differenza operativa `cancelBooking` vs status `CANCELED`/`NULLIFIED`.
|
|
551
528
|
4. Create/search Programma — **non disponibile** in questo SDK; serve doc Catalog/Package Datagest.
|