Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prices is an array and has a currency_code #34

Merged
merged 2 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ declare module "@luxuryescapes/lib-global" {
roomRateId: string;
name: string;
duration: number;
prices: {
prices: Array<{
currency_code: string;
price: number;
value: number;
nightly_price: number;
nightly_value: number;
};
}>;
}

export type LeHotelOfferType =
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@luxuryescapes/lib-global",
"version": "2.4.2",
"version": "2.4.3",
"description": "Lib for expanding functionality and deduplicating code between services",
"main": "compiled/index.js",
"types": "index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/offer/flexiNights.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function calculatePackagePrices(offerPackagePrices, extraNights = 0) {
return (offerPackagePrices ?? []).map((price) => {
return {
...price,
currency_code: price.currency_code,
price: price.price + extraNights * price.nightly_price,
value: price.value + extraNights * price.nightly_value,
nightly_price: price.nightly_price,
Expand Down