@curless/hotel-storefront 0.85.0 → 0.86.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/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/tools/accept-terms.d.ts +4 -0
- package/dist/tools/accept-terms.d.ts.map +1 -0
- package/dist/tools/accept-terms.js +26 -0
- package/dist/tools/accept-terms.js.map +1 -0
- package/dist/tools/add-booking-addon.d.ts +4 -0
- package/dist/tools/add-booking-addon.d.ts.map +1 -0
- package/dist/tools/add-booking-addon.js +44 -0
- package/dist/tools/add-booking-addon.js.map +1 -0
- package/dist/tools/add-to-trip.d.ts +4 -0
- package/dist/tools/add-to-trip.d.ts.map +1 -0
- package/dist/tools/add-to-trip.js +49 -0
- package/dist/tools/add-to-trip.js.map +1 -0
- package/dist/tools/all-tools.d.ts +1342 -0
- package/dist/tools/all-tools.d.ts.map +1 -0
- package/dist/tools/all-tools.js +954 -0
- package/dist/tools/all-tools.js.map +1 -0
- package/dist/tools/answer.d.ts +3 -0
- package/dist/tools/answer.d.ts.map +1 -0
- package/dist/tools/answer.js +104 -0
- package/dist/tools/answer.js.map +1 -0
- package/dist/tools/args.d.ts +149 -0
- package/dist/tools/args.d.ts.map +1 -0
- package/dist/tools/args.js +176 -0
- package/dist/tools/args.js.map +1 -0
- package/dist/tools/base-output-schemas.d.ts +3 -0
- package/dist/tools/base-output-schemas.d.ts.map +1 -0
- package/dist/tools/base-output-schemas.js +380 -0
- package/dist/tools/base-output-schemas.js.map +1 -0
- package/dist/tools/book-picked.d.ts +4 -0
- package/dist/tools/book-picked.d.ts.map +1 -0
- package/dist/tools/book-picked.js +14 -0
- package/dist/tools/book-picked.js.map +1 -0
- package/dist/tools/booking-answer.d.ts +24 -0
- package/dist/tools/booking-answer.d.ts.map +1 -0
- package/dist/tools/booking-answer.js +485 -0
- package/dist/tools/booking-answer.js.map +1 -0
- package/dist/tools/buy-shop-item.d.ts +4 -0
- package/dist/tools/buy-shop-item.d.ts.map +1 -0
- package/dist/tools/buy-shop-item.js +45 -0
- package/dist/tools/buy-shop-item.js.map +1 -0
- package/dist/tools/call.d.ts +11 -0
- package/dist/tools/call.d.ts.map +1 -0
- package/dist/tools/call.js +2 -0
- package/dist/tools/call.js.map +1 -0
- package/dist/tools/cancel-facts.d.ts +281 -0
- package/dist/tools/cancel-facts.d.ts.map +1 -0
- package/dist/tools/cancel-facts.js +309 -0
- package/dist/tools/cancel-facts.js.map +1 -0
- package/dist/tools/cancel.d.ts +4 -0
- package/dist/tools/cancel.d.ts.map +1 -0
- package/dist/tools/cancel.js +364 -0
- package/dist/tools/cancel.js.map +1 -0
- package/dist/tools/card-addons.d.ts +4 -0
- package/dist/tools/card-addons.d.ts.map +1 -0
- package/dist/tools/card-addons.js +76 -0
- package/dist/tools/card-addons.js.map +1 -0
- package/dist/tools/change-booking.d.ts +4 -0
- package/dist/tools/change-booking.d.ts.map +1 -0
- package/dist/tools/change-booking.js +145 -0
- package/dist/tools/change-booking.js.map +1 -0
- package/dist/tools/clear-trip.d.ts +4 -0
- package/dist/tools/clear-trip.d.ts.map +1 -0
- package/dist/tools/clear-trip.js +10 -0
- package/dist/tools/clear-trip.js.map +1 -0
- package/dist/tools/compare.d.ts +4 -0
- package/dist/tools/compare.d.ts.map +1 -0
- package/dist/tools/compare.js +114 -0
- package/dist/tools/compare.js.map +1 -0
- package/dist/tools/current-trip.d.ts +70 -0
- package/dist/tools/current-trip.d.ts.map +1 -0
- package/dist/tools/current-trip.js +261 -0
- package/dist/tools/current-trip.js.map +1 -0
- package/dist/tools/deps.d.ts +229 -0
- package/dist/tools/deps.d.ts.map +1 -0
- package/dist/tools/deps.js +2 -0
- package/dist/tools/deps.js.map +1 -0
- package/dist/tools/follow-ups.d.ts +120 -0
- package/dist/tools/follow-ups.d.ts.map +1 -0
- package/dist/tools/follow-ups.js +369 -0
- package/dist/tools/follow-ups.js.map +1 -0
- package/dist/tools/forget-preferences.d.ts +4 -0
- package/dist/tools/forget-preferences.d.ts.map +1 -0
- package/dist/tools/forget-preferences.js +24 -0
- package/dist/tools/forget-preferences.js.map +1 -0
- package/dist/tools/get-hotel.d.ts +4 -0
- package/dist/tools/get-hotel.d.ts.map +1 -0
- package/dist/tools/get-hotel.js +324 -0
- package/dist/tools/get-hotel.js.map +1 -0
- package/dist/tools/hotel-choices.d.ts +132 -0
- package/dist/tools/hotel-choices.d.ts.map +1 -0
- package/dist/tools/hotel-choices.js +558 -0
- package/dist/tools/hotel-choices.js.map +1 -0
- package/dist/tools/itinerary.d.ts +4 -0
- package/dist/tools/itinerary.d.ts.map +1 -0
- package/dist/tools/itinerary.js +148 -0
- package/dist/tools/itinerary.js.map +1 -0
- package/dist/tools/list-booking-addons.d.ts +4 -0
- package/dist/tools/list-booking-addons.d.ts.map +1 -0
- package/dist/tools/list-booking-addons.js +21 -0
- package/dist/tools/list-booking-addons.js.map +1 -0
- package/dist/tools/list-bookings.d.ts +4 -0
- package/dist/tools/list-bookings.d.ts.map +1 -0
- package/dist/tools/list-bookings.js +119 -0
- package/dist/tools/list-bookings.js.map +1 -0
- package/dist/tools/list-extras.d.ts +4 -0
- package/dist/tools/list-extras.d.ts.map +1 -0
- package/dist/tools/list-extras.js +90 -0
- package/dist/tools/list-extras.js.map +1 -0
- package/dist/tools/list-hotels.d.ts +4 -0
- package/dist/tools/list-hotels.d.ts.map +1 -0
- package/dist/tools/list-hotels.js +891 -0
- package/dist/tools/list-hotels.js.map +1 -0
- package/dist/tools/list-shop-items.d.ts +4 -0
- package/dist/tools/list-shop-items.d.ts.map +1 -0
- package/dist/tools/list-shop-items.js +34 -0
- package/dist/tools/list-shop-items.js.map +1 -0
- package/dist/tools/list-shop-orders.d.ts +4 -0
- package/dist/tools/list-shop-orders.d.ts.map +1 -0
- package/dist/tools/list-shop-orders.js +22 -0
- package/dist/tools/list-shop-orders.js.map +1 -0
- package/dist/tools/look-up.d.ts +4 -0
- package/dist/tools/look-up.d.ts.map +1 -0
- package/dist/tools/look-up.js +170 -0
- package/dist/tools/look-up.js.map +1 -0
- package/dist/tools/output-schemas.d.ts +645 -0
- package/dist/tools/output-schemas.d.ts.map +1 -0
- package/dist/tools/output-schemas.js +503 -0
- package/dist/tools/output-schemas.js.map +1 -0
- package/dist/tools/paid-lines.d.ts +718 -0
- package/dist/tools/paid-lines.d.ts.map +1 -0
- package/dist/tools/paid-lines.js +359 -0
- package/dist/tools/paid-lines.js.map +1 -0
- package/dist/tools/pay-with-union-pay.d.ts +4 -0
- package/dist/tools/pay-with-union-pay.d.ts.map +1 -0
- package/dist/tools/pay-with-union-pay.js +112 -0
- package/dist/tools/pay-with-union-pay.js.map +1 -0
- package/dist/tools/payment-words.d.ts +269 -0
- package/dist/tools/payment-words.d.ts.map +1 -0
- package/dist/tools/payment-words.js +365 -0
- package/dist/tools/payment-words.js.map +1 -0
- package/dist/tools/pick-room.d.ts +4 -0
- package/dist/tools/pick-room.d.ts.map +1 -0
- package/dist/tools/pick-room.js +23 -0
- package/dist/tools/pick-room.js.map +1 -0
- package/dist/tools/policies.d.ts +4 -0
- package/dist/tools/policies.d.ts.map +1 -0
- package/dist/tools/policies.js +74 -0
- package/dist/tools/policies.js.map +1 -0
- package/dist/tools/pricing.d.ts +55 -0
- package/dist/tools/pricing.d.ts.map +1 -0
- package/dist/tools/pricing.js +260 -0
- package/dist/tools/pricing.js.map +1 -0
- package/dist/tools/put-room-line.d.ts +12 -0
- package/dist/tools/put-room-line.d.ts.map +1 -0
- package/dist/tools/put-room-line.js +314 -0
- package/dist/tools/put-room-line.js.map +1 -0
- package/dist/tools/quote-card.d.ts +234 -0
- package/dist/tools/quote-card.d.ts.map +1 -0
- package/dist/tools/quote-card.js +375 -0
- package/dist/tools/quote-card.js.map +1 -0
- package/dist/tools/refund-booking.d.ts +4 -0
- package/dist/tools/refund-booking.d.ts.map +1 -0
- package/dist/tools/refund-booking.js +112 -0
- package/dist/tools/refund-booking.js.map +1 -0
- package/dist/tools/request-booking.d.ts +4 -0
- package/dist/tools/request-booking.d.ts.map +1 -0
- package/dist/tools/request-booking.js +5 -0
- package/dist/tools/request-booking.js.map +1 -0
- package/dist/tools/request-words.d.ts +238 -0
- package/dist/tools/request-words.d.ts.map +1 -0
- package/dist/tools/request-words.js +487 -0
- package/dist/tools/request-words.js.map +1 -0
- package/dist/tools/room-choices.d.ts +64 -0
- package/dist/tools/room-choices.d.ts.map +1 -0
- package/dist/tools/room-choices.js +348 -0
- package/dist/tools/room-choices.js.map +1 -0
- package/dist/tools/session-notes.d.ts +164 -0
- package/dist/tools/session-notes.d.ts.map +1 -0
- package/dist/tools/session-notes.js +412 -0
- package/dist/tools/session-notes.js.map +1 -0
- package/dist/tools/sign-in.d.ts +4 -0
- package/dist/tools/sign-in.d.ts.map +1 -0
- package/dist/tools/sign-in.js +72 -0
- package/dist/tools/sign-in.js.map +1 -0
- package/dist/tools/sign-out.d.ts +4 -0
- package/dist/tools/sign-out.d.ts.map +1 -0
- package/dist/tools/sign-out.js +13 -0
- package/dist/tools/sign-out.js.map +1 -0
- package/dist/tools/terms-answer.d.ts +114 -0
- package/dist/tools/terms-answer.d.ts.map +1 -0
- package/dist/tools/terms-answer.js +475 -0
- package/dist/tools/terms-answer.js.map +1 -0
- package/dist/tools/tool-set.d.ts +1474 -0
- package/dist/tools/tool-set.d.ts.map +1 -0
- package/dist/tools/tool-set.js +497 -0
- package/dist/tools/tool-set.js.map +1 -0
- package/dist/tools/view-trip.d.ts +4 -0
- package/dist/tools/view-trip.d.ts.map +1 -0
- package/dist/tools/view-trip.js +7 -0
- package/dist/tools/view-trip.js.map +1 -0
- package/dist/tools.d.ts +13 -2089
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +11 -10685
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { FULL_CAPABILITIES } from '../backend.js';
|
|
2
|
+
import { usedOnWords } from '../coupon-words.js';
|
|
3
|
+
import { stayDayWords } from '../dates.js';
|
|
4
|
+
import { hotelName } from '../fence.js';
|
|
5
|
+
import { stayWords } from '../hourly.js';
|
|
6
|
+
import { formatMoney, money, multiplyMoney } from '../money.js';
|
|
7
|
+
import { memberForCard } from './args.js';
|
|
8
|
+
import { common } from './paid-lines.js';
|
|
9
|
+
import { REQUEST_WORDS, termsWords } from './request-words.js';
|
|
10
|
+
import { askLater } from './session-notes.js';
|
|
11
|
+
/**
|
|
12
|
+
* The language the CARD speaks to this guest - its own buttons, labels and
|
|
13
|
+
* dates. What the server writes for the model stays English.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ PER TRIP, NOT ONLY PER BRAND (总线程, 2026-10-12): today it is the
|
|
16
|
+
* deployment's (Huazhu's single store is Chinese), and a guest's own choice -
|
|
17
|
+
* as the market's \`set_language\` keeps one per buyer - is meant to come in
|
|
18
|
+
* HERE, by \`key\`, without the card or the schema changing.
|
|
19
|
+
*/
|
|
20
|
+
export const langOf = (deps, _key) => deps.lang;
|
|
21
|
+
/**
|
|
22
|
+
* When a room stops being free to cancel, the way a guest reads it: the
|
|
23
|
+
* hotel's own clock when the backend knows it, else the instant in UTC - never
|
|
24
|
+
* the date alone (see `atHotelTime`).
|
|
25
|
+
*/
|
|
26
|
+
/** A rate whose own name already says it cannot be refunded - see T10 where a booking is said. */
|
|
27
|
+
export const SAYS_NON_REFUNDABLE = /non-?refundable|不可取消|不可退|不能取消/i;
|
|
28
|
+
export const freeUntilText = (r) => r.freeCancellationLocal ??
|
|
29
|
+
`${(r.freeCancellationUntil ?? '').slice(0, 16).replace('T', ' ')} UTC`;
|
|
30
|
+
/** Any Han character: a name already in Chinese needs none beside it. */
|
|
31
|
+
const HAN = /\p{Script=Han}/u;
|
|
32
|
+
/**
|
|
33
|
+
* A name as the words to a client that draws no card say it: the plain name,
|
|
34
|
+
* then the group's own Chinese name in () where it has one the plain name is
|
|
35
|
+
* not.
|
|
36
|
+
*
|
|
37
|
+
* ⚠️ THE GROUP'S NAME, NOT THE MODEL'S (2026-11-02 audit, P1-1). The Chinese
|
|
38
|
+
* names were only in the structure, and a model that is handed the text alone
|
|
39
|
+
* told a Chinese guest 「浦东凯里酒店」 for 上海浦东嘉里大酒店 - a name nobody
|
|
40
|
+
* can find the hotel by. A card host is told the plain name as ever: its card
|
|
41
|
+
* says the Chinese.
|
|
42
|
+
*/
|
|
43
|
+
export const withZh = (name, names, noCards) => {
|
|
44
|
+
const plain = hotelName(name);
|
|
45
|
+
const zh = noCards && names?.zh ? hotelName(names.zh) : '';
|
|
46
|
+
return zh && zh !== plain && !HAN.test(plain) ? `${plain}(${zh})` : plain;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* What a signed-in member's prices are, said once at the top of a hotel's
|
|
50
|
+
* rooms - with the cheapest one's public and member figures, so "member rate"
|
|
51
|
+
* is a number the guest can check (10-30: the rooms were at the member rate
|
|
52
|
+
* and nothing told the model so).
|
|
53
|
+
*/
|
|
54
|
+
export const memberRatesOf = (rooms, roomsWanted) => {
|
|
55
|
+
const priced = rooms.filter((r) => r.memberRate && r.publicStayTotal);
|
|
56
|
+
const cheapest = priced.reduce((a, r) => (!a || r.stayTotal.minor < a.stayTotal.minor ? r : a), undefined);
|
|
57
|
+
const m = cheapest?.memberRate;
|
|
58
|
+
if (!cheapest?.publicStayTotal || !m)
|
|
59
|
+
return undefined;
|
|
60
|
+
const n = Math.max(1, roomsWanted);
|
|
61
|
+
return {
|
|
62
|
+
programme: m.programme,
|
|
63
|
+
tier: m.tier,
|
|
64
|
+
discount: m.discount,
|
|
65
|
+
said: `Prices here are the ${m.programme} ${m.tier} member rate, ${Math.round(m.discount * 100)}% below the public rate - the cheapest, ${cheapest.name}, is ${formatMoney(multiplyMoney(cheapest.publicStayTotal, n))} at the public rate and ${formatMoney(multiplyMoney(cheapest.stayTotal, n))} at the member rate for the stay${n > 1 ? ` (${n} rooms)` : ''}.`,
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/** A held coupon for the card: its amounts as text, like every amount the card is given. */
|
|
69
|
+
export const couponForCard = (c) => ({
|
|
70
|
+
...c,
|
|
71
|
+
...(c.amountOff ? { amountOff: formatMoney(c.amountOff) } : {}),
|
|
72
|
+
...(c.maxOff ? { maxOff: formatMoney(c.maxOff) } : {}),
|
|
73
|
+
...(c.minSpend ? { minSpend: formatMoney(c.minSpend) } : {}),
|
|
74
|
+
...(c.off ? { off: formatMoney(c.off) } : {}),
|
|
75
|
+
...(c.spend ? { spend: formatMoney(c.spend) } : {}),
|
|
76
|
+
});
|
|
77
|
+
/** One line of a trip, flattened for the card. Prices are strings: the card never does arithmetic. */
|
|
78
|
+
export const quoteForCard = (quote, groupOf) => ({
|
|
79
|
+
lines: quote.lines.map((l) => ({
|
|
80
|
+
kind: l.kind,
|
|
81
|
+
hotelId: l.hotelId,
|
|
82
|
+
// In a market: whose stay this is, so the card books it with that group.
|
|
83
|
+
...(groupOf?.(l.hotelId) ? { supplier: groupOf(l.hotelId) } : {}),
|
|
84
|
+
hotelName: l.hotelName,
|
|
85
|
+
...(l.hotelNames ? { hotelNames: l.hotelNames } : {}),
|
|
86
|
+
roomRef: l.roomRef,
|
|
87
|
+
extraRef: l.extraRef,
|
|
88
|
+
title: l.title,
|
|
89
|
+
...(l.titleNames ? { titleNames: l.titleNames } : {}),
|
|
90
|
+
detail: l.detail,
|
|
91
|
+
// What the detail says, as codes the card says in the guest's language.
|
|
92
|
+
...(l.bedTypes ? { bedTypes: l.bedTypes } : {}),
|
|
93
|
+
...(l.window ? { window: l.window } : {}),
|
|
94
|
+
...(l.meal ? { meal: l.meal } : {}),
|
|
95
|
+
...(l.rate ? { rate: l.rate } : {}),
|
|
96
|
+
stay: l.stay,
|
|
97
|
+
nights: l.nights,
|
|
98
|
+
...(l.hourly ? { hourly: l.hourly } : {}),
|
|
99
|
+
quantity: l.quantity,
|
|
100
|
+
// How many were ORDERED, beside how many units that comes to: one extra
|
|
101
|
+
// bed over three nights is quantity 3 and ordered 1, and the card's
|
|
102
|
+
// stepper read 3 and sent 3 ± 1 as the new count (2026-09-28 audit).
|
|
103
|
+
...(l.ordered !== undefined ? { ordered: l.ordered } : {}),
|
|
104
|
+
unit: formatMoney(l.unit),
|
|
105
|
+
...(l.roomCharges ? { roomCharges: formatMoney(l.roomCharges) } : {}),
|
|
106
|
+
...(l.publicUnit ? { publicUnit: formatMoney(l.publicUnit) } : {}),
|
|
107
|
+
total: formatMoney(l.total),
|
|
108
|
+
// The line with its taxes in, where the backend knows them per line: what the
|
|
109
|
+
// review and the trip show, as the hotel's page does (r10 #23).
|
|
110
|
+
...(l.totalWithTaxes ? { totalWithTaxes: formatMoney(l.totalWithTaxes) } : {}),
|
|
111
|
+
refundable: l.refundable,
|
|
112
|
+
// The supplier's own sentence about cancelling, where it gives only that
|
|
113
|
+
// (`QuoteLine.terms`, Otaless): the card says it as it came.
|
|
114
|
+
...(l.terms !== undefined ? { terms: l.terms } : {}),
|
|
115
|
+
freeCancellationUntil: l.freeCancellationUntil,
|
|
116
|
+
// The deadline on the hotel's clock, where the backend knows it - the
|
|
117
|
+
// review restates the terms beside the total (round-2 jury).
|
|
118
|
+
...(l.freeCancellationLocal ? { freeCancellationLocal: l.freeCancellationLocal } : {}),
|
|
119
|
+
...(l.freeCancellationLocalIso ? { freeCancellationLocalIso: l.freeCancellationLocalIso } : {}),
|
|
120
|
+
// Paid in advance: the review says so, and its button leads to the
|
|
121
|
+
// payment page rather than to a booking (香格里拉's card, 2026-10-12).
|
|
122
|
+
...(l.payment ? { payment: l.payment } : {}),
|
|
123
|
+
// …or, paid in advance, booked with no payment taken (0.77.5): the review says that instead.
|
|
124
|
+
...(l.paymentNotConnected ? { paymentNotConnected: true } : {}),
|
|
125
|
+
day: l.day,
|
|
126
|
+
})),
|
|
127
|
+
subtotal: formatMoney(quote.subtotal),
|
|
128
|
+
taxesAndFees: quote.taxesIncluded ? 'Included' : formatMoney(quote.taxesAndFees),
|
|
129
|
+
total: formatMoney(quote.total),
|
|
130
|
+
// ⚠️ NOT `member`: that key means "who is signed in" on every payload, and
|
|
131
|
+
// the quote's block is a different shape (a tier NAME, a saving, points).
|
|
132
|
+
// Two shapes on one key is how a card reads `member.tier.name` off a string.
|
|
133
|
+
...(quote.member
|
|
134
|
+
? {
|
|
135
|
+
memberSaving: {
|
|
136
|
+
...quote.member,
|
|
137
|
+
saved: formatMoney(quote.member.saved),
|
|
138
|
+
// The review's own order - public, member, coupon, total - each
|
|
139
|
+
// figure the server's, so the card adds nothing up (10-30, ①).
|
|
140
|
+
publicTotal: formatMoney(quote.member.publicTotal),
|
|
141
|
+
// The room charges at the public rate, the taxes a row of their own -
|
|
142
|
+
// the receipt every guest gets: room, taxes, less the tier, less the
|
|
143
|
+
// coupon, is the total (0.54.0, M1: a member's started from the
|
|
144
|
+
// public rate taxes in, a guest's from the room before them).
|
|
145
|
+
// ⚠️ THE PUBLIC RATE'S OWN ROOM CHARGE (0.55.0, review r3 N7) where the
|
|
146
|
+
// backend gives it: the public total less the taxes CHARGED held the public
|
|
147
|
+
// rate's larger tax as well, and the line's 「公开价每晚 ¥478」 for 2 nights and
|
|
148
|
+
// 2 rooms (¥1,912) did not meet 「房费(公开价)¥1,922」. The tier's row is then
|
|
149
|
+
// what it took off the rooms (`roomSaved`), and room, taxes, less the tier,
|
|
150
|
+
// less the coupon is still the total.
|
|
151
|
+
publicSubtotal: formatMoney(quote.member.publicSubtotal ??
|
|
152
|
+
money(quote.member.publicTotal.minor -
|
|
153
|
+
(quote.taxesIncluded ? 0 : quote.taxesAndFees.minor), quote.total.currency)),
|
|
154
|
+
...(quote.member.publicSubtotal
|
|
155
|
+
? {
|
|
156
|
+
roomSaved: formatMoney(money(quote.member.publicSubtotal.minor - quote.subtotal.minor, quote.total.currency)),
|
|
157
|
+
}
|
|
158
|
+
: {}),
|
|
159
|
+
memberTotal: formatMoney(money(quote.member.publicTotal.minor - quote.member.saved.minor, quote.total.currency)),
|
|
160
|
+
},
|
|
161
|
+
}
|
|
162
|
+
: {}),
|
|
163
|
+
...(quote.coupon ? { coupon: { ...quote.coupon, off: formatMoney(quote.coupon.off) } } : {}),
|
|
164
|
+
...(quote.couponRefused
|
|
165
|
+
? {
|
|
166
|
+
couponRefused: {
|
|
167
|
+
...quote.couponRefused,
|
|
168
|
+
...(quote.couponRefused.minSpend
|
|
169
|
+
? { minSpend: formatMoney(quote.couponRefused.minSpend) }
|
|
170
|
+
: {}),
|
|
171
|
+
...(quote.couponRefused.spend ? { spend: formatMoney(quote.couponRefused.spend) } : {}),
|
|
172
|
+
},
|
|
173
|
+
}
|
|
174
|
+
: {}),
|
|
175
|
+
...(quote.coupons ? { coupons: quote.coupons.map(couponForCard) } : {}),
|
|
176
|
+
...(quote.stay ? { stay: quote.stay } : {}),
|
|
177
|
+
...(quote.dropped ? { dropped: quote.dropped } : {}),
|
|
178
|
+
});
|
|
179
|
+
/**
|
|
180
|
+
* A coupon's name as a guest of either language reads it: the programme's
|
|
181
|
+
* Chinese beside its English - "满500减50 (¥50 off a stay of ¥500)".
|
|
182
|
+
*/
|
|
183
|
+
export const couponName = (c) => c.names?.zh && c.names.zh !== c.name ? `${c.names.zh} (${c.name})` : c.name;
|
|
184
|
+
/** "A, B or C". */
|
|
185
|
+
export const listOrWords = (xs) => xs.length > 1 ? `${xs.slice(0, -1).join(', ')} or ${xs.at(-1)}` : (xs[0] ?? '');
|
|
186
|
+
/** What a held coupon is - what it takes off, where, until when - and where it stands. */
|
|
187
|
+
export const couponTerms = (c, brand) => [
|
|
188
|
+
c.kind === 'amount-off'
|
|
189
|
+
? `${c.amountOff ? formatMoney(c.amountOff) : ''} off${c.minSpend ? ` a stay of ${formatMoney(c.minSpend)} or more` : ', no minimum'}`
|
|
190
|
+
: `${Math.round((c.percentOff ?? 0) * 100)}% off${c.maxOff ? `, at most ${formatMoney(c.maxOff)}` : ''}${c.minSpend ? `, on a stay of ${formatMoney(c.minSpend)} or more` : ''}`,
|
|
191
|
+
c.hotels?.length
|
|
192
|
+
? `only at ${listOrWords(c.hotels.map((h) => h.name))}`
|
|
193
|
+
: c.brands?.length
|
|
194
|
+
? `only at ${listOrWords(c.brands.map((b) => b.name))} hotels`
|
|
195
|
+
: `at every ${brand} hotel`,
|
|
196
|
+
c.state === 'expired'
|
|
197
|
+
? `ran out on ${c.validUntil} - cannot be used`
|
|
198
|
+
: c.state === 'used'
|
|
199
|
+
? `already used ${usedOnWords(c.usedOn)}`
|
|
200
|
+
: c.state === 'not-yet'
|
|
201
|
+
? `usable from ${c.validFrom} to ${c.validUntil}`
|
|
202
|
+
: `until ${c.validUntil}`,
|
|
203
|
+
].join(' · ');
|
|
204
|
+
/**
|
|
205
|
+
* What cancelling does to the coupon a booking used - and why.
|
|
206
|
+
*
|
|
207
|
+
* ⚠️ BACK ONLY FOR A FREE CANCELLATION IN THE COUPON'S DATES (robin,
|
|
208
|
+
* 2026-11-03, C10). A cancellation that charges a fee counts the coupon as
|
|
209
|
+
* used: it already took money off a stay that is being paid for. The reason is
|
|
210
|
+
* said in the words (`fee` / `expired`) and as the same code in the structure
|
|
211
|
+
* (`notReturnedBecause`), so a host that draws no card has it too. `fee` is the
|
|
212
|
+
* charge as text, for the sentence.
|
|
213
|
+
*/
|
|
214
|
+
export const couponBackWords = (c, fee,
|
|
215
|
+
/** Said after the cancellation, not before it. */
|
|
216
|
+
done = false,
|
|
217
|
+
/**
|
|
218
|
+
* The booking was never sent to its group: nothing is charged, and the fee is the
|
|
219
|
+
* terms' - "this cancellation was charged a fee" beside "nothing is charged" said
|
|
220
|
+
* money was taken (0.55.7, 总线程 11-05; the card says it the same way).
|
|
221
|
+
*/
|
|
222
|
+
notSent = false) => c.returned
|
|
223
|
+
? done
|
|
224
|
+
? `The coupon ${couponName(c)} is back with the member, usable until ${c.validUntil}: the cancellation was free.`
|
|
225
|
+
: `The coupon ${couponName(c)} it used comes back to the member on cancelling, because the cancellation is free and the coupon is usable until ${c.validUntil}.`
|
|
226
|
+
: c.notReturnedBecause === 'fee'
|
|
227
|
+
? notSent
|
|
228
|
+
? done
|
|
229
|
+
? `The coupon ${couponName(c)} is NOT given back: under the terms this cancellation costs a fee${fee ? ` (${fee})` : ''}, and a cancellation that costs a fee counts the coupon as used.`
|
|
230
|
+
: `The coupon ${couponName(c)} it used does NOT come back: under the terms cancelling costs a fee${fee ? ` (${fee})` : ''}, and a cancellation that costs a fee counts the coupon as used.`
|
|
231
|
+
: done
|
|
232
|
+
? `The coupon ${couponName(c)} is NOT given back: this cancellation was charged a fee${fee ? ` (${fee})` : ''}, and a cancellation that is charged counts the coupon as used.`
|
|
233
|
+
: `The coupon ${couponName(c)} it used does NOT come back: cancelling costs a fee${fee ? ` (${fee})` : ''}, and a cancellation that is charged counts the coupon as used.`
|
|
234
|
+
: done
|
|
235
|
+
? `The coupon ${couponName(c)} ran out on ${c.validUntil}, so it is not given back.`
|
|
236
|
+
: `The coupon ${couponName(c)} it used ran out on ${c.validUntil}, so cancelling does not give it back.`;
|
|
237
|
+
/**
|
|
238
|
+
* Said wherever points are: they are shown and earned, never spent here -
|
|
239
|
+
* nobody has published what a point is worth (hotel-connectors.md §5).
|
|
240
|
+
*/
|
|
241
|
+
const POINTS_DO_NOT_PAY = 'Points cannot pay for a room here, not even in part: what a point is worth has not been published, so give no rate for them.';
|
|
242
|
+
/** The rule a coupon is used by, said once where coupons are listed. */
|
|
243
|
+
const COUPON_RULE = 'One coupon per booking, taken off after the member rate. Use one only when the guest names it or agrees to it - using it spends it - by passing its id as `coupon` to the trip view (to price it) and to the booking.';
|
|
244
|
+
/** Beside a member sign-in's answer where a card is drawn: the link and its short code, the card's alone. */
|
|
245
|
+
export const MEMBER_SIGN_IN_META_KEY = 'curless/member-sign-in';
|
|
246
|
+
export const MEMBER_NEVER_IN_CHAT = 'Never in this chat: do not ask for, or accept, a membership number or a surname here, and never write back one the guest typed - not even to say which to change.';
|
|
247
|
+
/**
|
|
248
|
+
* A signed-in member, as the model reads it (0.58.0): signed in, the tier and
|
|
249
|
+
* what it takes off, the points and the coupons - what pricing and booking
|
|
250
|
+
* need. ⚠️ NOT THE NAME OR THE NUMBER: those are the card's, beside the answer
|
|
251
|
+
* (server.ts `memberApart`) - the model is told who is signed in by what the
|
|
252
|
+
* membership does, not who it is.
|
|
253
|
+
*/
|
|
254
|
+
export const memberAnswer = (deps, key, member, lead) => ({
|
|
255
|
+
structured: {
|
|
256
|
+
view: 'member',
|
|
257
|
+
...common(deps, key),
|
|
258
|
+
member: memberForCard(member, deps.vocab.brand),
|
|
259
|
+
},
|
|
260
|
+
text: [
|
|
261
|
+
`${lead ? `${lead}: ` : ''}signed in as a ${member.programme} ${member.tier.name} member.`,
|
|
262
|
+
`Rates now show the ${member.tier.name} member rate, ${Math.round(member.tier.discount * 100)}% off the public one.`,
|
|
263
|
+
...((deps.backend.capabilities ?? FULL_CAPABILITIES).coupons
|
|
264
|
+
? memberSaid(member, deps.vocab.brand)
|
|
265
|
+
: [POINTS_DO_NOT_PAY]),
|
|
266
|
+
member.preferences?.length
|
|
267
|
+
? `Saved preferences on this membership: ${member.preferences.map((k) => REQUEST_WORDS[k]).join(', ')}. They are ticked on the booking form; mention them, and ask before booking with them.`
|
|
268
|
+
: '',
|
|
269
|
+
]
|
|
270
|
+
.filter(Boolean)
|
|
271
|
+
.join('\n')
|
|
272
|
+
.replace(/^signed/, 'Signed'),
|
|
273
|
+
});
|
|
274
|
+
/** A signed-in member's coupons and points, for the sign-in answer - see `memberCouponsSaid`. */
|
|
275
|
+
const memberSaid = (m, brand) => [
|
|
276
|
+
`Points: ${m.points.toLocaleString('en-GB')}.${m.pointsExpiring ? ` ${m.pointsExpiring.points.toLocaleString('en-GB')} of them lapse on ${m.pointsExpiring.on}.` : ''} ${POINTS_DO_NOT_PAY}`,
|
|
277
|
+
...(m.coupons
|
|
278
|
+
? m.coupons.length
|
|
279
|
+
? [
|
|
280
|
+
`Coupons held (${m.coupons.length}): ${COUPON_RULE}`,
|
|
281
|
+
// The terms say it in English; the name is the programme's own.
|
|
282
|
+
...m.coupons.map((c) => `- ${c.names?.zh ?? c.name} · ${couponTerms(c, brand)} · id \`${c.id}\``),
|
|
283
|
+
]
|
|
284
|
+
: ['No coupons are held on this membership.']
|
|
285
|
+
: []),
|
|
286
|
+
];
|
|
287
|
+
/**
|
|
288
|
+
* What membership did to this trip, in the review's own order: the public
|
|
289
|
+
* rate, the member rate, the coupon, what is paid - the same three figures the
|
|
290
|
+
* card shows (`memberSaving`), so text and structure agree.
|
|
291
|
+
*/
|
|
292
|
+
const memberTripLines = (q) => {
|
|
293
|
+
const m = q.member;
|
|
294
|
+
if (!m)
|
|
295
|
+
return [];
|
|
296
|
+
const cur = q.total.currency;
|
|
297
|
+
const memberTotal = money(m.publicTotal.minor - m.saved.minor, cur);
|
|
298
|
+
const atHotel = !q.lines.some((l) => l.payment === 'prepaid');
|
|
299
|
+
const stays = new Set(q.lines.flatMap((l) => (l.kind === 'room' ? [`${l.hotelId}|${l.stay?.checkIn}`] : []))).size;
|
|
300
|
+
return [
|
|
301
|
+
`${m.programme} ${m.tier} member rate: public rate ${formatMoney(m.publicTotal)} → member rate ${formatMoney(memberTotal)} (${formatMoney(m.saved)} less)${q.coupon
|
|
302
|
+
? ` → coupon ${couponName(q.coupon)} −${formatMoney(q.coupon.off)}${stays > 1 ? ` (on the stay at ${q.coupon.hotelName})` : ''}`
|
|
303
|
+
: ''} → **${atHotel ? 'to pay at the hotel' : 'to pay'} ${formatMoney(q.total)}**. Earns about ${m.points.toLocaleString('en-GB')} points${q.coupon ? ', on the price after the coupon' : ''}.`,
|
|
304
|
+
...(q.coupons?.length
|
|
305
|
+
? [
|
|
306
|
+
`The member's coupons for this trip - ${COUPON_RULE}`,
|
|
307
|
+
...q.coupons.map((c) => `- ${couponName(c)} (\`${c.id}\`): ${q.coupon?.id === c.id
|
|
308
|
+
? 'taken off above'
|
|
309
|
+
: c.off
|
|
310
|
+
? `would take ${formatMoney(c.off)} off${stays > 1 && c.hotelName ? ` (the stay at ${c.hotelName})` : ''}`
|
|
311
|
+
: `cannot be used here: ${c.why ?? 'it does not apply.'}`}`),
|
|
312
|
+
]
|
|
313
|
+
: []),
|
|
314
|
+
].filter(Boolean);
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* The coupon asked for that was not taken off, and why.
|
|
318
|
+
*
|
|
319
|
+
* ⚠️ SAID WHENEVER THERE IS ONE, SIGNED IN OR NOT (2026-11-03 review, C2). The
|
|
320
|
+
* sentence lived in `memberTripLines`, which says nothing without a member - so
|
|
321
|
+
* a coupon refused because nobody is signed in (`signed-out`) was in
|
|
322
|
+
* `structuredContent.couponRefused` and not in the words, and a host that
|
|
323
|
+
* hands its model the text read "Total ¥1,200" and could say it was the price
|
|
324
|
+
* with the coupon.
|
|
325
|
+
*/
|
|
326
|
+
const couponRefusedLine = (q) => q.couponRefused
|
|
327
|
+
? `The coupon ${q.couponRefused.name ? couponName({ name: q.couponRefused.name, names: q.couponRefused.names }) : q.couponRefused.id} was NOT taken off: ${q.couponRefused.why} The total is without it.`
|
|
328
|
+
: '';
|
|
329
|
+
/** What cancelling a trip's room costs, after its price: ", free to cancel until …" - or nothing where nothing is known. */
|
|
330
|
+
const lineCancelWords = (l) => l.terms !== undefined
|
|
331
|
+
? `, ${termsWords(l.terms)}`
|
|
332
|
+
: l.freeCancellationUntil
|
|
333
|
+
? `, free to cancel until ${freeUntilText(l)}`
|
|
334
|
+
: l.refundable === false
|
|
335
|
+
? ', non-refundable'
|
|
336
|
+
: l.refundable
|
|
337
|
+
? ', the free cancellation window has closed - cancelling now has a fee'
|
|
338
|
+
: '';
|
|
339
|
+
export const tripText = (quote, noCards) => {
|
|
340
|
+
// A part not priced because its group did not answer just now: said once, and
|
|
341
|
+
// left to the guest to ask for again (`askLater`; the trip is drawn as a card).
|
|
342
|
+
const later = quote.dropped?.some((d) => d.code === 'unreachable') ? askLater(!noCards) : '';
|
|
343
|
+
// ⚠️ NOT "EMPTY" WHEN SOMETHING WAS LEFT OUT: a trip whose only group did not
|
|
344
|
+
// answer is not an empty trip (2026-11-03 review, C5).
|
|
345
|
+
if (quote.lines.length === 0 && quote.dropped?.length)
|
|
346
|
+
return [...quote.dropped.map((d) => `Left out: ${d.title} — ${d.why}`), later]
|
|
347
|
+
.filter(Boolean)
|
|
348
|
+
.join('\n');
|
|
349
|
+
if (quote.lines.length === 0)
|
|
350
|
+
return 'The trip is empty.';
|
|
351
|
+
const lines = quote.lines.map((l) => l.kind === 'room'
|
|
352
|
+
? noCards
|
|
353
|
+
? // ⚠️ EVERYTHING THE GUEST SAYS YES TO, ON THE LINE (robin 11-06): to a
|
|
354
|
+
// client that draws no card this is what is said back before the
|
|
355
|
+
// booking - the nights with their weekdays, the party, and what
|
|
356
|
+
// cancelling costs, which the card shows beside the Book button.
|
|
357
|
+
`- ${l.quantity ?? 1}× ${withZh(l.title, l.titleNames, true)} at ${withZh(l.hotelName, l.hotelNames, true)}, ${l.hourly
|
|
358
|
+
? stayWords(l.stay, l.hourly)
|
|
359
|
+
: l.stay
|
|
360
|
+
? `${stayDayWords(l.stay.checkIn, l.stay.checkOut)}, ${l.stay.checkIn} to ${l.stay.checkOut}`
|
|
361
|
+
: `${l.nights} ${l.nights === 1 ? 'night' : 'nights'}`}${l.stay ? `, ${l.stay.guests} ${l.stay.guests === 1 ? 'guest' : 'guests'}` : ''} — ${formatMoney(l.total)}${lineCancelWords(l)}`
|
|
362
|
+
: `- ${l.quantity ?? 1}× ${withZh(l.title, l.titleNames, noCards)} at ${withZh(l.hotelName, l.hotelNames, noCards)}, ${l.hourly ? stayWords(l.stay, l.hourly) : `${stayWords(l.stay)} (${l.nights} ${l.nights === 1 ? 'night' : 'nights'})`} — ${formatMoney(l.total)}`
|
|
363
|
+
: `- ${l.ordered ?? l.quantity}× ${l.title}${l.ordered !== undefined && l.quantity !== undefined && l.quantity !== l.ordered ? ` (${l.quantity} in all, over the stay)` : ''} — ${formatMoney(l.total)}`);
|
|
364
|
+
return [
|
|
365
|
+
...lines,
|
|
366
|
+
`Taxes and fees ${quote.taxesIncluded ? 'included in the prices' : formatMoney(quote.taxesAndFees)}${quote.coupon ? ` · coupon −${formatMoney(quote.coupon.off)}` : ''} · **Total ${formatMoney(quote.total)}**`,
|
|
367
|
+
couponRefusedLine(quote),
|
|
368
|
+
...memberTripLines(quote),
|
|
369
|
+
...(quote.dropped ?? []).map((d) => `Left out: ${d.title} — ${d.why}`),
|
|
370
|
+
later,
|
|
371
|
+
]
|
|
372
|
+
.filter(Boolean)
|
|
373
|
+
.join('\n');
|
|
374
|
+
};
|
|
375
|
+
//# sourceMappingURL=quote-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote-card.js","sourceRoot":"","sources":["../../src/tools/quote-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAWhE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAc,EAAE,IAAa,EAAoB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;AAErF;;;;GAIG;AACH,kGAAkG;AAClG,MAAM,CAAC,MAAM,mBAAmB,GAAG,gCAAgC,CAAC;AACpE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAG7B,EA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"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAW5C,eAAO,MAAM,mBAAmB,GAAU,8BAMvC,QAAQ,KAAG,OAAO,CAAC,UAAU,CA4F/B,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { stayWords } from '../hourly.js';
|
|
2
|
+
import { formatMoney } from '../money.js';
|
|
3
|
+
import { str, upTo } from './args.js';
|
|
4
|
+
import { holderOf } from './cancel-facts.js';
|
|
5
|
+
import { REFUND_REASON_MAX } from './output-schemas.js';
|
|
6
|
+
import { common, madeForCard } from './paid-lines.js';
|
|
7
|
+
import { clockWords, paymentWords } from './payment-words.js';
|
|
8
|
+
import { withZh } from './quote-card.js';
|
|
9
|
+
import { identity, refundTokensOf, rememberRefund } from './session-notes.js';
|
|
10
|
+
import { TERMS_TEXT_MAX } from './terms-answer.js';
|
|
11
|
+
// A paid booking's money back, in full: the guest asked, and the booking and
|
|
12
|
+
// the amount were said back to them. Only this account's own booking is
|
|
13
|
+
// known to the backend (`otalessBooking.refund` finds it in its own record).
|
|
14
|
+
export const answerRefundBooking = async ({ deps, args, ctx, t, key, }) => {
|
|
15
|
+
const ot = deps.backend.otalessBooking;
|
|
16
|
+
const ref = str(args.booking);
|
|
17
|
+
const who = identity(deps, ctx, key);
|
|
18
|
+
const why = upTo(str(args.reason), REFUND_REASON_MAX) || undefined;
|
|
19
|
+
if (!ot) {
|
|
20
|
+
return {
|
|
21
|
+
structured: { view: 'error', ...common(deps, key), error: 'not-offered' },
|
|
22
|
+
text: `Refunds are not asked for through ${deps.vocab.brand}.`,
|
|
23
|
+
isError: true,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const notFound = () => ({
|
|
27
|
+
structured: { view: 'booking-not-found', ...common(deps, key), query: ref },
|
|
28
|
+
text: 'No booking here matches that code. Only bookings made here by this account are known, so nothing was refunded.',
|
|
29
|
+
});
|
|
30
|
+
// ⚠️ A REFUND IS TWO STEPS ON THE SERVER (总线程's review of 0.63.0, B). The
|
|
31
|
+
// preview's token stays here, keyed by conversation and booking: it never
|
|
32
|
+
// goes to the model or the card, and a `confirmed` is sent only with the
|
|
33
|
+
// token this conversation was given for this booking, unexpired, once.
|
|
34
|
+
const preview = async () => {
|
|
35
|
+
const p = await ot.previewRefund(ref, who);
|
|
36
|
+
if (!p)
|
|
37
|
+
return notFound();
|
|
38
|
+
rememberRefund(deps, `${key}|refund|${p.bookingId}`, p.preview, Date.parse(p.until));
|
|
39
|
+
const booked = await deps.backend.findBooking(ref, who).catch(() => null);
|
|
40
|
+
const group = holderOf(deps, p.supplier).name;
|
|
41
|
+
const hotel = booked ? withZh(booked.hotelName, booked.hotelNames, ctx.noCards) : '';
|
|
42
|
+
const terms = upTo(p.terms, TERMS_TEXT_MAX);
|
|
43
|
+
const amount = formatMoney(p.amount);
|
|
44
|
+
return {
|
|
45
|
+
structured: {
|
|
46
|
+
view: 'refund-preview',
|
|
47
|
+
...common(deps, key),
|
|
48
|
+
booking: {
|
|
49
|
+
confirmationCode: p.confirmationCode,
|
|
50
|
+
supplier: p.supplier,
|
|
51
|
+
...(booked
|
|
52
|
+
? {
|
|
53
|
+
hotelName: booked.hotelName,
|
|
54
|
+
...(booked.hotelNames ? { hotelNames: booked.hotelNames } : {}),
|
|
55
|
+
stay: booked.stay,
|
|
56
|
+
}
|
|
57
|
+
: {}),
|
|
58
|
+
},
|
|
59
|
+
amount,
|
|
60
|
+
fromPayment: p.fromPayment,
|
|
61
|
+
groupDecides: p.groupDecides,
|
|
62
|
+
terms,
|
|
63
|
+
until: p.until,
|
|
64
|
+
},
|
|
65
|
+
text: [
|
|
66
|
+
`Refund preview for ${p.confirmationCode}${hotel ? ` · ${hotel}` : ''}${booked ? ` · ${stayWords(booked.stay, booked.hourly)}` : ''}: all of ${amount} would be asked back from ${group}.`,
|
|
67
|
+
p.fromPayment ? `The amount is what ${group} says was paid.` : '',
|
|
68
|
+
p.groupDecides
|
|
69
|
+
? `What comes back is what ${group} decides - the request names no amount.`
|
|
70
|
+
: '',
|
|
71
|
+
`${group}'s terms, ${p.terms ? `in its own words: "${terms}"` : 'none given'}.`,
|
|
72
|
+
`Nothing has been asked yet. Say this to the guest and get their yes, then call ${t.refundBooking} again with \`confirmed: true\` (this preview can be used until ${clockWords(p.until) ?? p.until}).`,
|
|
73
|
+
]
|
|
74
|
+
.filter(Boolean)
|
|
75
|
+
.join(' '),
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
if (args.confirmed !== true)
|
|
79
|
+
return await preview();
|
|
80
|
+
const booked = await deps.backend.findBooking(ref, who).catch(() => null);
|
|
81
|
+
if (!booked)
|
|
82
|
+
return notFound();
|
|
83
|
+
const slot = `${key}|refund|${booked.id}`;
|
|
84
|
+
const kept = refundTokensOf(deps).get(slot);
|
|
85
|
+
refundTokensOf(deps).delete(slot); // one use, whatever comes of it
|
|
86
|
+
if (!kept)
|
|
87
|
+
return await preview();
|
|
88
|
+
// The backend holds the clock of the preview (`REFUND_PREVIEW_MS`): one that ran
|
|
89
|
+
// out is refused there with `refund-preview`, and is shown again here.
|
|
90
|
+
const booking = await ot.refund(ref, who, why, kept.preview).catch((err) => {
|
|
91
|
+
if (err?.code === 'refund-preview')
|
|
92
|
+
return 'again';
|
|
93
|
+
throw err;
|
|
94
|
+
});
|
|
95
|
+
if (booking === 'again')
|
|
96
|
+
return await preview();
|
|
97
|
+
if (!booking)
|
|
98
|
+
return notFound();
|
|
99
|
+
return {
|
|
100
|
+
structured: {
|
|
101
|
+
view: 'booking',
|
|
102
|
+
...common(deps, key),
|
|
103
|
+
booking: madeForCard(deps, booking),
|
|
104
|
+
total: formatMoney(booking.quote.total),
|
|
105
|
+
refundAsked: true,
|
|
106
|
+
},
|
|
107
|
+
text: `Refund asked for ${booking.confirmationCode} · ${withZh(booking.hotelName, booking.hotelNames, ctx.noCards)} · ${stayWords(booking.stay, booking.hourly)}: ${booking.payment
|
|
108
|
+
? `${paymentWords(booking)} (${formatMoney(booking.payment.amount)} paid).`
|
|
109
|
+
: 'the group has taken the request.'}`,
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=refund-booking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refund-booking.js","sourceRoot":"","sources":["../../src/tools/refund-booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,6EAA6E;AAC7E,wEAAwE;AACxE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,EACxC,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,CAAC,EACD,GAAG,GACM,EAAuB,EAAE;IAClC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IACvC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CA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U/B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { bookTripLines } from './booking-answer.js';
|
|
2
|
+
export const answerRequestBooking = async ({ deps, args, ctx, t, key, }) => {
|
|
3
|
+
return bookTripLines(deps, t, ctx, key, key, args, `There is nothing in the trip yet. ${t.addToTrip} puts room nights in it.`);
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=request-booking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-booking.js","sourceRoot":"","sources":["../../src/tools/request-booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,EACzC,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,CAAC,EACD,GAAG,GACM,EAAuB,EAAE;IAClC,OAAO,aAAa,CAClB,IAAI,EACJ,CAAC,EACD,GAAG,EACH,GAAG,EACH,GAAG,EACH,IAAI,EACJ,qCAAqC,CAAC,CAAC,SAAS,0BAA0B,CAC3E,CAAC;AACJ,CAAC,CAAC"}
|