aves-sdk 1.3.4 → 1.5.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/dist/index.d.mts +2130 -347
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/docs/guida-implementazione-booking-ops.md +551 -0
- package/docs/spike-api-aves-analisi.md +196 -0
- package/package.json +11 -11
|
@@ -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`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aves-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "TypeScript SDK for AVES XML REST",
|
|
5
5
|
"homepage": "https://github.com/simoneguglielmi/aves-sdk#readme",
|
|
6
6
|
"repository": [
|
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
},
|
|
54
54
|
"packageManager": "yarn@1.22.22",
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"fast-xml-parser": "^5.
|
|
57
|
-
"undici": "^
|
|
58
|
-
"valibot": "^1.2
|
|
56
|
+
"fast-xml-parser": "^5.10.1",
|
|
57
|
+
"undici": "^8.9.0",
|
|
58
|
+
"valibot": "^1.4.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@biomejs/biome": "2.
|
|
61
|
+
"@biomejs/biome": "2.5.6",
|
|
62
62
|
"@tsconfig/node22": "^22.0.5",
|
|
63
|
-
"@types/node": "^
|
|
64
|
-
"dotenv": "^17.2
|
|
65
|
-
"rimraf": "^6.1.
|
|
66
|
-
"tsdown": "^0.
|
|
67
|
-
"typescript": "^
|
|
68
|
-
"vitest": "^4.
|
|
63
|
+
"@types/node": "^26.1.2",
|
|
64
|
+
"dotenv": "^17.4.2",
|
|
65
|
+
"rimraf": "^6.1.3",
|
|
66
|
+
"tsdown": "^0.22.14",
|
|
67
|
+
"typescript": "^7.0.2",
|
|
68
|
+
"vitest": "^4.1.10"
|
|
69
69
|
}
|
|
70
70
|
}
|