The error can redirect to an error page, you can control this behavior with a Boolean
Upon a 500 error, a notification is sent into the Google Chat room
One topic should be in one file, business logic in a service file
External services should be in a repo file, so these can be replaced easily
URLs should be in a constant file for now, later this will be placed inside configuration
Outside functions and repos encourages code not to be duplicated
Old data structure
{ "bookingId": "35003156", "checkIn": "September 20, 2022 at 10:29:33 PM UTC+2 (Firestore timestamp)", "checkOut": "September 20, 2022 at 10:29:33 PM UTC+2 (Firestore timestamp)", "createdAt": "September 19, 2022 at 10:29:33 PM UTC+2 (Firestore timestamp)", "lastUpdatedAt": "September 20, 2022 at 10:29:33 PM UTC+2 (Firestore timestamp)", "status": "Confirmed", "issuer": { "firstName": "attila", "lastName": "berczik", "taxNumber": "563765", "email": "attila.982388@gmail.com", "phoneNumber": "+65765656545" }, "differentInvoiceAddressRequired": true, "properties": [ { "origin": { "source": "Beds24", "format": "JSON", "api": "1.2.3", "saved": "September 20, 2000 at 10:29:33 PM UTC+2 (Firestore timestamp)", "data": "..." }, "guests": [ { "title": "Dr", "firstName": "attila", "lastName": "berczik", "address": "pityóka street 3", "postalCode": "2334", "city": "Budapest", "country": "Hungary", "dateOfBirth": "2003-10-12", "gender": "male", "nationality": "Hungarian", "idNumber": "367645736835", "typeOfID": "id-card", "placeOfBirth": "Bolivia", "email": "attila.982388@gmail.com" } ], "guestNumber": 2, "owner": "BESK", "propertyName": "Test Property", "propertyId": "46754", "bookingId": "35003156", "paid": 235.54, "currency": "EUR" } ]}