aves-sdk 1.3.3 → 1.4.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.
@@ -0,0 +1,482 @@
1
+ # Guida implementazione — Booking ops AVES SDK 1.4.0
2
+
3
+ Guida pratica per le operazioni di booking aggiunte in **aves-sdk@1.4.0**, derivate dallo spike API AVES XML 1.8.0.
4
+
5
+ **Escluso:** creazione/ricerca del Programma come entità master (gap Datagest — non coperto dai PDF).
6
+ **Incluso:** uso del Programma su pratica, update/delete costi, riassegnazione package, annullamento pratica.
7
+
8
+ ---
9
+
10
+ ## Setup client
11
+
12
+ ```ts
13
+ import { AvesClient } from "aves-sdk";
14
+
15
+ const client = new AvesClient({
16
+ baseURL: "https://<aves-host>",
17
+ hostID: "000000", // 6 digit
18
+ xtoken: "TOKEN000000",
19
+ languageCode: "01", // opzionale
20
+ timeoutMs: 30_000,
21
+ });
22
+ ```
23
+
24
+ Tutti i metodi restituiscono `Result<T, AvesError>`:
25
+
26
+ ```ts
27
+ const result = await client.modBookingServices(/* ... */);
28
+ if (!result.success) {
29
+ console.error(result.error.kind, result.error.message, result.error.code);
30
+ return;
31
+ }
32
+ const data = result.data; // tipizzato
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Mappa task → metodo SDK
38
+
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
+ | Header (pax/note/billing) | `modBookingHeader` | `/interop/booking/v2/rest/ModBookingFileHeader` |
48
+
49
+ > **Programma** = Package AVES (`pCode` / `PackageCode`). Non esiste API SDK per create/search package.
50
+
51
+ ---
52
+
53
+ ## 1. Aggiornamento voci di costo
54
+
55
+ Aggiorna una riga già presente: passa `bookedServiceRef` (RPH) e incrementa `avesSession`. Imposta costi/prezzi con `serviceFare`.
56
+
57
+ ```ts
58
+ const result = await client.modBookingServices({
59
+ customerRecordCode: "138311",
60
+ bookingFileCode: "14/036654",
61
+ selectedServiceList: {
62
+ selectedServiceDetail: [
63
+ {
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
76
+ serviceFare: {
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",
84
+ },
85
+ avesServiceInfo: {
86
+ packageCode: "2014MDE0000010",
87
+ packageReference: "05",
88
+ priceListCode: "G",
89
+ costListCode: "G",
90
+ },
91
+ },
92
+ ],
93
+ },
94
+ });
95
+
96
+ if (result.success) {
97
+ console.log(result.data.bookingFileDetail?.bookingFileCode);
98
+ console.log(result.data.bookingFileDetail?.totalAmountDetail);
99
+ }
100
+ ```
101
+
102
+ ### Note
103
+
104
+ - `selectedServiceList.selectedServiceDetail` è un **array** (shape Mod ≠ Create).
105
+ - `ModBookingFileHeader` **non** aggiorna costi.
106
+
107
+ ---
108
+
109
+ ## 2. Cancellazione voci + overwrite integrale
110
+
111
+ Pattern: `DELETE`/`NULLIFY` delle righe esistenti → re-insert del nuovo set nello stesso (o successivo) `modBookingServices`.
112
+
113
+ ```ts
114
+ const result = await client.modBookingServices({
115
+ customerRecordCode: "138311",
116
+ bookingFileCode: "14/036654",
117
+ cancellableBookedServiceList: {
118
+ cancellableBookedServiceDetail: [
119
+ {
120
+ cancelOperationType: "DELETE", // o "NULLIFY"
121
+ serviceRefType: "RPH",
122
+ serviceRefValue: "001",
123
+ },
124
+ {
125
+ cancelOperationType: "DELETE",
126
+ serviceRefType: "RPH",
127
+ serviceRefValue: "002",
128
+ },
129
+ ],
130
+ },
131
+ // nuovo set (obbligatorio: almeno 1 servizio nello schema SDK)
132
+ selectedServiceList: {
133
+ selectedServiceDetail: [
134
+ {
135
+ sCode: "VLGENFLEX",
136
+ avesServiceType: "OTHER",
137
+ toServiceType: "OTHER",
138
+ startDate: "2015-01-22T00:00:00",
139
+ endDate: "2015-01-25T00:00:00",
140
+ qty: "2",
141
+ pax: "2",
142
+ paxAssociated: [],
143
+ avesSession: "1",
144
+ serviceFare: {
145
+ currencyCode: "EUR",
146
+ cost: "50.00",
147
+ price: "80.00",
148
+ },
149
+ },
150
+ {
151
+ sCode: "HT00110840",
152
+ ssCode: "DIN",
153
+ avesServiceType: "TOP",
154
+ toServiceType: "RESIDENCE",
155
+ subServiceDesc: "CENA ADULTO",
156
+ startDate: "2015-01-22T00:00:00",
157
+ endDate: "2015-01-25T00:00:00",
158
+ qty: "2",
159
+ pax: "2",
160
+ paxAssociated: [{ pax: "001" }, { pax: "002" }],
161
+ avesSession: "1",
162
+ serviceFare: {
163
+ currencyCode: "EUR",
164
+ cost: "40.00",
165
+ price: "60.00",
166
+ },
167
+ },
168
+ ],
169
+ },
170
+ });
171
+ ```
172
+
173
+ ### Alternativa: nullify di una sola riga
174
+
175
+ ```ts
176
+ const result = await client.setBookingServiceStatus({
177
+ customerRecordCode: "000001",
178
+ bookingFileCode: "18/000252",
179
+ bookingServiceRef: "002",
180
+ bookingFileServiceStatus: "NULLIFIED",
181
+ bookingFileServiceStatusDate: "2018-11-29T12:50:00+01:00",
182
+ });
183
+ ```
184
+
185
+ | `cancelOperationType` | Uso tipico |
186
+ |---|---|
187
+ | `DELETE` | rimozione (wipe + re-insert) |
188
+ | `NULLIFY` | annullamento contabile/operativo della riga |
189
+
190
+ ---
191
+
192
+ ## 3. Assegnazione / riassegnazione Programma
193
+
194
+ Su pratica già esistente: `selectedPackageDetail` in `modBookingServices`.
195
+ Collegare i servizi al package con `avesServiceInfo.packageCode` + `packageReference`.
196
+
197
+ ```ts
198
+ const result = await client.modBookingServices({
199
+ customerRecordCode: "138311",
200
+ bookingFileCode: "14/036654",
201
+ selectedPackageDetail: {
202
+ pCode: "2014MDE0000010",
203
+ startDate: "2015-01-22T00:00:00",
204
+ endDate: "2015-01-25T00:00:00",
205
+ getServicesFromPackage: false, // true = auto-carica solo ADV/GRP
206
+ },
207
+ selectedServiceList: {
208
+ selectedServiceDetail: [
209
+ {
210
+ sCode: "HT00110840",
211
+ ssCode: "DL",
212
+ avesServiceType: "TOP",
213
+ toServiceType: "RESIDENCE",
214
+ startDate: "2015-01-22T00:00:00",
215
+ endDate: "2015-01-25T00:00:00",
216
+ qty: "1",
217
+ pax: "2",
218
+ paxAssociated: [{ pax: "001" }, { pax: "002" }],
219
+ avesSession: "1",
220
+ bookedServiceRef: "001", // se aggiorni riga esistente
221
+ avesServiceInfo: {
222
+ packageCode: "2014MDE0000010",
223
+ packageReference: "01",
224
+ },
225
+ serviceFare: {
226
+ currencyCode: "EUR",
227
+ cost: "100.00",
228
+ price: "120.00",
229
+ },
230
+ },
231
+ ],
232
+ },
233
+ });
234
+
235
+ if (result.success) {
236
+ // PackageCode sulla pratica (se AVES lo aggiorna)
237
+ console.log(result.data.bookingFileDetail?.packageCode);
238
+ }
239
+ ```
240
+
241
+ ### In creazione pratica (riferimento)
242
+
243
+ ```ts
244
+ await client.createBooking({
245
+ customerDetail: { recordCode: "138311" },
246
+ bookingFileStatus: { value: "QUOTATION" },
247
+ startDate: "2015-01-22T00:00:00",
248
+ endDate: "2015-01-25T00:00:00",
249
+ selectedPackageList: {
250
+ selectedPackageDetail: [
251
+ {
252
+ pCode: "2014MDE0000010",
253
+ startDate: "2015-01-22T00:00:00",
254
+ endDate: "2015-01-25T00:00:00",
255
+ },
256
+ ],
257
+ },
258
+ selectedServiceList: [
259
+ {
260
+ selectedServiceDetail: {
261
+ sCode: "HT00110840",
262
+ ssCode: "DL",
263
+ avesServiceType: "TOP",
264
+ toServiceType: "RESIDENCE",
265
+ startDate: "2015-01-22T00:00:00",
266
+ endDate: "2015-01-25T00:00:00",
267
+ qty: "1",
268
+ pax: "2",
269
+ paxAssociated: [],
270
+ avesSession: "1",
271
+ avesServiceInfo: {
272
+ packageCode: "2014MDE0000010",
273
+ packageReference: "01",
274
+ },
275
+ },
276
+ },
277
+ ],
278
+ passengerList: [
279
+ {
280
+ passengerDetail: {
281
+ rph: "001",
282
+ roomRph: "001",
283
+ name: "ADULTI 001",
284
+ categoryCode: "AD", // obbligatorio in create
285
+ sex: "M",
286
+ },
287
+ },
288
+ ],
289
+ });
290
+ ```
291
+
292
+ > Shape lista servizi: **Create** = array di wrapper `{ selectedServiceDetail: one }`; **Mod** = `{ selectedServiceDetail: one[] }`.
293
+
294
+ ---
295
+
296
+ ## 4. Annullabilità pratica
297
+
298
+ ### Soft — cambio stato
299
+
300
+ ```ts
301
+ // CANCELED
302
+ const canceled = await client.setBookingStatus({
303
+ customerRecordCode: "000170",
304
+ bookingFileCode: "14/000081",
305
+ fileStatus: { value: "CANCELED" },
306
+ backOfficeRequest: true,
307
+ bookingFileDocument: {
308
+ printDoc: false,
309
+ sendDocViaEmail: false,
310
+ },
311
+ });
312
+
313
+ // NULLIFIED con penali
314
+ const nullified = await client.setBookingStatus({
315
+ customerRecordCode: "000170",
316
+ bookingFileCode: "14/000081",
317
+ fileStatus: { value: "NULLIFIED" },
318
+ backOfficeRequest: true,
319
+ penalty: {
320
+ apply: true, // false = penali automatiche di sistema
321
+ specificCode: "ZPENAL", // Top service code penali (se apply=true)
322
+ },
323
+ simulateCancelAndGetPenaltyAmount: false,
324
+ });
325
+
326
+ // Solo simulazione penali
327
+ const simulation = await client.setBookingStatus({
328
+ customerRecordCode: "000170",
329
+ bookingFileCode: "14/000081",
330
+ fileStatus: { value: "NULLIFIED" },
331
+ simulateCancelAndGetPenaltyAmount: true,
332
+ });
333
+ if (simulation.success) {
334
+ console.log(simulation.data.totalAmountDetailAfterCancellation);
335
+ }
336
+ ```
337
+
338
+ Stati `fileStatus.value` ammessi:
339
+ `QUOTATION` | `WORK_IN_PROGRESS` | `CONFIRMED` | `OPTIONED` | `NULLIFIED` | `CANCELED`
340
+
341
+ ### Hard — delete pratica
342
+
343
+ ```ts
344
+ const result = await client.cancelBooking({
345
+ bookingFileCode: "14/000081",
346
+ customerRecordCode: "000170",
347
+ });
348
+
349
+ if (result.success) {
350
+ console.log(result.data.rsStatus.status); // "OK"
351
+ }
352
+ ```
353
+
354
+ | Metodo | Effetto |
355
+ |---|---|
356
+ | `setBookingStatus` → `CANCELED` / `NULLIFIED` | pratica resta, cambia stato |
357
+ | `cancelBooking` | delete della pratica in AVES |
358
+
359
+ ---
360
+
361
+ ## 5. Modifica header (senza costi)
362
+
363
+ ```ts
364
+ const result = await client.modBookingHeader({
365
+ bookingFileCode: "14/000043",
366
+ bookingFileStartDate: "2014-04-28",
367
+ customerRecordCode: "103737",
368
+ bookingNote: "Nota libera max 999 caratteri",
369
+ passengerList: {
370
+ passengerDetail: [
371
+ {
372
+ rph: "001",
373
+ name: "ADULTI 001",
374
+ sex: "M",
375
+ birthDate: "1964-09-26T00:00:00",
376
+ // categoryCode opzionale in Mod
377
+ },
378
+ {
379
+ rph: "002",
380
+ name: "ADULTI 002",
381
+ sex: "F",
382
+ birthDate: "1964-09-26T00:00:00",
383
+ },
384
+ ],
385
+ },
386
+ bookingFinancialInfo: {
387
+ customer_PaymentType: "BANK",
388
+ },
389
+ });
390
+ ```
391
+
392
+ ---
393
+
394
+ ## Payload combinato tipico (Lead retroattivo + overwrite)
395
+
396
+ Flusso consigliato dopo lo spike:
397
+
398
+ 1. Opzionale: `DELETE` voci obsolete
399
+ 2. `selectedPackageDetail` con il Programma Lead
400
+ 3. Nuovo `selectedServiceList` con costi e `packageCode` sui servizi
401
+
402
+ ```ts
403
+ const result = await client.modBookingServices({
404
+ customerRecordCode: "138311",
405
+ bookingFileCode: "14/036654",
406
+ selectedPackageDetail: {
407
+ pCode: "2014MDE0000010",
408
+ startDate: "2015-01-22T00:00:00",
409
+ endDate: "2015-01-25T00:00:00",
410
+ },
411
+ cancellableBookedServiceList: {
412
+ cancellableBookedServiceDetail: [
413
+ {
414
+ cancelOperationType: "DELETE",
415
+ serviceRefType: "RPH",
416
+ serviceRefValue: "001",
417
+ },
418
+ {
419
+ cancelOperationType: "DELETE",
420
+ serviceRefType: "RPH",
421
+ serviceRefValue: "002",
422
+ },
423
+ ],
424
+ },
425
+ selectedServiceList: {
426
+ selectedServiceDetail: [
427
+ {
428
+ sCode: "HT00110840",
429
+ ssCode: "DL",
430
+ avesServiceType: "TOP",
431
+ toServiceType: "RESIDENCE",
432
+ startDate: "2015-01-22T00:00:00",
433
+ endDate: "2015-01-25T00:00:00",
434
+ qty: "1",
435
+ pax: "2",
436
+ paxAssociated: [{ pax: "001" }, { pax: "002" }],
437
+ avesSession: "1",
438
+ avesServiceInfo: {
439
+ packageCode: "2014MDE0000010",
440
+ packageReference: "01",
441
+ costListCode: "G",
442
+ priceListCode: "G",
443
+ },
444
+ serviceFare: {
445
+ currencyCode: "EUR",
446
+ cost: "180.00",
447
+ price: "220.00",
448
+ costType: "FORFAIT",
449
+ priceType: "FORFAIT",
450
+ },
451
+ },
452
+ ],
453
+ },
454
+ });
455
+ ```
456
+
457
+ ---
458
+
459
+ ## Tipi esportati (1.4.0)
460
+
461
+ ```ts
462
+ import type {
463
+ ModFileServicesRQ,
464
+ ModFileHeaderRQ,
465
+ CancelFileRQ,
466
+ SetFileStatusRQ,
467
+ SetFileServiceStatusRQ,
468
+ BookingFileDetailRS, // alias di BookingFileRS
469
+ BookingStatusOnlyRS,
470
+ BookingFileRQ,
471
+ BookingFileRS,
472
+ } from "aves-sdk";
473
+ ```
474
+
475
+ ---
476
+
477
+ ## Caveat operativi (da verificare live)
478
+
479
+ 1. `DELETE` vs `NULLIFY` — vincoli di stato pratica / documenti / pagamenti.
480
+ 2. `selectedPackageDetail` su pratica già con package — replace vs add.
481
+ 3. Differenza operativa `cancelBooking` vs status `CANCELED`/`NULLIFIED`.
482
+ 4. Create/search Programma — **non disponibile** in questo SDK; serve doc Catalog/Package Datagest.
@@ -0,0 +1,196 @@
1
+ # Spike tecnico — Verifica API AVES
2
+
3
+ **Data:** 29 luglio 2026
4
+ **Fonti (AVES XML 1.8.0):**
5
+
6
+ - `Aves Xml 1.8.0 Eng - Booking CPX.pdf` (Booking Lite) — fonte principale
7
+ - `Aves Xml 1.8.0 Eng - MasterRecord.pdf` — anagrafiche
8
+ - `Aves Xml 1.8.0 Eng - Doc (1).pdf` (Booking Document) — documenti
9
+ - `Aves Xml 1.8.0 Eng - CRM (2).pdf` (CRM) — anagrafiche CRM / ToDo
10
+
11
+ ---
12
+
13
+ ## Contesto
14
+
15
+ Obiettivo: verificare le API necessarie per:
16
+
17
+ 1. creazione e ricerca del **Programma**
18
+ 2. aggiornamento delle **voci di costo** su una pratica esistente
19
+ 3. cancellazione di voci di costo (overwrite integrale della pratica)
20
+ 4. assegnazione / riassegnazione del Programma a una pratica già caricata (collegamento retroattivo Lead)
21
+ 5. annullabilità di una pratica
22
+
23
+ Il **Programma** è la proprietà che raggruppa più pratiche sotto lo stesso cappello.
24
+
25
+ ---
26
+
27
+ ## Cos’è il Programma in AVES
28
+
29
+ Nei documenti inglesi il Programma corrisponde a **Package / Program**:
30
+
31
+ | Nome in doc | Uso |
32
+ |---|---|
33
+ | `pCode` / `PackageCode` | codice package su booking e servizi |
34
+ | `SelectedPackageList` / `SelectedPackageDetail` | collegamento package → pratica |
35
+ | `ProgramCode` | filtro stampa (Rooming List, Doc PDF) |
36
+ | `DocumentType = PACKAGE` | archivio/ricerca documenti legati al package |
37
+
38
+ Sulla pratica compare in `BookingFileDetail.PackageCode`; sui servizi in `AvesServiceInfo.PackageCode` + `PackageReference`.
39
+
40
+ ---
41
+
42
+ ## Esito per requisito
43
+
44
+ ### 1. Creazione e ricerca del Programma
45
+
46
+ **Non coperto** dai quattro PDF disponibili.
47
+
48
+ - Booking CPX **usa** il package (`SelectedPackageList`) ma non documenta create/search.
49
+ - MasterRecord, Doc e CRM non espongono CRUD Package.
50
+ - Nel Booking CPX compaiono riferimenti a `GetPackageDetail`, `CommitPackage`, `Search`/`GetDetail` sulle common structure Package, **senza endpoint**.
51
+
52
+ **Azione:** richiedere a Datagest la documentazione Catalog/Package.
53
+
54
+ ---
55
+
56
+ ### 2. Aggiornamento voci di costo su pratica esistente
57
+
58
+ **Coperto** — `ModBookingFileServices`
59
+
60
+ ```
61
+ POST /interop/booking/v2/rest/ModBookingFileServices
62
+ ```
63
+
64
+ - Obbligatori: `CustomerRecordCode`, `BookingFileCode`, `SelectedServiceList`
65
+ - Per aggiornare una riga esistente: `BookedServiceRef` (RPH, es. `001`) + incrementare `AvesSession`
66
+ - Costi/prezzi: `ServiceFare` (`Cost`, `CostTax`, `Price`, `PriceTax`, `CurrencyCode`, …) e/o `CostListCode` / `PriceListCode` in `AvesServiceInfo`
67
+
68
+ `ModBookingFileHeader` gestisce solo header (cliente, pax, note, billing) — **non** i costi.
69
+
70
+ ---
71
+
72
+ ### 3. Cancellazione voci di costo (overwrite)
73
+
74
+ **Coperto** — stesso endpoint `ModBookingFileServices`, via:
75
+
76
+ ```
77
+ CancellableBookedServiceList / CancellableBookedServiceDetail
78
+ @CancelOperationType = NULLIFY | DELETE
79
+ @ServiceRefType = RPH | FILE
80
+ @ServiceRefValue = RPH del servizio
81
+ ```
82
+
83
+ | Operazione | Significato tipico |
84
+ |---|---|
85
+ | `DELETE` | rimozione della voce (utile a wipe + re-insert) |
86
+ | `NULLIFY` | annullamento della riga |
87
+
88
+ Alternativa per singola riga: `SetBookingFileServiceStatus` → solo `NULLIFIED`
89
+ `POST /interop/booking/v2/rest/SetBookingFileServiceStatus`
90
+
91
+ **Pattern overwrite proposto:** cancellare/nullificare tutte le voci → reinserire il nuovo set con `SelectedServiceList` (+ eventuale `SelectedPackageDetail`).
92
+
93
+ Da verificare in test: vincoli di stato pratica / documenti / pagamenti su `DELETE`.
94
+
95
+ ---
96
+
97
+ ### 4. Assegnazione / riassegnazione Programma
98
+
99
+ **Parzialmente coperto**
100
+
101
+ | API | Cambia Package? |
102
+ |---|---|
103
+ | `CreateBookingFile` + `SelectedPackageList` | Sì (in creazione) |
104
+ | `ModBookingFileServices` + `SelectedPackageDetail` | Sì — *“NEW program that need to be added to booked file”* |
105
+ | `ModBookingFileHeader` | No |
106
+
107
+ Endpoint: `POST /interop/booking/v2/rest/ModBookingFileServices`
108
+
109
+ Campi `SelectedPackageDetail`: `pCode`, `StartDate`, `EndDate`, `GetServicesFromPackage` (solo ADV/GRP).
110
+
111
+ **Da verificare in test:** se l’operazione **sostituisce** o **aggiunge** il package; impatto su `PackageCode` della pratica e sui servizi già presenti (necessario per Lead retroattivi).
112
+
113
+ **Nota Lead / CRM:** il PDF CRM non collega Lead ↔ Programma. Espone solo:
114
+
115
+ - `InsertToDo` — richiesta libera (es. preventivo) associata a un master CRM
116
+ `POST /interop/cmr/v2/rest/InsertToDo`
117
+ - insert/update/search master CRM (`/interop/cmr/v2/rest/InsertMasterRecord`, `SearchMasterRecords`)
118
+ - in search: `BookingInfo` in sola lettura (ultima prenotazione / totali per anno), senza package né modifica pratica
119
+
120
+ Il collegamento retroattivo Lead ↔ Programma resta da fare lato booking (`SelectedPackageDetail`), non via API CRM.
121
+
122
+ ---
123
+
124
+ ### 5. Annullabilità di una pratica
125
+
126
+ **Coperto** — due modalità distinte:
127
+
128
+ | API | Endpoint | Effetto |
129
+ |---|---|---|
130
+ | `CancelBookingFile` | `/interop/booking/v2/rest/CancelBookingFile` | delete della pratica |
131
+ | `SetBookingFileStatus` | `/interop/booking/v2/rest/SetBookingFileStatus` | stato `CANCELED` o `NULLIFIED` |
132
+
133
+ Per `NULLIFIED`: supporto penali (`Penalty`, `SimulateCancelAndGetPenaltyAmount`).
134
+
135
+ **Da verificare in test:** differenza operativa tra delete e cambio stato, e stati ammessi.
136
+
137
+ ---
138
+
139
+ ## Matrice copertura documenti
140
+
141
+ | Requisito | MasterRecord | Booking CPX | Doc | CRM |
142
+ |---|---|---|---|---|
143
+ | Create/search Programma | ❌ | ❌ (solo uso) | ❌ | ❌ |
144
+ | Update costi | ❌ | ✅ | ❌ | ❌ |
145
+ | Delete voci (overwrite) | ❌ | ✅ | ❌ | ❌ |
146
+ | Riassegna Programma | ❌ | ✅ (da testare) | ❌ (solo filtro `ProgramCode`) | ❌ (ToDo/Lead senza package) |
147
+ | Annulla pratica | ❌ | ✅ | ❌ | ❌ |
148
+
149
+ ---
150
+
151
+ ## Endpoint rilevanti (Booking)
152
+
153
+ | Interfaccia | Endpoint |
154
+ |---|---|
155
+ | CreateBookingFile | `/interop/booking/v2/rest/CreateBookingFile` |
156
+ | ModBookingFileHeader | `/interop/booking/v2/rest/ModBookingFileHeader` |
157
+ | ModBookingFileServices | `/interop/booking/v2/rest/ModBookingFileServices` |
158
+ | SetBookingFileStatus | `/interop/booking/v2/rest/SetBookingFileStatus` |
159
+ | SetBookingFileServiceStatus | `/interop/booking/v2/rest/SetBookingFileServiceStatus` |
160
+ | CancelBookingFile | `/interop/booking/v2/rest/CancelBookingFile` |
161
+
162
+ Protocollo: REST XML, method `POST`, auth via `RqHeader` (`HostID`, `Xtoken`, …).
163
+
164
+ ---
165
+
166
+ ## PDF CRM — cosa contiene (fuori scope operativo)
167
+
168
+ | Interfaccia | Endpoint | Scopo |
169
+ |---|---|---|
170
+ | InsertToDo | `/interop/cmr/v2/rest/InsertToDo` | richiesta libera (quotation) su CRM |
171
+ | InsertMasterRecord | `/interop/cmr/v2/rest/InsertMasterRecord` | crea anagrafica CRM |
172
+ | UpdateMasterRecord | (stesso schema ManageCrm) | aggiorna anagrafica CRM |
173
+ | SearchMasterRecords | `/interop/cmr/v2/rest/SearchMasterRecords` | cerca anagrafiche CRM (+ `BookingInfo` read-only) |
174
+
175
+ Nessun riferimento a Package/Programma, voci di costo, overwrite pratica o cancel booking.
176
+
177
+ ---
178
+
179
+ ## Gap aperti
180
+
181
+ 1. Documentazione API **CRUD/search Package (Programma)** — assente nei quattro PDF attuali.
182
+ 2. Semantica esatta **DELETE vs NULLIFY** e vincoli di stato.
183
+ 3. Comportamento **riassegnazione package** (replace vs add) per Lead retroattivi.
184
+ 4. Differenza **CancelBookingFile** vs status `CANCELED` / `NULLIFIED`.
185
+
186
+ ---
187
+
188
+ ## Prossimo passo consigliato
189
+
190
+ Spike live sull’ambiente AVES, in ordine:
191
+
192
+ 1. create pratica con `SelectedPackageList`
193
+ 2. update costi (`ModBookingFileServices` + `ServiceFare` / `BookedServiceRef`)
194
+ 3. delete/nullify voci + re-insert (overwrite)
195
+ 4. riassegna package su pratica esistente
196
+ 5. cancel / set status `CANCELED`–`NULLIFIED`