Merged in chore/cleanup-scandic-web (pull request #2831)

chore: Cleanup scandic-web

* Remove unused files

* Remove unused and add missing packages

* Remove unused exports


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-09-18 15:33:00 +00:00
parent cc99f26727
commit 08804e8675
113 changed files with 45 additions and 2891 deletions

View File

@@ -1,6 +1,6 @@
import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast"
export function hasBreakfastPackageFromBookingFlow(
function hasBreakfastPackageFromBookingFlow(
packages: {
code: string
}[]
@@ -13,26 +13,6 @@ export function hasBreakfastPackageFromBookingFlow(
)
}
export function getBreakfastPackagesFromBookingFlow<T extends { code: string }>(
packages: T[]
): T[] | undefined {
// Since `FREE_CHILD_BREAKFAST` has the same code when breakfast is added
// in the booking flow and as ancillary we can't just do a simple filter on the codes.
// So we shortcircuit if there are no booking flow specific packages.
if (!packages || !hasBreakfastPackageFromBookingFlow(packages)) {
return undefined
}
return packages.filter(
(p) =>
p.code === BreakfastPackageEnum.REGULAR_BREAKFAST ||
p.code === BreakfastPackageEnum.FREE_MEMBER_BREAKFAST ||
p.code === BreakfastPackageEnum.CHILD_PAYING_BREAKFAST ||
p.code === BreakfastPackageEnum.FREE_CHILD_BREAKFAST ||
p.code === BreakfastPackageEnum.SPECIAL_PACKAGE_BREAKFAST
)
}
export function getBreakfastPackagesFromAncillaryFlow<
T extends { code: string },
>(packages: T[]): T[] | undefined {