feat(SW-2116): Use refId instead of confirmationNumber

This commit is contained in:
Michael Zetterberg
2025-05-04 11:11:15 +02:00
parent f681fa7675
commit b910b6a313
59 changed files with 491 additions and 310 deletions
@@ -21,22 +21,20 @@ function accessBooking(
) {
if (guest.membershipNumber) {
if (user) {
if (lastName.toLowerCase() === guest.lastName?.toLowerCase()) {
if (
user.membershipNumber === guest.membershipNumber &&
user.lastName.toLowerCase() === lastName.toLowerCase() &&
lastName.toLowerCase() === guest.lastName?.toLowerCase()
) {
return ACCESS_GRANTED
}
} else {
console.warn(
"Access to booking not granted due to anonymous user attempting accessing to logged in booking"
)
return ERROR_UNAUTHORIZED
}
return ERROR_UNAUTHORIZED
}
if (guest.lastName?.toLowerCase() === lastName.toLowerCase()) {
if (user) {
console.warn(
"Access to booking not granted due to logged in user attempting access to anonymous booking"
)
return ERROR_FORBIDDEN
} else {
const params = new URLSearchParams(cookie)
@@ -47,17 +45,11 @@ function accessBooking(
) {
return ACCESS_GRANTED
} else {
console.warn(
"Access to booking not granted due to incorrect cookie values"
)
return ERROR_BAD_REQUEST
}
}
}
console.warn(
"Access to booking not granted due to anonymous user attempting access with incorrect lastname"
)
return ERROR_NOT_FOUND
}