Skip to content

Commit a20ccc4

Browse files
committed
req: Updates reservation request parameters
Updates the reservation request in the console sample. Changes the confirmation number and removes duplicate reservation. Also corrects conditional logic for setting error responses.
1 parent d6fb82d commit a20ccc4

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

apps/GuestLineSDK.ConsoleSample/Program.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
var res = new ReservationRequest(
2828
DateTime.UtcNow,
29-
"X12345",
29+
"X12346",
3030
0,
3131
"Hotel Collect",
3232
999.99m,
@@ -44,10 +44,10 @@
4444
new(2026, 02, 16),
4545
"1299210STANDARD",
4646
[
47-
new ReservationRate(
48-
new(2026, 02, 15),
49-
"1299224125",
50-
999.99m)
47+
//new ReservationRate(
48+
// new(2026, 02, 15),
49+
// "1299224125",
50+
// 999.99m)
5151
],
5252
"Matthew",
5353
"Abbott",
@@ -61,7 +61,8 @@
6161
var reservationResult = await api.Reservation.ProcessReservationAsync(
6262
new GuestLineReservationRequest(
6363
"12992",
64-
[res, res]));
64+
[res]));
65+
6566

6667
//string json = GetARIUpdate();
6768

libs/GuestLineSDK/Api/ReservationOperations.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,15 @@ public async Task<GuestLineResponse<ReservationRefSet>> ProcessReservationAsync(
107107
Reservations = refs.ToArray(),
108108
TrackingId = trackingId
109109
},
110-
error: res.Error ?? new ErrorResponse() { Error = string.Join("\n", errors), Status = "Fail", TrackingId = trackingId }
111-
);
110+
error: res.Error != null || errors.Any()
111+
? res.Error ?? new ErrorResponse() { Error = string.Join("\n", errors), Status = "Fail", TrackingId = trackingId }
112+
: null
113+
)
114+
{
115+
RequestContent = res.RequestContent,
116+
ResponseContent = res.ResponseContent
117+
};
118+
112119
}
113120
}
114121

0 commit comments

Comments
 (0)