@curless/hotel-storefront 0.85.0 → 0.87.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.
Files changed (251) hide show
  1. package/dist/server.d.ts +1 -1
  2. package/dist/server.js +1 -1
  3. package/dist/tools/accept-terms.d.ts +4 -0
  4. package/dist/tools/accept-terms.d.ts.map +1 -0
  5. package/dist/tools/accept-terms.js +26 -0
  6. package/dist/tools/accept-terms.js.map +1 -0
  7. package/dist/tools/add-booking-addon.d.ts +4 -0
  8. package/dist/tools/add-booking-addon.d.ts.map +1 -0
  9. package/dist/tools/add-booking-addon.js +44 -0
  10. package/dist/tools/add-booking-addon.js.map +1 -0
  11. package/dist/tools/add-to-trip.d.ts +4 -0
  12. package/dist/tools/add-to-trip.d.ts.map +1 -0
  13. package/dist/tools/add-to-trip.js +49 -0
  14. package/dist/tools/add-to-trip.js.map +1 -0
  15. package/dist/tools/all-tools.d.ts +19124 -0
  16. package/dist/tools/all-tools.d.ts.map +1 -0
  17. package/dist/tools/all-tools.js +43 -0
  18. package/dist/tools/all-tools.js.map +1 -0
  19. package/dist/tools/answer.d.ts +3 -0
  20. package/dist/tools/answer.d.ts.map +1 -0
  21. package/dist/tools/answer.js +104 -0
  22. package/dist/tools/answer.js.map +1 -0
  23. package/dist/tools/args.d.ts +149 -0
  24. package/dist/tools/args.d.ts.map +1 -0
  25. package/dist/tools/args.js +176 -0
  26. package/dist/tools/args.js.map +1 -0
  27. package/dist/tools/base-output-schemas.d.ts +3 -0
  28. package/dist/tools/base-output-schemas.d.ts.map +1 -0
  29. package/dist/tools/base-output-schemas.js +396 -0
  30. package/dist/tools/base-output-schemas.js.map +1 -0
  31. package/dist/tools/book-picked.d.ts +4 -0
  32. package/dist/tools/book-picked.d.ts.map +1 -0
  33. package/dist/tools/book-picked.js +14 -0
  34. package/dist/tools/book-picked.js.map +1 -0
  35. package/dist/tools/booking-answer.d.ts +24 -0
  36. package/dist/tools/booking-answer.d.ts.map +1 -0
  37. package/dist/tools/booking-answer.js +567 -0
  38. package/dist/tools/booking-answer.js.map +1 -0
  39. package/dist/tools/buy-shop-item.d.ts +4 -0
  40. package/dist/tools/buy-shop-item.d.ts.map +1 -0
  41. package/dist/tools/buy-shop-item.js +45 -0
  42. package/dist/tools/buy-shop-item.js.map +1 -0
  43. package/dist/tools/call.d.ts +11 -0
  44. package/dist/tools/call.d.ts.map +1 -0
  45. package/dist/tools/call.js +2 -0
  46. package/dist/tools/call.js.map +1 -0
  47. package/dist/tools/cancel-facts.d.ts +281 -0
  48. package/dist/tools/cancel-facts.d.ts.map +1 -0
  49. package/dist/tools/cancel-facts.js +309 -0
  50. package/dist/tools/cancel-facts.js.map +1 -0
  51. package/dist/tools/cancel.d.ts +4 -0
  52. package/dist/tools/cancel.d.ts.map +1 -0
  53. package/dist/tools/cancel.js +415 -0
  54. package/dist/tools/cancel.js.map +1 -0
  55. package/dist/tools/capability-adjust.d.ts +31 -0
  56. package/dist/tools/capability-adjust.d.ts.map +1 -0
  57. package/dist/tools/capability-adjust.js +299 -0
  58. package/dist/tools/capability-adjust.js.map +1 -0
  59. package/dist/tools/card-addons.d.ts +4 -0
  60. package/dist/tools/card-addons.d.ts.map +1 -0
  61. package/dist/tools/card-addons.js +76 -0
  62. package/dist/tools/card-addons.js.map +1 -0
  63. package/dist/tools/change-booking.d.ts +4 -0
  64. package/dist/tools/change-booking.d.ts.map +1 -0
  65. package/dist/tools/change-booking.js +145 -0
  66. package/dist/tools/change-booking.js.map +1 -0
  67. package/dist/tools/clear-trip.d.ts +4 -0
  68. package/dist/tools/clear-trip.d.ts.map +1 -0
  69. package/dist/tools/clear-trip.js +10 -0
  70. package/dist/tools/clear-trip.js.map +1 -0
  71. package/dist/tools/compare.d.ts +4 -0
  72. package/dist/tools/compare.d.ts.map +1 -0
  73. package/dist/tools/compare.js +114 -0
  74. package/dist/tools/compare.js.map +1 -0
  75. package/dist/tools/current-trip.d.ts +70 -0
  76. package/dist/tools/current-trip.d.ts.map +1 -0
  77. package/dist/tools/current-trip.js +269 -0
  78. package/dist/tools/current-trip.js.map +1 -0
  79. package/dist/tools/deps.d.ts +229 -0
  80. package/dist/tools/deps.d.ts.map +1 -0
  81. package/dist/tools/deps.js +2 -0
  82. package/dist/tools/deps.js.map +1 -0
  83. package/dist/tools/follow-ups.d.ts +120 -0
  84. package/dist/tools/follow-ups.d.ts.map +1 -0
  85. package/dist/tools/follow-ups.js +369 -0
  86. package/dist/tools/follow-ups.js.map +1 -0
  87. package/dist/tools/forget-preferences.d.ts +4 -0
  88. package/dist/tools/forget-preferences.d.ts.map +1 -0
  89. package/dist/tools/forget-preferences.js +24 -0
  90. package/dist/tools/forget-preferences.js.map +1 -0
  91. package/dist/tools/get-hotel.d.ts +4 -0
  92. package/dist/tools/get-hotel.d.ts.map +1 -0
  93. package/dist/tools/get-hotel.js +350 -0
  94. package/dist/tools/get-hotel.js.map +1 -0
  95. package/dist/tools/hotel-choices.d.ts +132 -0
  96. package/dist/tools/hotel-choices.d.ts.map +1 -0
  97. package/dist/tools/hotel-choices.js +587 -0
  98. package/dist/tools/hotel-choices.js.map +1 -0
  99. package/dist/tools/itinerary.d.ts +4 -0
  100. package/dist/tools/itinerary.d.ts.map +1 -0
  101. package/dist/tools/itinerary.js +158 -0
  102. package/dist/tools/itinerary.js.map +1 -0
  103. package/dist/tools/list-booking-addons.d.ts +4 -0
  104. package/dist/tools/list-booking-addons.d.ts.map +1 -0
  105. package/dist/tools/list-booking-addons.js +21 -0
  106. package/dist/tools/list-booking-addons.js.map +1 -0
  107. package/dist/tools/list-bookings.d.ts +4 -0
  108. package/dist/tools/list-bookings.d.ts.map +1 -0
  109. package/dist/tools/list-bookings.js +119 -0
  110. package/dist/tools/list-bookings.js.map +1 -0
  111. package/dist/tools/list-extras.d.ts +4 -0
  112. package/dist/tools/list-extras.d.ts.map +1 -0
  113. package/dist/tools/list-extras.js +90 -0
  114. package/dist/tools/list-extras.js.map +1 -0
  115. package/dist/tools/list-hotels-ask.d.ts +133 -0
  116. package/dist/tools/list-hotels-ask.d.ts.map +1 -0
  117. package/dist/tools/list-hotels-ask.js +326 -0
  118. package/dist/tools/list-hotels-ask.js.map +1 -0
  119. package/dist/tools/list-hotels-empty.d.ts +5 -0
  120. package/dist/tools/list-hotels-empty.d.ts.map +1 -0
  121. package/dist/tools/list-hotels-empty.js +130 -0
  122. package/dist/tools/list-hotels-empty.js.map +1 -0
  123. package/dist/tools/list-hotels-home.d.ts +9 -0
  124. package/dist/tools/list-hotels-home.d.ts.map +1 -0
  125. package/dist/tools/list-hotels-home.js +181 -0
  126. package/dist/tools/list-hotels-home.js.map +1 -0
  127. package/dist/tools/list-hotels-page.d.ts +43 -0
  128. package/dist/tools/list-hotels-page.d.ts.map +1 -0
  129. package/dist/tools/list-hotels-page.js +344 -0
  130. package/dist/tools/list-hotels-page.js.map +1 -0
  131. package/dist/tools/list-hotels.d.ts +4 -0
  132. package/dist/tools/list-hotels.d.ts.map +1 -0
  133. package/dist/tools/list-hotels.js +24 -0
  134. package/dist/tools/list-hotels.js.map +1 -0
  135. package/dist/tools/list-shop-items.d.ts +4 -0
  136. package/dist/tools/list-shop-items.d.ts.map +1 -0
  137. package/dist/tools/list-shop-items.js +34 -0
  138. package/dist/tools/list-shop-items.js.map +1 -0
  139. package/dist/tools/list-shop-orders.d.ts +4 -0
  140. package/dist/tools/list-shop-orders.d.ts.map +1 -0
  141. package/dist/tools/list-shop-orders.js +22 -0
  142. package/dist/tools/list-shop-orders.js.map +1 -0
  143. package/dist/tools/look-up.d.ts +4 -0
  144. package/dist/tools/look-up.d.ts.map +1 -0
  145. package/dist/tools/look-up.js +207 -0
  146. package/dist/tools/look-up.js.map +1 -0
  147. package/dist/tools/output-schemas.d.ts +645 -0
  148. package/dist/tools/output-schemas.d.ts.map +1 -0
  149. package/dist/tools/output-schemas.js +503 -0
  150. package/dist/tools/output-schemas.js.map +1 -0
  151. package/dist/tools/paid-lines.d.ts +718 -0
  152. package/dist/tools/paid-lines.d.ts.map +1 -0
  153. package/dist/tools/paid-lines.js +359 -0
  154. package/dist/tools/paid-lines.js.map +1 -0
  155. package/dist/tools/pay-with-union-pay.d.ts +4 -0
  156. package/dist/tools/pay-with-union-pay.d.ts.map +1 -0
  157. package/dist/tools/pay-with-union-pay.js +112 -0
  158. package/dist/tools/pay-with-union-pay.js.map +1 -0
  159. package/dist/tools/payment-words.d.ts +269 -0
  160. package/dist/tools/payment-words.d.ts.map +1 -0
  161. package/dist/tools/payment-words.js +365 -0
  162. package/dist/tools/payment-words.js.map +1 -0
  163. package/dist/tools/pick-room.d.ts +4 -0
  164. package/dist/tools/pick-room.d.ts.map +1 -0
  165. package/dist/tools/pick-room.js +23 -0
  166. package/dist/tools/pick-room.js.map +1 -0
  167. package/dist/tools/policies.d.ts +4 -0
  168. package/dist/tools/policies.d.ts.map +1 -0
  169. package/dist/tools/policies.js +74 -0
  170. package/dist/tools/policies.js.map +1 -0
  171. package/dist/tools/pricing.d.ts +55 -0
  172. package/dist/tools/pricing.d.ts.map +1 -0
  173. package/dist/tools/pricing.js +260 -0
  174. package/dist/tools/pricing.js.map +1 -0
  175. package/dist/tools/put-room-line.d.ts +12 -0
  176. package/dist/tools/put-room-line.d.ts.map +1 -0
  177. package/dist/tools/put-room-line.js +347 -0
  178. package/dist/tools/put-room-line.js.map +1 -0
  179. package/dist/tools/quote-card.d.ts +234 -0
  180. package/dist/tools/quote-card.d.ts.map +1 -0
  181. package/dist/tools/quote-card.js +375 -0
  182. package/dist/tools/quote-card.js.map +1 -0
  183. package/dist/tools/refund-booking.d.ts +4 -0
  184. package/dist/tools/refund-booking.d.ts.map +1 -0
  185. package/dist/tools/refund-booking.js +112 -0
  186. package/dist/tools/refund-booking.js.map +1 -0
  187. package/dist/tools/request-booking.d.ts +4 -0
  188. package/dist/tools/request-booking.d.ts.map +1 -0
  189. package/dist/tools/request-booking.js +5 -0
  190. package/dist/tools/request-booking.js.map +1 -0
  191. package/dist/tools/request-words.d.ts +238 -0
  192. package/dist/tools/request-words.d.ts.map +1 -0
  193. package/dist/tools/request-words.js +487 -0
  194. package/dist/tools/request-words.js.map +1 -0
  195. package/dist/tools/room-choices.d.ts +64 -0
  196. package/dist/tools/room-choices.d.ts.map +1 -0
  197. package/dist/tools/room-choices.js +374 -0
  198. package/dist/tools/room-choices.js.map +1 -0
  199. package/dist/tools/session-notes.d.ts +164 -0
  200. package/dist/tools/session-notes.d.ts.map +1 -0
  201. package/dist/tools/session-notes.js +412 -0
  202. package/dist/tools/session-notes.js.map +1 -0
  203. package/dist/tools/sign-in.d.ts +4 -0
  204. package/dist/tools/sign-in.d.ts.map +1 -0
  205. package/dist/tools/sign-in.js +72 -0
  206. package/dist/tools/sign-in.js.map +1 -0
  207. package/dist/tools/sign-out.d.ts +4 -0
  208. package/dist/tools/sign-out.d.ts.map +1 -0
  209. package/dist/tools/sign-out.js +13 -0
  210. package/dist/tools/sign-out.js.map +1 -0
  211. package/dist/tools/terms-answer.d.ts +114 -0
  212. package/dist/tools/terms-answer.d.ts.map +1 -0
  213. package/dist/tools/terms-answer.js +492 -0
  214. package/dist/tools/terms-answer.js.map +1 -0
  215. package/dist/tools/tool-defs-account.d.ts +80 -0
  216. package/dist/tools/tool-defs-account.d.ts.map +1 -0
  217. package/dist/tools/tool-defs-account.js +65 -0
  218. package/dist/tools/tool-defs-account.js.map +1 -0
  219. package/dist/tools/tool-defs-addons.d.ts +251 -0
  220. package/dist/tools/tool-defs-addons.d.ts.map +1 -0
  221. package/dist/tools/tool-defs-addons.js +198 -0
  222. package/dist/tools/tool-defs-addons.js.map +1 -0
  223. package/dist/tools/tool-defs-booking.d.ts +410 -0
  224. package/dist/tools/tool-defs-booking.d.ts.map +1 -0
  225. package/dist/tools/tool-defs-booking.js +285 -0
  226. package/dist/tools/tool-defs-booking.js.map +1 -0
  227. package/dist/tools/tool-defs-browse.d.ts +444 -0
  228. package/dist/tools/tool-defs-browse.d.ts.map +1 -0
  229. package/dist/tools/tool-defs-browse.js +307 -0
  230. package/dist/tools/tool-defs-browse.js.map +1 -0
  231. package/dist/tools/tool-defs-trip.d.ts +136 -0
  232. package/dist/tools/tool-defs-trip.d.ts.map +1 -0
  233. package/dist/tools/tool-defs-trip.js +79 -0
  234. package/dist/tools/tool-defs-trip.js.map +1 -0
  235. package/dist/tools/tool-env.d.ts +64 -0
  236. package/dist/tools/tool-env.d.ts.map +1 -0
  237. package/dist/tools/tool-env.js +49 -0
  238. package/dist/tools/tool-env.js.map +1 -0
  239. package/dist/tools/tool-set.d.ts +1425 -0
  240. package/dist/tools/tool-set.d.ts.map +1 -0
  241. package/dist/tools/tool-set.js +244 -0
  242. package/dist/tools/tool-set.js.map +1 -0
  243. package/dist/tools/view-trip.d.ts +4 -0
  244. package/dist/tools/view-trip.d.ts.map +1 -0
  245. package/dist/tools/view-trip.js +7 -0
  246. package/dist/tools/view-trip.js.map +1 -0
  247. package/dist/tools.d.ts +13 -2089
  248. package/dist/tools.d.ts.map +1 -1
  249. package/dist/tools.js +11 -10685
  250. package/dist/tools.js.map +1 -1
  251. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paid-lines.d.ts","sourceRoot":"","sources":["../../src/tools/paid-lines.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAW1C,eAAO,MAAM,QAAQ,GAAI,MAAM,QAAQ,EAAE,GAAG,OAAO,EAAE,MAAM,KAAK,KAAG,MAAM,GAAG,SAwH3E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,cAAc,EAAE,OAAO,MAAM,EAAE,OAAO,OAAO,KAAG,MAQjF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,QAAQ,EAAE,GAAG,OAAO,KAAG,OAEE,CAAC;AAE3D,yEA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,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA3D7yxB,CAAC;AAChF,eAAO,MAAM,MAAM,GAAI,MAAM,QAAQ,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA0DykwB,CAAC;;;;;qBAAwF,CAAC;;;;;;oBAAqqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAD33xB,CAAC"}
@@ -0,0 +1,359 @@
1
+ import { FULL_CAPABILITIES } from '../backend.js';
2
+ import { formatMoney } from '../money.js';
3
+ import { memberBadge } from './args.js';
4
+ import { groupRefundWords, holderOf } from './cancel-facts.js';
5
+ import { LINK_CLOSED_WORDS, hostOf, listedForCard, payByWords, termsHeldWords, unconfirmedSaid, } from './payment-words.js';
6
+ import { couponName, langOf } from './quote-card.js';
7
+ export const paidLine = (deps, b, fee) => {
8
+ const p = b.payment;
9
+ if (!p)
10
+ return undefined;
11
+ const h = holderOf(deps, b.supplier);
12
+ const amount = formatMoney(p.amount);
13
+ const back = formatMoney(p.refundAmount ?? p.amount);
14
+ const whole = !p.refundAmount || p.refundAmount.minor === p.amount.minor;
15
+ const unionpay = p.method === 'unionpay';
16
+ // ⚠️ THE FACT, NO ENVIRONMENT'S NAME (robin, 2026-11-03): no real money moves, and
17
+ // the booking was not sent to the group - or, in its own test system, holds no
18
+ // room for anyone.
19
+ const test = h.notReal
20
+ ? ` No real money moves, and this booking was not sent to ${h.name}.`
21
+ : h.test
22
+ ? ' No real money moves, and this booking holds no room for anyone.'
23
+ : '';
24
+ const ended = b.status === 'cancelled' || b.status === 'expired' || b.status === 'failed';
25
+ const said = (() => {
26
+ // Its money as it stands once the stay has ended - never "if it does not take it".
27
+ if (ended) {
28
+ switch (p.status) {
29
+ case 'awaiting':
30
+ case 'lapsed':
31
+ return unionpay
32
+ ? 'Not booked: the one-time card UnionPay issued for it was not charged, and nothing was paid.'
33
+ : 'Not paid: nothing was booked and nothing was charged.';
34
+ case 'issued':
35
+ return `UnionPay had confirmed it; anything ${h.name} charged to the one-time card is ${h.name}'s to return, under its terms.`;
36
+ case 'paid': {
37
+ // Paid, cancelled, and nothing going back yet: the fee took all of
38
+ // it - or a part, or the hotel cancelled late, which a person here
39
+ // settles (华住, 2026-10-16: `attention`). Never "all of it" unless so.
40
+ const kept = fee ?? b.cancellationFee;
41
+ if (kept && kept.minor >= p.amount.minor)
42
+ return `The cancellation fee ${h.name} charges, ${formatMoney(kept)}, is the whole ${amount} paid${unionpay ? ' with UnionPay' : ''}, so nothing goes back.`;
43
+ return kept && kept.minor > 0
44
+ ? `${h.name}'s cancellation fee is ${formatMoney(kept)} of the ${amount} paid; what is due back of the rest, a person here is settling.`
45
+ : `What of the ${amount} paid comes back depends on ${h.name}'s cancellation fee, which a person here is confirming.`;
46
+ }
47
+ case 'refunding':
48
+ return (groupRefundWords(p, h.name, back, whole, amount) ??
49
+ (p.refundStuck
50
+ ? `${back} is due back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}. Sending it back did not go through, and a person is seeing to it.`
51
+ : `${whole ? `All ${back}` : `${back} of the ${amount} paid`} is going back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}.`));
52
+ case 'refunded':
53
+ return `${whole ? `All ${back}` : `${back} of the ${amount} paid`} has gone back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}.`;
54
+ case 'hotel-refunds':
55
+ return `The money is with ${h.name}, who charged the one-time card UnionPay issued: what its terms give back${fee && fee.minor > 0 ? ` after its fee of ${formatMoney(fee)}` : ''}, it returns to that card - nothing is refunded from here${p.refundReason ? ` (${p.refundReason})` : ''}.`;
56
+ }
57
+ }
58
+ switch (p.status) {
59
+ case 'awaiting':
60
+ // ⚠️ NOT "nothing paid": the card page may have been paid a moment ago
61
+ // and not read yet (audit, P0-D) - what is said is what is to be done.
62
+ return unionpay
63
+ ? `**Not booked yet.** ${amount} is to be confirmed on UnionPay's page by ${p.payByLocal ?? p.payBy} hotel time${p.url ? `: ${p.url}` : ''}. ${h.notReal
64
+ ? `Once UnionPay issues its one-time card, the booking is made here - it is not sent to ${h.name}`
65
+ : `Once UnionPay issues its one-time card, the stay is booked with ${h.name}, who charges that card`}; not confirmed by then, nothing is booked or charged.`
66
+ : p.url
67
+ ? `**Not booked yet.** ${amount} is to be paid on ${hostOf(p.url) ?? 'the card page'}${payByWords(p) ? ` by ${payByWords(p)}${p.payByLocal ? ' hotel time' : ''}` : ''}: ${p.url}. ${
68
+ // ⚠️ NOT "BOOKED WITH" A GROUP IT IS NEVER SENT TO (0.55.7, 总线程 11-05).
69
+ h.notReal
70
+ ? `Once it is paid the booking is made here - it is not sent to ${h.name} - and ${deps.tools.listBookings} shows it`
71
+ : `Once it is paid the stay is booked with ${h.name}, and ${deps.tools.listBookings} shows it`}; unpaid by then, the page closes and nothing is booked or charged.`
72
+ : deps.backend.otalessBooking
73
+ ? b.termsChanged || b.confirmAsked
74
+ ? // 0.66.0: held back for the group's new terms (or, 0.67.1, for the guest to confirm
75
+ // what the group asked) - not closed.
76
+ `**Not booked yet** - ${termsHeldWords(deps, b)}.`
77
+ : // Otaless 0.63.2: the group's link can close on its own.
78
+ `**Not booked yet** - ${LINK_CLOSED_WORDS}.`
79
+ : // ⚠️ NO LINK IS NOT "undefined" (2026-10-21 re-audit, T2-6): a card
80
+ // page that was closed and could not be opened again leaves a stay
81
+ // waiting with nowhere to pay it. Say so, and that it lapses.
82
+ `**Not booked yet.** ${amount} is to be paid on the card page by ${p.payByLocal ?? p.payBy} hotel time, but the page's link is not available just now - ask again later (${deps.tools.listBookings} shows where it stands). Nothing is booked or charged until it is paid; if no page comes by then, the stay lapses and can be asked for again.`;
83
+ case 'issued':
84
+ return `Confirmed on UnionPay: ${h.name} is being asked to book it now, and ${deps.tools.listBookings} shows when it has. If ${h.name} does not take it, the one-time card is not charged.`;
85
+ case 'paid':
86
+ // Paid on a page that moved no money, for a booking never sent (0.55.7): not
87
+ // "booked with" the group - the sentence after it says it was not sent.
88
+ if (h.notReal)
89
+ return `${amount} paid ${unionpay ? 'on UnionPay' : 'on the card page'}: the booking is made here.`;
90
+ if (unionpay)
91
+ return b.status === 'confirmed'
92
+ ? `${amount} paid with UnionPay, and booked with ${h.name}, who charges the one-time card UnionPay issued: nothing more is paid at the hotel.`
93
+ : `${amount} confirmed on UnionPay. ${h.name} has not confirmed the booking yet - ${deps.tools.listBookings} shows when it has; if it does not take it, the one-time card is not charged.`;
94
+ // ⚠️ CHARGED WHEN IT WAS BOOKED, NO PAGE (Otaless 0.84.2, the 11-25 code audit's P0-1):
95
+ // the group took it itself - from a wallet the guest has with it (questions #102) - and
96
+ // that is said, never "nothing has been charged".
97
+ if (p.chargedWhenBooked)
98
+ return p.amountUnsaid
99
+ ? // ⚠️ NO AMOUNT SAID IS NOT ¥0, NOR THE PRICE (总线程's review of 0.84.2, 3).
100
+ `${h.name} charged it when it was booked - there was no payment page - without saying how much; the price shown before booking was ${amount}, and a person here is checking what was charged. It is booked: nothing more is paid at the hotel.`
101
+ : `${h.name} charged ${amount} for it when it was booked - there was no payment page to go through - and it is booked: nothing more is paid at the hotel.`;
102
+ return b.status === 'confirmed'
103
+ ? `${amount} paid in advance by card, and booked with ${h.name}: nothing more is paid at the hotel.`
104
+ : `${amount} paid in advance by card. ${h.name} has not confirmed the booking yet - ${deps.tools.listBookings} shows when it has; if it does not take it, all ${amount} goes back.`;
105
+ case 'lapsed':
106
+ return p.cancelledUnpaid
107
+ ? 'Cancelled before it was paid: nothing was booked and nothing was charged.'
108
+ : 'Not paid in time: nothing was booked and nothing was charged.';
109
+ case 'refunding':
110
+ return (groupRefundWords(p, h.name, back, whole, amount) ??
111
+ (p.refundStuck
112
+ ? `${back} is due back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}. Sending it back did not go through, and a person is seeing to it.`
113
+ : `${whole ? `All ${back}` : `${back} of the ${amount} paid`} is going back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}.`));
114
+ case 'refunded':
115
+ return `${whole ? `All ${back}` : `${back} of the ${amount} paid`} has gone back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}.`;
116
+ case 'hotel-refunds':
117
+ return `The money is with ${h.name}, who returns what its terms give back to the card it charged - nothing is refunded from here.`;
118
+ }
119
+ })();
120
+ return `${said}${shownPriceSaid(p, h.name, ended)}${test}`;
121
+ };
122
+ /**
123
+ * ⚠️ WHAT IS CHARGED, WHERE IT IS NOT THE PRICE SHOWN (Otaless 0.84.2, the 11-25 code audit's P0-2
124
+ * and P1-4): the group's USD figure - or its own amount, its prices not checked - beside the price
125
+ * the guest agreed to, so the guest is always told what was charged, or is to be, in its currency.
126
+ */
127
+ export const shownPriceSaid = (p, group, ended) => {
128
+ const shown = p.quotedAs;
129
+ if (!shown || ended || (p.status !== 'paid' && p.status !== 'awaiting'))
130
+ return '';
131
+ const other = shown.currency !== p.amount.currency;
132
+ const what = p.status === 'paid' ? 'was charged' : 'is what the payment page asks';
133
+ return ` ${formatMoney(p.amount)} ${what} - ${other ? `${group}'s own figure in ${p.amount.currency}` : `${group}'s own amount`}; the price shown before booking was ${formatMoney(shown)}.`;
134
+ };
135
+ /**
136
+ * A stay sent to the hotel's own system whose answer is not in yet: being
137
+ * confirmed - never counted as booked, and given no code until it is (总线程,
138
+ * 2026-10-14). A hold or a demonstration's request IS the booking.
139
+ */
140
+ export const confirming = (deps, b) => holderOf(deps, b.supplier).caps.booking === 'pay-at-hotel' &&
141
+ (b.status === 'requested' || b.status === 'unconfirmed');
142
+ /** A booking for the card - with no code while it is being confirmed. */
143
+ export const madeForCard = (deps, b) => {
144
+ const card = listedForCard(deps, b);
145
+ if (!confirming(deps, b))
146
+ return card;
147
+ const { confirmationCode: _unconfirmed, ...rest } = card;
148
+ return { ...rest, pending: true };
149
+ };
150
+ /**
151
+ * ⚠️ WHAT IS NOT AS THE GUEST CHOSE, SAID (Otaless 0.84.2, 总线程's re-review): 8 answered PAID or
152
+ * CONFIRMED (no page) for an order whose guests, terms or amount are not the ones chosen - kept, a
153
+ * person checking it with the group. Never a plain "confirmed".
154
+ */
155
+ export const differsSaid = (deps, b) => {
156
+ const d = b.differs;
157
+ if (!d?.length)
158
+ return '';
159
+ const words = {
160
+ guests: 'the number of guests',
161
+ terms: 'the cancellation terms',
162
+ amount: 'the amount',
163
+ 'amount-unsaid': 'the amount (it did not say one)',
164
+ step: 'a further step it asks for',
165
+ };
166
+ const items = d.map((x) => words[x] ?? x);
167
+ const list = items.length > 1 ? `${items.slice(0, -1).join(', ')} and ${items.at(-1)}` : (items[0] ?? '');
168
+ const g = holderOf(deps, b.supplier).name;
169
+ return `${g} confirmed this booking, but ${list} ${items.length > 1 ? 'are' : 'is'} not what the guest chose: a person here is checking it with ${g}. If the guest does not want it as it is, it can be cancelled.`;
170
+ };
171
+ export const bookedLine = (deps, b) => [
172
+ unconfirmedSaid(deps, b),
173
+ differsSaid(deps, b),
174
+ heldLine(deps, b),
175
+ // The group's own number, where the booking has one (0.77.6).
176
+ b.orderNumber ? `Order number ${b.orderNumber}.` : '',
177
+ couponPointsLine(b, holderOf(deps, b.supplier)),
178
+ ]
179
+ .filter(Boolean)
180
+ .join(' ');
181
+ /**
182
+ * The coupon a booking used and the points it should earn - on the booking
183
+ * itself, so the confirmation says what the review said (§4, §5).
184
+ */
185
+ const couponPointsLine = (b, h) => [
186
+ b.quote.coupon
187
+ ? `Coupon ${couponName(b.quote.coupon)} used: −${formatMoney(b.quote.coupon.off)}, and ${formatMoney(b.quote.total)} is the booking's total after it.`
188
+ : '',
189
+ b.quote.member
190
+ ? h?.notReal
191
+ ? // The card's one sentence (`earnsNote`, 0.55.7): nothing sent, nothing earned.
192
+ `A stay at this rate earns about ${b.quote.member.points.toLocaleString('en-GB')} ${b.quote.member.programme} points; this booking was not sent to ${h.name}, so none are added to the balance.`
193
+ : `About ${b.quote.member.points.toLocaleString('en-GB')} ${b.quote.member.programme} points after the stay - not added to the balance here.`
194
+ : '',
195
+ ]
196
+ .filter(Boolean)
197
+ .join(' ');
198
+ const heldLine = (deps, b) => {
199
+ const paid = paidLine(deps, b);
200
+ if (paid)
201
+ return paid;
202
+ const total = formatMoney(b.quote.total);
203
+ const h = holderOf(deps, b.supplier);
204
+ if (h.caps.booking === 'pay-at-hotel') {
205
+ // ⚠️ THE FACT, IN NO ENVIRONMENT'S WORD (robin, 2026-11-03).
206
+ if (h.notReal)
207
+ return `${total} all in. **This booking was not sent to ${h.name}** - no room is held for anyone and nothing is paid, now or at any hotel. ${notSentSaid(h.name)}`;
208
+ if (h.test)
209
+ return `${total} all in. **This booking holds no room for anyone** - nothing is paid, now or at any hotel, and nobody needs to go there.`;
210
+ // ⚠️ A RATE PAID IN ADVANCE, BOOKED WITHOUT ITS PAYMENT (0.77.5): never "paid at the
211
+ // hotel". That nothing was paid is `bookingNotes`' sentence, said after this one.
212
+ if (b.paymentNotConnected)
213
+ return b.status === 'requested'
214
+ ? `${total} all in. ${h.name} has not confirmed this order yet - that takes up to eight minutes, and ${deps.tools.listBookings} shows when it has.`
215
+ : `${total} all in. The order is created with ${h.name}, under confirmation code ${b.confirmationCode}.`;
216
+ return b.status === 'requested'
217
+ ? `${total} all in, to be paid at the hotel. ${h.name} has not confirmed this booking yet - that takes up to eight minutes, and ${deps.tools.listBookings} shows when it has. Nothing has been charged.`
218
+ : `${total} all in, paid at the hotel. **Nothing has been charged here** - this is ${h.name}'s own reservation, kept until it is cancelled, and the guest pays at check-in.`;
219
+ }
220
+ // ⚠️ CONFIRMED WITH NO PAYMENT PAGE, ITS PAYMENT NOT KNOWN (Otaless 0.84.2, P0-1): never
221
+ // "nothing has been charged" - the group may have charged a wallet the guest has with it.
222
+ if (b.paymentUnknown)
223
+ return paymentUnknownWords(deps, b, h.name);
224
+ const lapses = b.holdUntilLocal
225
+ ? `${b.holdUntilLocal} hotel time`
226
+ : `${b.holdUntil?.slice(0, 16).replace('T', ' ')} UTC`;
227
+ // ⚠️ NO TIME IS NO "UNTIL undefined UTC" (0.84.2, P0-1): said without one. ⚠️ "HAS THE BOOKING"
228
+ // ONLY WHEN IT IS CONFIRMED (总线程's review of 0.84.2, 1): one 8 did not answer for - or answered a
229
+ // server error - is not known to be made; said as that, never as made and never "nothing charged".
230
+ if (!b.holdUntilLocal && !b.holdUntil)
231
+ return b.status === 'confirmed'
232
+ ? `${total} all in. ${h.name} has the booking; ${deps.tools.listBookings} shows where its payment stands.`
233
+ : `${total} all in. Whether ${h.name} took it - and whether anything was charged for it - is not known yet: ${deps.tools.listBookings} shows once it is. Do not book it again meanwhile, and do not say nothing was charged.`;
234
+ // ⚠️ NOT "PRESENTS A CARD AT CHECK-IN" (2026-10-05 audit, P2): a demo
235
+ // booking has no check-in, and saying so sent a guest towards a real desk.
236
+ //
237
+ // ⚠️ AND NOT A CLOCK TIME (2026-11-03 review, T2). "lapses on its own at Tue 3
238
+ // Nov, 11:39" was told as 「今天 11:41 自动失效」 - the booking void today, when
239
+ // the stay is weeks away. A demonstration hold lapses by itself and means
240
+ // nothing for a real stay; said as how long it lasts, and that it is only the
241
+ // demonstration.
242
+ if (h.demo)
243
+ return `${total} all in. **${demoBookingWords(h)}** Nothing has been charged and no card is needed. ${demoHoldWords(b, deps.trips.now())} ${notSentSaid(h.name)}`;
244
+ return `${total} all in. **Nothing has been charged** - the rooms are held until ${lapses}, and the guest presents a card at check-in.`;
245
+ };
246
+ /**
247
+ * A booking the group confirmed with no payment page, whether it was charged not known yet
248
+ * (Otaless 0.84.2, the 11-25 code audit's P0-1) - made, listed or cancelled.
249
+ */
250
+ export const paymentUnknownWords = (deps, b, group) => {
251
+ const total = formatMoney(b.quote.total);
252
+ return b.status === 'cancelled' || b.status === 'expired' || b.status === 'failed'
253
+ ? `${group} had confirmed it without a payment page, and whether it charged it (to a wallet or card the guest has with ${group}) is still not known - if it did, a person here takes up its refund with ${group}. Do not say nothing was charged.`
254
+ : `${total} all in. ${group} confirmed it without a payment page, and whether it has charged it already (to a wallet or card the guest has with ${group}) is being checked - there is nothing to pay here now, and ${deps.tools.listBookings} shows once it is known. Do not say nothing was charged.`;
255
+ };
256
+ /**
257
+ * How long a demonstration hold lasts, as "in N minutes" from now - the hold
258
+ * lapses by itself, and says nothing about the stay (T2, `heldLine`).
259
+ */
260
+ const demoHoldWords = (b, now) => {
261
+ const minutes = b.holdUntil ? Math.ceil((Date.parse(b.holdUntil) - now) / 60_000) : Number.NaN;
262
+ if (Number.isNaN(minutes))
263
+ return '';
264
+ const lasting = minutes <= 1
265
+ ? 'in a minute'
266
+ : minutes < 90
267
+ ? `in ${minutes} minutes`
268
+ : minutes < 48 * 60
269
+ ? `in about ${Math.round(minutes / 60)} hours`
270
+ : `in about ${Math.round(minutes / (24 * 60))} days`;
271
+ // No "demonstration" (robin, 2026-11-03): only that it lapses and holds no room.
272
+ return `It lapses by itself ${lasting} (no real room is held; the stay's own dates are not affected).`;
273
+ };
274
+ /** What a booking that is not sent to the group is, in one sentence - see `demoBookingNote`. */
275
+ const demoBookingWords = (h) => `This booking was not sent to ${h.name}, and ${h.name} is not holding any room.`;
276
+ /**
277
+ * ⚠️ THE FACT, AND NO WORD FOR AN ENVIRONMENT (0.55.8; robin 2026-11-03 「不用特意写不是
278
+ * 真的」, 总线程 11-05). Told "a booking made here is not sent to Atour", the model on
279
+ * claude.ai said 「这个亚朵连接器是演示环境」 - a word nobody gave it. Said after each
280
+ * such fact, in the service instructions and in the answers about a booking, only
281
+ * where nothing is sent to the group (`notReal`); a group's own test system, which a
282
+ * booking does reach, is not told this.
283
+ */
284
+ export const notSentSaid = (name) =>
285
+ // ⚠️ WITHOUT THE WORDS IT FORBIDS: a sentence naming them would be the label in the
286
+ // model's text (env-one-word.test.ts holds every answer and instruction to none).
287
+ `Say only that fact - not sent to ${name}, no room held, nothing charged - and nothing about what kind of connector or environment this is: do not call it, ${name} or its hotels a trial, a mock-up or not real.`;
288
+ /**
289
+ * Said on every answer about a demonstration booking - made, changed or
290
+ * cancelled - and on nothing else: a hold of the demo's that a guest took for
291
+ * the hotel's would send them to a desk with a code nobody there has.
292
+ */
293
+ export const demoBookingNote = (deps, supplier) => {
294
+ const h = holderOf(deps, supplier);
295
+ return h.demo && h.caps.booking === 'hold' ? `${demoBookingWords(h)} ${notSentSaid(h.name)}` : '';
296
+ };
297
+ /**
298
+ * What every answer tells the card about the deployment - its name, logo, colours, tools - for an
299
+ * answer drawn outside this file too: the account's (account/index.ts, 0.56.0), which may be the
300
+ * first card of a conversation.
301
+ */
302
+ export const commonFields = (deps, key) => common(deps, key);
303
+ export const common = (deps, key) => {
304
+ const caps = deps.backend.capabilities ?? FULL_CAPABILITIES;
305
+ return {
306
+ brand: deps.vocab.brand,
307
+ // The group in the card's language (「没有发到亚朵」) - see `HotelConfig.names`.
308
+ ...(deps.brandNames ? { brandNames: deps.brandNames } : {}),
309
+ ...(deps.logoUrl ? { logoUrl: deps.logoUrl } : {}),
310
+ ...(deps.logoDarkUrl ? { logoDarkUrl: deps.logoDarkUrl } : {}),
311
+ ...(deps.logoByLang ? { logoByLang: deps.logoByLang } : {}),
312
+ ...(deps.accent ? { accent: deps.accent } : {}),
313
+ ...(deps.homeImage ? { homeImage: deps.homeImage } : {}),
314
+ ...(deps.primary ? { primary: deps.primary } : {}),
315
+ ...(deps.fonts ? { fonts: deps.fonts } : {}),
316
+ ...(deps.showName ? { showName: true } : {}),
317
+ toolNames: (() => {
318
+ const names = deps.offered
319
+ ? Object.fromEntries(Object.entries(deps.tools).filter(([, name]) => deps.offered?.has(name)))
320
+ : { ...deps.tools };
321
+ // 0.82.0 (contract with the card): the card-only add-ons tool is `toolNames.addonsCard`, only
322
+ // where it exists - every other deployment's map is exactly what it was.
323
+ const card = deps.tools.cardAddons;
324
+ return card && names.cardAddons ? { ...names, addonsCard: card } : names;
325
+ })(),
326
+ bookingMode: caps.booking,
327
+ // In a market each group says whether it needs a phone (`market.suppliers`).
328
+ ...(caps.requiresPhone && !deps.backend.suppliers ? { phoneRequired: true } : {}),
329
+ // …or asks for one the guest may leave out (`asksPhone`) - not in a market,
330
+ // whose form is its groups' (and Otaless stays as it is, robin 10-15).
331
+ ...(caps.asksPhone && !caps.requiresPhone && !deps.backend.suppliers
332
+ ? { phoneAsked: true }
333
+ : {}),
334
+ ...(deps.vocab.sandbox ? { sandbox: true } : {}),
335
+ // The group's own test system: the card says "test", never "simulated" -
336
+ // and where it sells rates paid in advance, that those are paid with a
337
+ // test card, never that "nothing is paid" (华住, 2026-10-15).
338
+ ...(deps.vocab.test ? { test: true } : {}),
339
+ ...(deps.vocab.test && caps.prepaid ? { testPays: true } : {}),
340
+ ...(caps.programme ? { programme: caps.programme } : {}),
341
+ ...(caps.codePrefix ? { codePrefix: caps.codePrefix } : {}),
342
+ // Sells rooms by the hour: the card draws its Overnight / By the hour
343
+ // switch only then - it sees answers, never the tools' parameters (香格里拉,
344
+ // 2026-10-12).
345
+ ...(caps.hourly ? { hourly: true } : {}),
346
+ // A market: the card draws each hotel and booking as its group's.
347
+ ...(deps.backend.suppliers
348
+ ? { market: { name: deps.vocab.brand, suppliers: deps.backend.suppliers() } }
349
+ : {}),
350
+ vocab: { noun: deps.vocab.noun, nounPlural: deps.vocab.nounPlural },
351
+ // ⚠️ NO NOTE ABOUT THE DATA (robin, 2026-11-03: 「不用特意写不是真的」): `demo`
352
+ // still tells the card a booking here is not a real one, which it says as a
353
+ // booking's facts; nothing labels the environment.
354
+ demo: deps.vocab.demo,
355
+ ...(key ? memberBadge(deps, key) : {}),
356
+ ...(langOf(deps, key) ? { lang: langOf(deps, key) } : {}),
357
+ };
358
+ };
359
+ //# sourceMappingURL=paid-lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paid-lines.js","sourceRoot":"","sources":["../../src/tools/paid-lines.ts"],"names":[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,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxC,kEAAkE;QAClE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS;YACxB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE;YAC7E,CAAC,CAAC,EAAE,CAAC;QACP,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;QACnE,qEAAqE;QACrE,4EAA4E;QAC5E,mDAAmD;QACnD,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;QACrB,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ToolCall } from './call.js';
2
+ import type { ToolAnswer } from './deps.js';
3
+ export declare const answerPayWithUnionPay: ({ deps, args, ctx, key, }: ToolCall) => Promise<ToolAnswer>;
4
+ //# sourceMappingURL=pay-with-union-pay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pay-with-union-pay.d.ts","sourceRoot":"","sources":["../../src/tools/pay-with-union-pay.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS5C,eAAO,MAAM,qBAAqB,GAAU,2BAKzC,QAAQ,KAAG,OAAO,CAAC,UAAU,CAsG/B,CAAC"}
@@ -0,0 +1,112 @@
1
+ import { formatMoney } from '../money.js';
2
+ import { str } from './args.js';
3
+ import { bookingForCard } from './cancel-facts.js';
4
+ import { common } from './paid-lines.js';
5
+ import { TOO_MANY_TRIES, guarded, identity } from './session-notes.js';
6
+ import { bookingLine } from './terms-answer.js';
7
+ // A stay waiting for its payment, paid with UnionPay instead - the card's
8
+ // step, never the model's (robin, 2026-10-15: "OPN 走 stripe,信用卡走银联").
9
+ // Asked by code AND email, counted like every look-up by code: a code alone
10
+ // must not move someone else's stay off the page they are paying on.
11
+ export const answerPayWithUnionPay = async ({ deps, args, ctx, key, }) => {
12
+ const code = str(args.booking);
13
+ const email = str(args.email);
14
+ const who = identity(deps, ctx, key, args);
15
+ const pay = deps.backend.unionPay?.bind(deps.backend);
16
+ // ⚠️ EVERY TRY COUNTS, NOT ONLY A MISS (2026-10-16 audit, P0-E). `guarded`
17
+ // counts a code and email that do not match; one that does was free, and
18
+ // each call opens UnionPay's card page or its confirmation through the
19
+ // gateway - fifty of them used up its key's limit for every guest. A
20
+ // guest's own card takes a press, a "continue" and a reopen at most.
21
+ //
22
+ // ⚠️ THE STAY'S COUNT IS KEPT PER CODE AND EMAIL, NEVER PER CODE (2026-10-21
23
+ // re-audit, T2-11). The count is made BEFORE the backend checks the email,
24
+ // so with the code alone as its key anyone who knew only a code - one is
25
+ // printed on a confirmation, or read over a shoulder - could ask five times
26
+ // with any email and use up the stay's quarter of an hour, and the guest's
27
+ // own press was refused as "too many". Keyed with the email asked, a wrong
28
+ // email counts against itself: the guest's pair is the guest's alone. The
29
+ // conversation and the address are counted as before. (The backend counts
30
+ // a stay's asks too, but only once the pair has matched.)
31
+ const tries = [
32
+ `unionpay|booking|${code.trim().toLowerCase()}|${email.trim().toLowerCase()}`,
33
+ `unionpay|session|${who.sessionId}`,
34
+ ...(ctx.ip ? [`ip|unionpay|${ctx.ip}`] : []),
35
+ ];
36
+ const used = !!code && !!deps.misses?.blocked(tries);
37
+ if (pay && code && email && !used)
38
+ deps.misses?.miss(tries);
39
+ const { found: step, tooMany } = pay && code && email && !used
40
+ ? await guarded(deps, ctx, who, code, async () => (await pay(code, email, who)) ?? null)
41
+ : { found: null, tooMany: used };
42
+ if (used) {
43
+ const why = 'Paying with UnionPay has been asked for this stay too many times just now. Try again in a quarter of an hour - or pay on the card page, which is still open.';
44
+ return {
45
+ structured: {
46
+ view: 'error',
47
+ ...common(deps, key),
48
+ error: 'unionpay-refused',
49
+ detail: why,
50
+ refusal: 'too-many',
51
+ },
52
+ text: why,
53
+ isError: true,
54
+ };
55
+ }
56
+ if (!step) {
57
+ return {
58
+ structured: {
59
+ view: 'booking-not-found',
60
+ ...common(deps, key),
61
+ query: code,
62
+ ...(tooMany ? { tooMany: true } : {}),
63
+ },
64
+ text: tooMany
65
+ ? TOO_MANY_TRIES
66
+ : 'No stay waiting for its payment matches that code and email. Both are needed, as they are on the booking.',
67
+ isError: true,
68
+ };
69
+ }
70
+ if (step.kind === 'refused') {
71
+ return {
72
+ structured: {
73
+ view: 'error',
74
+ ...common(deps, key),
75
+ error: 'unionpay-refused',
76
+ detail: step.why,
77
+ // Why, as a code the card says in the guest's language (华住, 2026-10-15).
78
+ ...(step.code ? { refusal: step.code } : {}),
79
+ },
80
+ text: step.why,
81
+ isError: true,
82
+ };
83
+ }
84
+ if (step.kind === 'paid-on-card') {
85
+ return {
86
+ structured: {
87
+ view: 'booking',
88
+ ...common(deps, key),
89
+ booking: bookingForCard(step.booking),
90
+ total: formatMoney(step.booking.quote.total),
91
+ },
92
+ text: `${step.booking.confirmationCode} was paid on the card page already, so it stays paid there: ${bookingLine(deps, step.booking)}`,
93
+ };
94
+ }
95
+ return {
96
+ structured: {
97
+ view: 'unionpay',
98
+ ...common(deps, key),
99
+ step: step.kind,
100
+ url: step.url,
101
+ ...(step.kind === 'confirm' ? { booking: bookingForCard(step.booking) } : {}),
102
+ },
103
+ // ⚠️ THE LINK STAYS ON THE CARD (2026-10-27 audit, F9). Only the card
104
+ // calls this, and the card hands this text to the model as context - so
105
+ // UnionPay's own page, a link nobody here knows the life of, went into
106
+ // the conversation. `url` is in the structure, for the card alone.
107
+ text: step.kind === 'enroll'
108
+ ? `No UnionPay card is on file for that email yet. UnionPay's page to add one is on the card - once it is added, paying with UnionPay again opens the confirmation.`
109
+ : `UnionPay's page to confirm ${step.booking.confirmationCode} on is on the card - the hotel is asked once UnionPay has confirmed it.`,
110
+ };
111
+ };
112
+ //# sourceMappingURL=pay-with-union-pay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pay-with-union-pay.js","sourceRoot":"","sources":["../../src/tools/pay-with-union-pay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,0EAA0E;AAC1E,sEAAsE;AACtE,4EAA4E;AAC5E,qEAAqE;AACrE,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAE,EAC1C,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,GAAG,GACM,EAAuB,EAAE;IAClC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,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