Merged in chore/price-calculation-tests (pull request #3072)
chore: Add more price calculation tests * Add tests and refactor types for getVoucherPrice * Add tests for sumPackagesRequestedPrice * Add tests for calculateVat Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -9,7 +9,6 @@ import { ChildBedTypeEnum } from "@scandic-hotels/trpc/enums/childBedTypeEnum"
|
||||
import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
|
||||
|
||||
import type { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import type { Packages } from "@scandic-hotels/trpc/types/packages"
|
||||
import type { JSX } from "react"
|
||||
|
||||
import type { RoomPackageCodes } from "../../types/components/selectRate/roomFilter"
|
||||
@@ -63,7 +62,12 @@ export function sumPackages(
|
||||
)
|
||||
}
|
||||
|
||||
export function sumPackagesRequestedPrice(packages: Packages | null) {
|
||||
export function sumPackagesRequestedPrice(
|
||||
packages:
|
||||
| { requestedPrice: { totalPrice: number; currency?: CurrencyEnum } }[]
|
||||
| null
|
||||
| undefined
|
||||
) {
|
||||
if (!packages || !packages.length) {
|
||||
return {
|
||||
currency: undefined,
|
||||
|
||||
Reference in New Issue
Block a user