@curless/hotel-storefront 0.52.1 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/about.d.ts +24 -0
- package/dist/about.d.ts.map +1 -0
- package/dist/about.js +28 -0
- package/dist/about.js.map +1 -0
- package/dist/aggregate/hotels.d.ts.map +1 -1
- package/dist/aggregate/hotels.js +156 -37
- package/dist/aggregate/hotels.js.map +1 -1
- package/dist/aggregate/make.js +2 -2
- package/dist/aggregate/make.js.map +1 -1
- package/dist/backend.d.ts +34 -2
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +21 -0
- package/dist/backend.js.map +1 -1
- package/dist/card.generated.d.ts +1 -1
- package/dist/card.generated.js +2 -2
- package/dist/card.generated.js.map +1 -1
- package/dist/coupon-words.d.ts +12 -0
- package/dist/coupon-words.d.ts.map +1 -0
- package/dist/coupon-words.js +19 -0
- package/dist/coupon-words.js.map +1 -0
- package/dist/dates.js +1 -1
- package/dist/dates.js.map +1 -1
- package/dist/demo-hotels.d.ts +6 -0
- package/dist/demo-hotels.d.ts.map +1 -1
- package/dist/demo-hotels.js +80 -27
- package/dist/demo-hotels.js.map +1 -1
- package/dist/huazhu/backend.d.ts +6 -0
- package/dist/huazhu/backend.d.ts.map +1 -1
- package/dist/huazhu/backend.js +38 -30
- package/dist/huazhu/backend.js.map +1 -1
- package/dist/huazhu/catalog.d.ts.map +1 -1
- package/dist/huazhu/catalog.js +43 -6
- package/dist/huazhu/catalog.js.map +1 -1
- package/dist/huazhu/client.js +1 -1
- package/dist/huazhu/client.js.map +1 -1
- package/dist/huazhu/drift.d.ts.map +1 -1
- package/dist/huazhu/drift.js +3 -0
- package/dist/huazhu/drift.js.map +1 -1
- package/dist/huazhu/make.d.ts.map +1 -1
- package/dist/huazhu/make.js +1 -0
- package/dist/huazhu/make.js.map +1 -1
- package/dist/huazhu/sandbox.d.ts.map +1 -1
- package/dist/huazhu/sandbox.js +8 -1
- package/dist/huazhu/sandbox.js.map +1 -1
- package/dist/huazhu/wire.d.ts +7 -0
- package/dist/huazhu/wire.d.ts.map +1 -1
- package/dist/huazhu/wire.js.map +1 -1
- package/dist/money.d.ts.map +1 -1
- package/dist/money.js +3 -0
- package/dist/money.js.map +1 -1
- package/dist/paid.d.ts.map +1 -1
- package/dist/paid.js +3 -1
- package/dist/paid.js.map +1 -1
- package/dist/present.d.ts +14 -2
- package/dist/present.d.ts.map +1 -1
- package/dist/present.js +98 -7
- package/dist/present.js.map +1 -1
- package/dist/reference.d.ts.map +1 -1
- package/dist/reference.js +13 -6
- package/dist/reference.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +4 -4
- package/dist/server.js.map +1 -1
- package/dist/supplier.d.ts +6 -0
- package/dist/supplier.d.ts.map +1 -1
- package/dist/supplier.js +1 -0
- package/dist/supplier.js.map +1 -1
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +27 -18
- package/dist/surface.js.map +1 -1
- package/dist/tools.d.ts +11 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +480 -110
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +53 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/vocab.d.ts +15 -1
- package/dist/vocab.d.ts.map +1 -1
- package/dist/vocab.js +26 -2
- package/dist/vocab.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.generated.js","sourceRoot":"","sources":["../src/card.generated.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wEAAwE;AACxE,gFAAgF;AAChF,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAW,MAAM,CAAC,IAAI,CAChD,
|
|
1
|
+
{"version":3,"file":"card.generated.js","sourceRoot":"","sources":["../src/card.generated.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wEAAwE;AACxE,gFAAgF;AAChF,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAW,MAAM,CAAC,IAAI,CAChD,08lwCAA08lwC,EAC18lwC,QAAQ,CACT,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAEnB,6GAA6G;AAC7G,MAAM,CAAC,MAAM,qBAAqB,GAChC,kEAAkE,CAAC;AAErE,0GAA0G;AAC1G,MAAM,CAAC,MAAM,qBAAqB,GAChC,iLAAiL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HeldCoupon } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where a spent coupon went, for the text the model reads (T4, 0.54.0):
|
|
4
|
+
* "already used on a booking" sent the guest looking for one nobody named.
|
|
5
|
+
* The booking's code is said only where this conversation made it (sign-in is
|
|
6
|
+
* a membership number and a surname, not a password - see members.ts - so a
|
|
7
|
+
* booking made elsewhere is said to exist, never named); and the way back is
|
|
8
|
+
* the C10 rule: cancelling it while it is free gives the coupon back, a
|
|
9
|
+
* cancellation that charged kept it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const usedOnWords: (on: HeldCoupon["usedOn"]) => string;
|
|
12
|
+
//# sourceMappingURL=coupon-words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupon-words.d.ts","sourceRoot":"","sources":["../src/coupon-words.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAG,MAS4D,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a spent coupon went, for the text the model reads (T4, 0.54.0):
|
|
3
|
+
* "already used on a booking" sent the guest looking for one nobody named.
|
|
4
|
+
* The booking's code is said only where this conversation made it (sign-in is
|
|
5
|
+
* a membership number and a surname, not a password - see members.ts - so a
|
|
6
|
+
* booking made elsewhere is said to exist, never named); and the way back is
|
|
7
|
+
* the C10 rule: cancelling it while it is free gives the coupon back, a
|
|
8
|
+
* cancellation that charged kept it.
|
|
9
|
+
*/
|
|
10
|
+
export const usedOnWords = (on) => !on
|
|
11
|
+
? 'on a booking'
|
|
12
|
+
: on.stands
|
|
13
|
+
? on.code
|
|
14
|
+
? `on booking ${on.code}, which still stands - cancelling ${on.code} while it is free to cancel gives the coupon back`
|
|
15
|
+
: 'on another booking of this membership, made outside this conversation - cancelling that booking while it is free to cancel gives the coupon back'
|
|
16
|
+
: on.code
|
|
17
|
+
? `on booking ${on.code}, which has ended without giving it back (a cancellation that charged a fee keeps the coupon)`
|
|
18
|
+
: 'on a booking that has ended without giving it back (a cancellation that charged a fee keeps the coupon)';
|
|
19
|
+
//# sourceMappingURL=coupon-words.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupon-words.js","sourceRoot":"","sources":["../src/coupon-words.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAwB,EAAU,EAAE,CAC9D,CAAC,EAAE;IACD,CAAC,CAAC,cAAc;IAChB,CAAC,CAAC,EAAE,CAAC,MAAM;QACT,CAAC,CAAC,EAAE,CAAC,IAAI;YACP,CAAC,CAAC,cAAc,EAAE,CAAC,IAAI,qCAAqC,EAAE,CAAC,IAAI,mDAAmD;YACtH,CAAC,CAAC,kJAAkJ;QACtJ,CAAC,CAAC,EAAE,CAAC,IAAI;YACP,CAAC,CAAC,cAAc,EAAE,CAAC,IAAI,+FAA+F;YACtH,CAAC,CAAC,yGAAyG,CAAC"}
|
package/dist/dates.js
CHANGED
|
@@ -183,7 +183,7 @@ export const stayProblemOf = (stay, today) => {
|
|
|
183
183
|
};
|
|
184
184
|
if (n > MAX_NIGHTS)
|
|
185
185
|
return {
|
|
186
|
-
why: `
|
|
186
|
+
why: `Stays here are quoted for up to ${MAX_NIGHTS} nights at a time; that stay is ${n}.`,
|
|
187
187
|
code: 'stay-too-long',
|
|
188
188
|
args: { nights: MAX_NIGHTS },
|
|
189
189
|
};
|
package/dist/dates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.js","sourceRoot":"","sources":["../src/dates.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,mEAAmE;AAInE,oFAAoF;AACpF,MAAM,EAAE,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,YAAY,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;AAEjC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAU,EAAe,EAAE,CAC/C,OAAO,CAAC,KAAK,QAAQ;IACrB,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7B,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpB,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAErB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAU,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,CAAS,EAAU,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;AAEvF,qEAAqE;AACrE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,QAAgB,EAAU,EAAE,CAClE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAE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BAAkB;YAC1F,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;SAC/B,CAAC;IACJ,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;QACvE,OAAO,EAAE,GAAG,EAAE,yDAAyD,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IAClG,IAAI,MAAM,GAAG,UAAU;QACrB,OAAO;YACL,GAAG,EAAE,aAAa,UAAU,+CAA+C;YAC3E,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SAC9B,CAAC;IACJ,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
package/dist/demo-hotels.d.ts
CHANGED
|
@@ -240,6 +240,12 @@ export type DemoHotelsOptions = {
|
|
|
240
240
|
* two demonstration suppliers tells their codes apart by it.
|
|
241
241
|
*/
|
|
242
242
|
codePrefix?: string;
|
|
243
|
+
/**
|
|
244
|
+
* Made for a market (robin, 2026-11-03): it labels no environment as a demonstration,
|
|
245
|
+
* so its answers about a booking that is not real say the fact - not sent to the
|
|
246
|
+
* group, nothing charged - and never "demonstration".
|
|
247
|
+
*/
|
|
248
|
+
inMarket?: boolean;
|
|
243
249
|
/**
|
|
244
250
|
* What to switch off (or on) in `FULL_CAPABILITIES` - the config's
|
|
245
251
|
* `data.capabilities`. Absent, the demonstration offers everything.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demo-hotels.d.ts","sourceRoot":"","sources":["../src/demo-hotels.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"demo-hotels.d.ts","sourceR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KINDS, REQUEST_NOTE_MAX, guestTooLong, partyNeedsOf, } from './backend.js';
|
|
3
|
+
import { usedOnWords } from './coupon-words.js';
|
|
3
4
|
import { addDays, arrivalInstant, atHotelIso, atHotelTime, eachNight, isWeekendNight, nights as nightsBetween, stayProblem, stayProblemOf, todayAt, } from './dates.js';
|
|
4
5
|
import { FACILITIES, hasFacility } from './facilities.js';
|
|
5
6
|
import { addMoney, formatMoney, minorFactor, money, multiplyMoney, taxOn, toMinor, wholeUnits, } from './money.js';
|
|
@@ -263,6 +264,7 @@ export const createDemoHotels = (opts) => {
|
|
|
263
264
|
/** Saved room preferences, by membership number - see `preferencesFor`. */
|
|
264
265
|
const preferences = new Map();
|
|
265
266
|
const maxHeldRoomNights = opts.maxHeldRoomNights ?? MAX_HELD_ROOM_NIGHTS;
|
|
267
|
+
const inMarket = opts.inMarket === true;
|
|
266
268
|
const codePrefix = opts.codePrefix ?? 'SL';
|
|
267
269
|
// Other names for the places - see `RawHotelData.aliases`. Longest first,
|
|
268
270
|
// so a name is never read as part of a shorter one.
|
|
@@ -393,7 +395,7 @@ export const createDemoHotels = (opts) => {
|
|
|
393
395
|
/** The programme's coupon kinds, by id. */
|
|
394
396
|
const couponKinds = new Map((opts.data.membership?.coupons ?? []).map((c) => [c.id, c]));
|
|
395
397
|
/** A held coupon as the member sees it, on `today` - see `HeldCoupon`. */
|
|
396
|
-
const heldCoupon = (held, todayIs) => {
|
|
398
|
+
const heldCoupon = (held, todayIs, sessionId) => {
|
|
397
399
|
const kind = couponKinds.get(held.coupon);
|
|
398
400
|
if (!kind)
|
|
399
401
|
return undefined;
|
|
@@ -429,6 +431,7 @@ export const createDemoHotels = (opts) => {
|
|
|
429
431
|
: {}),
|
|
430
432
|
validFrom: held.validFrom,
|
|
431
433
|
validUntil: held.validUntil,
|
|
434
|
+
...usedOn(held.id, sessionId),
|
|
432
435
|
state: spent.has(held.id.toUpperCase())
|
|
433
436
|
? 'used'
|
|
434
437
|
: todayIs > held.validUntil
|
|
@@ -438,6 +441,19 @@ export const createDemoHotels = (opts) => {
|
|
|
438
441
|
: 'usable',
|
|
439
442
|
};
|
|
440
443
|
};
|
|
444
|
+
/** The booking a spent coupon went on, where it is still on record - see `HeldCoupon.usedOn`. */
|
|
445
|
+
const usedOn = (heldId, sessionId) => {
|
|
446
|
+
const on = spent.get(heldId.toUpperCase());
|
|
447
|
+
const b = on ? bookings.get(on) : undefined;
|
|
448
|
+
return b
|
|
449
|
+
? {
|
|
450
|
+
usedOn: {
|
|
451
|
+
stands: b.status === 'requested' || b.status === 'confirmed',
|
|
452
|
+
...(sessionId && b.owners.has(sessionId) ? { code: b.confirmationCode } : {}),
|
|
453
|
+
},
|
|
454
|
+
}
|
|
455
|
+
: {};
|
|
456
|
+
};
|
|
441
457
|
/** A member's coupons as they stand, usable first, then by when they run out. */
|
|
442
458
|
const heldCouponsOf = (raw) => {
|
|
443
459
|
const order = { usable: 0, 'not-yet': 1, used: 2, expired: 3 };
|
|
@@ -534,6 +550,16 @@ export const createDemoHotels = (opts) => {
|
|
|
534
550
|
* A booking that ended - cancelled, or a hold that lapsed - hands its coupon
|
|
535
551
|
* back while the coupon is in its dates on the hotel's calendar; once it has
|
|
536
552
|
* run out, it stays spent (§2). Said on the booking either way.
|
|
553
|
+
*
|
|
554
|
+
* ⚠️ AND ONLY WHEN NOTHING WAS CHARGED (robin, 2026-11-03, C10). A
|
|
555
|
+
* cancellation that charges a fee - any fee above nothing, a non-refundable
|
|
556
|
+
* rate or a free window already closed - counts the coupon as used: it
|
|
557
|
+
* already took money off a stay that is being paid for, and handing it back
|
|
558
|
+
* as well made it cover the penalty and return to the member's hand. A free
|
|
559
|
+
* cancellation, and a hold that lapsed unconfirmed, give it back as before.
|
|
560
|
+
* `b.cancellationFee` is set before this runs (`cancelBooking`); a lapse has
|
|
561
|
+
* none. `couponNotReturnedBecause` says which rule kept it - the date wins
|
|
562
|
+
* when both apply, as it keeps a coupon even from a free cancellation.
|
|
537
563
|
*/
|
|
538
564
|
const giveBack = (b, at = now()) => {
|
|
539
565
|
const c = b.quote.coupon;
|
|
@@ -541,10 +567,13 @@ export const createDemoHotels = (opts) => {
|
|
|
541
567
|
return;
|
|
542
568
|
// On the day it ended - a lapse noticed days later lapsed when its hold did.
|
|
543
569
|
const h = byId(b.hotelId);
|
|
544
|
-
const
|
|
570
|
+
const inDates = todayAt(at, h ? offsetOf(h) : DEFAULT_OFFSET) <= c.validUntil;
|
|
571
|
+
const charged = (b.cancellationFee?.minor ?? 0) > 0;
|
|
572
|
+
const returned = inDates && !charged;
|
|
545
573
|
if (returned)
|
|
546
574
|
spent.delete(c.id.toUpperCase());
|
|
547
575
|
b.couponReturned = returned;
|
|
576
|
+
b.couponNotReturnedBecause = returned ? undefined : inDates ? 'fee' : 'expired';
|
|
548
577
|
};
|
|
549
578
|
/** Room-nights the live holds that `pick` chooses take, leaving out `ignore`. */
|
|
550
579
|
const heldBy = (pick, ignore) => [...bookings.values()]
|
|
@@ -559,7 +588,7 @@ export const createDemoHotels = (opts) => {
|
|
|
559
588
|
for (const q of quotes) {
|
|
560
589
|
const n = roomNightsOf(q);
|
|
561
590
|
if (n > MAX_ROOM_NIGHTS_PER_BOOKING) {
|
|
562
|
-
return demoError('too-many-holds', `Nothing was ${done}. A demonstration booking holds at most ${MAX_ROOM_NIGHTS_PER_BOOKING} room-nights (rooms times nights), and this would be ${n}. Fewer rooms or fewer nights will go through.`);
|
|
591
|
+
return demoError('too-many-holds', `Nothing was ${done}. ${inMarket ? 'A booking here' : 'A demonstration booking'} holds at most ${MAX_ROOM_NIGHTS_PER_BOOKING} room-nights (rooms times nights), and this would be ${n}. Fewer rooms or fewer nights will go through.`);
|
|
563
592
|
}
|
|
564
593
|
}
|
|
565
594
|
const asked = quotes.reduce((sum, q) => sum + roomNightsOf(q), 0);
|
|
@@ -568,7 +597,7 @@ export const createDemoHotels = (opts) => {
|
|
|
568
597
|
return demoError('too-many-holds',
|
|
569
598
|
// The numbers that add up: "holds 16, and 20 is the most" read as
|
|
570
599
|
// room to spare (round-1 jury of the card redesign, 2026-10-12).
|
|
571
|
-
`Nothing was ${done}. This conversation already holds ${mine} room-nights, and this would bring it to ${mine + asked} — more than the ${MAX_ROOM_NIGHTS_PER_CONVERSATION} room-nights a demonstration can hold at once. Cancel a booking that is not needed, then ask again.`);
|
|
600
|
+
`Nothing was ${done}. This conversation already holds ${mine} room-nights, and this would bring it to ${mine + asked} — more than the ${MAX_ROOM_NIGHTS_PER_CONVERSATION} room-nights ${inMarket ? 'that can be held here' : 'a demonstration can hold'} at once. Cancel a booking that is not needed, then ask again.`);
|
|
572
601
|
}
|
|
573
602
|
const address = email.trim().toLowerCase();
|
|
574
603
|
if (address &&
|
|
@@ -577,7 +606,7 @@ export const createDemoHotels = (opts) => {
|
|
|
577
606
|
return demoError('too-many-holds', `Nothing was ${done}. That email already holds as many room-nights as one guest may at once - cancel a booking that is not needed, then ask again.`);
|
|
578
607
|
}
|
|
579
608
|
if (heldBy(() => true, ignore) + asked > maxHeldRoomNights) {
|
|
580
|
-
return demoError('demo-busy', `Nothing was ${done}. This demonstration holds only so many rooms at once, across everybody using it, and that many are held right now; holds lapse on their own within a couple of hours. The trip is as it was - try again later.`);
|
|
609
|
+
return demoError('demo-busy', `Nothing was ${done}. ${inMarket ? 'Only so many rooms can be held here' : 'This demonstration holds only so many rooms'} at once, across everybody using it, and that many are held right now; holds lapse on their own within a couple of hours. The trip is as it was - try again later.`);
|
|
581
610
|
}
|
|
582
611
|
return undefined;
|
|
583
612
|
};
|
|
@@ -857,7 +886,7 @@ export const createDemoHotels = (opts) => {
|
|
|
857
886
|
if (!h) {
|
|
858
887
|
dropped.push({
|
|
859
888
|
title: line.hotelId,
|
|
860
|
-
why: 'That hotel is not
|
|
889
|
+
why: 'That hotel is not offered here any more.',
|
|
861
890
|
code: 'none-on-sale',
|
|
862
891
|
});
|
|
863
892
|
continue;
|
|
@@ -1015,7 +1044,7 @@ export const createDemoHotels = (opts) => {
|
|
|
1015
1044
|
const member = who?.member;
|
|
1016
1045
|
// Every line's tax is already a whole unit - see `taxOn`.
|
|
1017
1046
|
const taxed = taxes;
|
|
1018
|
-
const { coupons, coupon, couponRefused } = couponsFor(trip.coupon, member, lines, cur);
|
|
1047
|
+
const { coupons, coupon, couponRefused } = couponsFor(trip.coupon, member, lines, cur, who?.sessionId);
|
|
1019
1048
|
// The coupon comes off the all-in total, after the tier (§2): what is
|
|
1020
1049
|
// paid at the hotel, and what points are earned on.
|
|
1021
1050
|
const paid = subtotal + taxed - (coupon?.off.minor ?? 0);
|
|
@@ -1049,12 +1078,19 @@ export const createDemoHotels = (opts) => {
|
|
|
1049
1078
|
* What a coupon takes off a stay that comes to `base` (minor units, all in at
|
|
1050
1079
|
* the member rate): an amount, or a fraction rounded DOWN to the whole unit
|
|
1051
1080
|
* and capped - never more than the stay (§2).
|
|
1081
|
+
*
|
|
1082
|
+
* ⚠️ THE FRACTION IS WORKED IN INTEGER BASIS POINTS (2026-11-03 review, C7).
|
|
1083
|
+
* `base * 0.35` is 7699.999999999999 for a ¥220 stay, which rounded down to
|
|
1084
|
+
* ¥76 where 35% of ¥220 is ¥77. Money is integers here, and so is the rate:
|
|
1085
|
+
* 0.35 is 3500 basis points, and `base * 3500 / (10000 * factor)` is exact.
|
|
1052
1086
|
*/
|
|
1053
1087
|
const offOf = (kind, base) => {
|
|
1054
1088
|
const cur = kind.currency;
|
|
1089
|
+
const factor = minorFactor(cur);
|
|
1090
|
+
const basisPoints = Math.round((kind.percentOff ?? 0) * 10_000);
|
|
1055
1091
|
const off = kind.kind === 'amount-off'
|
|
1056
1092
|
? toMinor(kind.amountOff ?? 0, cur)
|
|
1057
|
-
: Math.min(Math.floor((base *
|
|
1093
|
+
: Math.min(Math.floor((base * basisPoints) / (10_000 * factor)) * factor, kind.maxOff === undefined ? Number.POSITIVE_INFINITY : toMinor(kind.maxOff, cur));
|
|
1058
1094
|
return Math.max(0, Math.min(off, base));
|
|
1059
1095
|
};
|
|
1060
1096
|
/**
|
|
@@ -1066,7 +1102,7 @@ export const createDemoHotels = (opts) => {
|
|
|
1066
1102
|
* member rate; add-ons are not rooms and do not count. Two or three rooms of
|
|
1067
1103
|
* one stay are one stay: taken off once.
|
|
1068
1104
|
*/
|
|
1069
|
-
const couponsFor = (asked, member, lines, cur) => {
|
|
1105
|
+
const couponsFor = (asked, member, lines, cur, sessionId) => {
|
|
1070
1106
|
const raw = rawMember(member);
|
|
1071
1107
|
if (!couponKinds.size) {
|
|
1072
1108
|
return asked
|
|
@@ -1106,12 +1142,12 @@ export const createDemoHotels = (opts) => {
|
|
|
1106
1142
|
const kind = couponKinds.get(held.coupon);
|
|
1107
1143
|
// Its dates on the calendar of the hotel it would go on - all of them
|
|
1108
1144
|
// are on one clock in this demonstration, so the trip's first.
|
|
1109
|
-
const c = kind && heldCoupon(held, today(stays[0]?.hotel.id));
|
|
1145
|
+
const c = kind && heldCoupon(held, today(stays[0]?.hotel.id), sessionId);
|
|
1110
1146
|
if (!kind || !c)
|
|
1111
1147
|
continue;
|
|
1112
1148
|
const no = (code, why, more = {}) => options.push({ ...c, code, why, ...more });
|
|
1113
1149
|
if (c.state === 'used') {
|
|
1114
|
-
no('used',
|
|
1150
|
+
no('used', `It has already been used ${usedOnWords(c.usedOn)}.`);
|
|
1115
1151
|
continue;
|
|
1116
1152
|
}
|
|
1117
1153
|
if (c.state === 'expired') {
|
|
@@ -1357,11 +1393,11 @@ export const createDemoHotels = (opts) => {
|
|
|
1357
1393
|
? rooms.find((l) => h.rooms.find((r) => r.id === l.roomRef)?.refundable === false)
|
|
1358
1394
|
: undefined;
|
|
1359
1395
|
if (locked)
|
|
1360
|
-
return no(`${locked.title} is a non-refundable rate: it cannot be
|
|
1396
|
+
return no(`${locked.title} is a non-refundable rate: it cannot be changed, and cancelling it costs the whole stay. Book the new nights as their own stay - this one stands.`);
|
|
1361
1397
|
// A coupon was worked out on these nights and rooms (§2): moved, it would
|
|
1362
1398
|
// have to be worked out again, and may no longer apply. Not in place yet.
|
|
1363
1399
|
if (b.quote.coupon && movesRooms)
|
|
1364
|
-
return no(`This booking used the coupon ${b.quote.coupon.name}, and a booking made with a coupon cannot be moved in place yet: cancel it (the coupon comes back
|
|
1400
|
+
return no(`This booking used the coupon ${b.quote.coupon.name}, and a booking made with a coupon cannot be moved in place yet: cancel it (the coupon comes back when the cancellation is free and it is still in its dates) and book the new nights.`);
|
|
1365
1401
|
// "No rooms" is not a smaller booking. It became one room without a word.
|
|
1366
1402
|
if (change.rooms !== undefined && !(Math.floor(change.rooms) >= 1))
|
|
1367
1403
|
return no('A booking keeps at least one room. To give them all back, cancel it instead.');
|
|
@@ -1463,9 +1499,11 @@ export const createDemoHotels = (opts) => {
|
|
|
1463
1499
|
? `The new nights are priced at today's rates for those nights, not at the rate this booking was made on.`
|
|
1464
1500
|
: '',
|
|
1465
1501
|
// A demonstration has no desk to settle it at (2026-10-05 audit, P2).
|
|
1466
|
-
|
|
1502
|
+
inMarket
|
|
1503
|
+
? 'Nothing has been charged and nothing will be: this booking was not sent to the hotel group, so a difference is only what a real booking would cost more or less.'
|
|
1504
|
+
: 'Nothing has been charged and nothing will be: this is a demonstration, so a difference is only what a real booking would cost more or less.',
|
|
1467
1505
|
becomesLocked
|
|
1468
|
-
? `${wantedRoom.name} is a non-refundable rate: once the booking is on it, it cannot be
|
|
1506
|
+
? `${wantedRoom.name} is a non-refundable rate: once the booking is on it, it cannot be changed, and cancelling it costs the whole stay.`
|
|
1469
1507
|
: '',
|
|
1470
1508
|
]
|
|
1471
1509
|
.filter(Boolean)
|
|
@@ -2098,7 +2136,7 @@ export const createDemoHotels = (opts) => {
|
|
|
2098
2136
|
// file cannot be written (state.ts), a new booking would live only in
|
|
2099
2137
|
// memory and vanish at the next deploy - with a code the guest was given.
|
|
2100
2138
|
if (opts.state?.trouble) {
|
|
2101
|
-
throw demoError('demo-busy',
|
|
2139
|
+
throw demoError('demo-busy', `Nothing was booked. ${inMarket ? 'Bookings cannot be taken here' : 'This demonstration cannot take bookings'} right now - try again later.`);
|
|
2102
2140
|
}
|
|
2103
2141
|
// A trip with no room night in it has nothing to book - only add-ons.
|
|
2104
2142
|
if (!trip.lines.some((l) => l.kind === 'room')) {
|
|
@@ -2167,7 +2205,11 @@ export const createDemoHotels = (opts) => {
|
|
|
2167
2205
|
if (wantCoupon && !couponDone) {
|
|
2168
2206
|
const whole = await quoteTrip({ lines: fresh.flatMap((f) => f.lines), coupon: trip.coupon }, who);
|
|
2169
2207
|
if (whole.couponRefused) {
|
|
2170
|
-
throw demoError('coupon',
|
|
2208
|
+
throw demoError('coupon',
|
|
2209
|
+
// ⚠️ SAID ONCE (T6, 0.54.0): the trip drawn again under this says
|
|
2210
|
+
// which coupon and why, in the words every other answer uses -
|
|
2211
|
+
// this said it as well, under its English name only.
|
|
2212
|
+
'Nothing was booked, because the coupon asked for cannot be used - the trip below says which and why. Book without it only if the guest says so.');
|
|
2171
2213
|
}
|
|
2172
2214
|
const c = whole.coupon;
|
|
2173
2215
|
couponAt = c ? `${c.hotelId}|${c.checkIn}|${c.checkOut}` : undefined;
|
|
@@ -2358,22 +2400,33 @@ export const createDemoHotels = (opts) => {
|
|
|
2358
2400
|
? [
|
|
2359
2401
|
...rules,
|
|
2360
2402
|
// ⚠️ NO CARD AND NO CHECK-IN IN A DEMONSTRATION (2026-10-05 audit, P2).
|
|
2361
|
-
|
|
2403
|
+
inMarket
|
|
2404
|
+
? 'This booking was not sent to the hotel group: nothing has been charged and nothing will be - a fee here is what a real booking on these terms would cost, not a charge.'
|
|
2405
|
+
: 'This is a demonstration booking: nothing has been charged and nothing will be - a fee here is what a real booking on these terms would cost, not a charge.',
|
|
2362
2406
|
].join(' ')
|
|
2363
2407
|
: `This booking is ${b.status}; there is nothing left to cancel.`,
|
|
2364
2408
|
freeUntil,
|
|
2365
2409
|
cancellable,
|
|
2366
2410
|
...(steps ? { steps } : {}),
|
|
2367
2411
|
...(cancellable && b.quote.coupon
|
|
2368
|
-
? {
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2412
|
+
? (() => {
|
|
2413
|
+
// The same rule as `giveBack`, asked before it happens: back only
|
|
2414
|
+
// while it is in its dates AND cancelling costs nothing (C10).
|
|
2415
|
+
const inDates = today(b.hotelId) <= b.quote.coupon.validUntil;
|
|
2416
|
+
const returned = inDates && fee.minor === 0;
|
|
2417
|
+
return {
|
|
2418
|
+
coupon: {
|
|
2419
|
+
id: b.quote.coupon.id,
|
|
2420
|
+
name: b.quote.coupon.name,
|
|
2421
|
+
...(b.quote.coupon.names ? { names: b.quote.coupon.names } : {}),
|
|
2422
|
+
validUntil: b.quote.coupon.validUntil,
|
|
2423
|
+
returned,
|
|
2424
|
+
...(returned
|
|
2425
|
+
? {}
|
|
2426
|
+
: { notReturnedBecause: inDates ? 'fee' : 'expired' }),
|
|
2427
|
+
},
|
|
2428
|
+
};
|
|
2429
|
+
})()
|
|
2377
2430
|
: {}),
|
|
2378
2431
|
};
|
|
2379
2432
|
},
|