@benchme/scenarios 0.9.0 → 0.10.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/acme-v1/index.d.ts +2 -1
- package/dist/acme-v1/index.js +4 -1
- package/dist/acme-v1/index.js.map +1 -1
- package/dist/acme-v1/names.d.ts +3 -0
- package/dist/acme-v1/names.js +3 -0
- package/dist/acme-v1/names.js.map +1 -1
- package/dist/guide-v1/index.js +2 -0
- package/dist/guide-v1/index.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/prng.d.ts +7 -0
- package/dist/prng.js +12 -0
- package/dist/prng.js.map +1 -1
- package/dist/scenario.d.ts +68 -0
- package/dist/scenario.js.map +1 -1
- package/dist/shops-v1/index.js +2 -0
- package/dist/shops-v1/index.js.map +1 -1
- package/dist/sites/cinema/generate.d.ts +22 -0
- package/dist/sites/cinema/generate.js +258 -0
- package/dist/sites/cinema/generate.js.map +1 -0
- package/dist/sites/cinema/index.d.ts +3 -0
- package/dist/sites/cinema/index.js +4 -0
- package/dist/sites/cinema/index.js.map +1 -0
- package/dist/sites/cinema/rules.d.ts +142 -0
- package/dist/sites/cinema/rules.js +191 -0
- package/dist/sites/cinema/rules.js.map +1 -0
- package/dist/sites/cinema/types.d.ts +93 -0
- package/dist/sites/cinema/types.js +2 -0
- package/dist/sites/cinema/types.js.map +1 -0
- package/dist/sites/clinic/generate.d.ts +28 -0
- package/dist/sites/clinic/generate.js +282 -0
- package/dist/sites/clinic/generate.js.map +1 -0
- package/dist/sites/clinic/index.d.ts +3 -0
- package/dist/sites/clinic/index.js +3 -0
- package/dist/sites/clinic/index.js.map +1 -0
- package/dist/sites/clinic/rules.d.ts +96 -0
- package/dist/sites/clinic/rules.js +154 -0
- package/dist/sites/clinic/rules.js.map +1 -0
- package/dist/sites/clinic/types.d.ts +125 -0
- package/dist/sites/clinic/types.js +2 -0
- package/dist/sites/clinic/types.js.map +1 -0
- package/dist/sites/dining/generate.d.ts +15 -0
- package/dist/sites/dining/generate.js +146 -0
- package/dist/sites/dining/generate.js.map +1 -0
- package/dist/sites/dining/index.d.ts +3 -0
- package/dist/sites/dining/index.js +4 -0
- package/dist/sites/dining/index.js.map +1 -0
- package/dist/sites/dining/rules.d.ts +92 -0
- package/dist/sites/dining/rules.js +156 -0
- package/dist/sites/dining/rules.js.map +1 -0
- package/dist/sites/dining/types.d.ts +69 -0
- package/dist/sites/dining/types.js +14 -0
- package/dist/sites/dining/types.js.map +1 -0
- package/dist/sites/events/generate.d.ts +27 -0
- package/dist/sites/events/generate.js +197 -0
- package/dist/sites/events/generate.js.map +1 -0
- package/dist/sites/events/index.d.ts +3 -0
- package/dist/sites/events/index.js +4 -0
- package/dist/sites/events/index.js.map +1 -0
- package/dist/sites/events/rules.d.ts +99 -0
- package/dist/sites/events/rules.js +172 -0
- package/dist/sites/events/rules.js.map +1 -0
- package/dist/sites/events/types.d.ts +78 -0
- package/dist/sites/events/types.js +10 -0
- package/dist/sites/events/types.js.map +1 -0
- package/dist/sites/flights/generate.d.ts +21 -0
- package/dist/sites/flights/generate.js +210 -0
- package/dist/sites/flights/generate.js.map +1 -0
- package/dist/sites/flights/index.d.ts +3 -0
- package/dist/sites/flights/index.js +3 -0
- package/dist/sites/flights/index.js.map +1 -0
- package/dist/sites/flights/rules.d.ts +79 -0
- package/dist/sites/flights/rules.js +125 -0
- package/dist/sites/flights/rules.js.map +1 -0
- package/dist/sites/flights/types.d.ts +69 -0
- package/dist/sites/flights/types.js +2 -0
- package/dist/sites/flights/types.js.map +1 -0
- package/dist/sites/homes/generate.d.ts +19 -0
- package/dist/sites/homes/generate.js +180 -0
- package/dist/sites/homes/generate.js.map +1 -0
- package/dist/sites/homes/index.d.ts +3 -0
- package/dist/sites/homes/index.js +3 -0
- package/dist/sites/homes/index.js.map +1 -0
- package/dist/sites/homes/rules.d.ts +68 -0
- package/dist/sites/homes/rules.js +94 -0
- package/dist/sites/homes/rules.js.map +1 -0
- package/dist/sites/homes/types.d.ts +62 -0
- package/dist/sites/homes/types.js +2 -0
- package/dist/sites/homes/types.js.map +1 -0
- package/dist/sites/hotels/generate.d.ts +16 -0
- package/dist/sites/hotels/generate.js +134 -0
- package/dist/sites/hotels/generate.js.map +1 -0
- package/dist/sites/pizza/catalog.d.ts +34 -0
- package/dist/sites/pizza/catalog.js +65 -0
- package/dist/sites/pizza/catalog.js.map +1 -0
- package/dist/sites/pizza/generate.d.ts +19 -0
- package/dist/sites/pizza/generate.js +203 -0
- package/dist/sites/pizza/generate.js.map +1 -0
- package/dist/sites/pizza/index.d.ts +4 -0
- package/dist/sites/pizza/index.js +4 -0
- package/dist/sites/pizza/index.js.map +1 -0
- package/dist/sites/pizza/rules.d.ts +134 -0
- package/dist/sites/pizza/rules.js +217 -0
- package/dist/sites/pizza/rules.js.map +1 -0
- package/dist/sites/pizza/types.d.ts +114 -0
- package/dist/sites/pizza/types.js +2 -0
- package/dist/sites/pizza/types.js.map +1 -0
- package/dist/sites/rows.d.ts +14 -0
- package/dist/sites/rows.js +45 -0
- package/dist/sites/rows.js.map +1 -0
- package/dist/sites/sports/generate.d.ts +18 -0
- package/dist/sites/sports/generate.js +247 -0
- package/dist/sites/sports/generate.js.map +1 -0
- package/dist/sites/sports/index.d.ts +3 -0
- package/dist/sites/sports/index.js +3 -0
- package/dist/sites/sports/index.js.map +1 -0
- package/dist/sites/sports/rules.d.ts +110 -0
- package/dist/sites/sports/rules.js +139 -0
- package/dist/sites/sports/rules.js.map +1 -0
- package/dist/sites/sports/types.d.ts +91 -0
- package/dist/sites/sports/types.js +8 -0
- package/dist/sites/sports/types.js.map +1 -0
- package/dist/stays.d.ts +63 -0
- package/dist/stays.js +96 -0
- package/dist/stays.js.map +1 -0
- package/dist/web-v1/index.js +2 -0
- package/dist/web-v1/index.js.map +1 -1
- package/dist/webmcp-v1/index.d.ts +11 -0
- package/dist/webmcp-v1/index.js +26 -0
- package/dist/webmcp-v1/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The clinic network site (apps/clinic, "Calvenor Clinics"): clinics with a
|
|
3
|
+
* pharmacy each, doctors, insurance plans, procedures, medications and their
|
|
4
|
+
* pharmacy prices, patients, appointments, prescriptions and refill requests.
|
|
5
|
+
* Every name, plan, procedure and medication is invented, and the site is
|
|
6
|
+
* administrative only: it books, prices and refills; it gives no medical advice.
|
|
7
|
+
* Rules: ./rules.ts.
|
|
8
|
+
*/
|
|
9
|
+
export type ClinicVisitType = "in-person" | "video";
|
|
10
|
+
/** A doctor sees patients either in the morning (09:00–11:30 starts) or the afternoon (13:00–15:30 starts), in 30-minute slots. */
|
|
11
|
+
export type ClinicSession = "morning" | "afternoon";
|
|
12
|
+
/** A clinic; every clinic runs a pharmacy, addressed by the clinic's code. */
|
|
13
|
+
export type Clinic = {
|
|
14
|
+
code: string;
|
|
15
|
+
name: string;
|
|
16
|
+
city: string;
|
|
17
|
+
address: string;
|
|
18
|
+
phone: string;
|
|
19
|
+
pharmacyPhone: string;
|
|
20
|
+
};
|
|
21
|
+
export type ClinicDoctor = {
|
|
22
|
+
code: string;
|
|
23
|
+
name: string;
|
|
24
|
+
clinicCode: string;
|
|
25
|
+
specialty: string;
|
|
26
|
+
languages: string[];
|
|
27
|
+
visitTypes: ClinicVisitType[];
|
|
28
|
+
acceptingNewPatients: boolean;
|
|
29
|
+
/** The plans (codes) this doctor is in network for. */
|
|
30
|
+
networkPlans: string[];
|
|
31
|
+
/** What a visit costs a patient the doctor is not in network for; null where the visit type is not offered. */
|
|
32
|
+
inPersonFeeCents: number | null;
|
|
33
|
+
videoFeeCents: number | null;
|
|
34
|
+
/** ISO weekdays the doctor sees patients: 1 = Monday … 5 = Friday. */
|
|
35
|
+
workDays: number[];
|
|
36
|
+
session: ClinicSession;
|
|
37
|
+
};
|
|
38
|
+
/** An insurance plan: the copay a patient pays for a visit with a doctor in its network. */
|
|
39
|
+
export type ClinicPlan = {
|
|
40
|
+
code: string;
|
|
41
|
+
name: string;
|
|
42
|
+
inPersonCopayCents: number;
|
|
43
|
+
videoCopayCents: number;
|
|
44
|
+
};
|
|
45
|
+
export type ClinicProcedure = {
|
|
46
|
+
code: string;
|
|
47
|
+
name: string;
|
|
48
|
+
priceCents: number;
|
|
49
|
+
};
|
|
50
|
+
export type ClinicCoverageStatus = "covered" | "prior-authorisation" | "not-covered";
|
|
51
|
+
/** One plan's terms for one procedure. `coinsurancePct` is the share of the price the PATIENT pays; null when not covered. */
|
|
52
|
+
export type ClinicCoverage = {
|
|
53
|
+
planCode: string;
|
|
54
|
+
procedureCode: string;
|
|
55
|
+
status: ClinicCoverageStatus;
|
|
56
|
+
coinsurancePct: number | null;
|
|
57
|
+
};
|
|
58
|
+
export type ClinicMedication = {
|
|
59
|
+
code: string;
|
|
60
|
+
name: string;
|
|
61
|
+
dosages: string[];
|
|
62
|
+
};
|
|
63
|
+
/** What one clinic's pharmacy charges for one medication at one dosage; a missing row means it does not stock it. */
|
|
64
|
+
export type ClinicPharmacyPrice = {
|
|
65
|
+
clinicCode: string;
|
|
66
|
+
medicationCode: string;
|
|
67
|
+
dosage: string;
|
|
68
|
+
priceCents: number;
|
|
69
|
+
};
|
|
70
|
+
export type ClinicPatient = {
|
|
71
|
+
email: string;
|
|
72
|
+
name: string;
|
|
73
|
+
planCode: string;
|
|
74
|
+
};
|
|
75
|
+
export type ClinicAppointmentStatus = "booked" | "cancelled";
|
|
76
|
+
export type ClinicAppointment = {
|
|
77
|
+
appointmentNo: string;
|
|
78
|
+
doctorCode: string;
|
|
79
|
+
clinicCode: string;
|
|
80
|
+
patientName: string;
|
|
81
|
+
patientEmail: string;
|
|
82
|
+
/** The plan the visit is billed to; null for a patient paying the doctor's fee. */
|
|
83
|
+
planCode: string | null;
|
|
84
|
+
/** "YYYY-MM-DD" and "HH:MM", the start of a 30-minute slot. */
|
|
85
|
+
date: string;
|
|
86
|
+
time: string;
|
|
87
|
+
visitType: ClinicVisitType;
|
|
88
|
+
status: ClinicAppointmentStatus;
|
|
89
|
+
/** What the patient pays for the visit (`clinicVisitCostCents` at booking). */
|
|
90
|
+
costCents: number;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
};
|
|
93
|
+
export type ClinicPrescription = {
|
|
94
|
+
rxNo: string;
|
|
95
|
+
patientEmail: string;
|
|
96
|
+
patientName: string;
|
|
97
|
+
medicationCode: string;
|
|
98
|
+
dosage: string;
|
|
99
|
+
doctorCode: string;
|
|
100
|
+
/** Refills still allowed; each refill request uses one. */
|
|
101
|
+
refillsLeft: number;
|
|
102
|
+
issuedOn: string;
|
|
103
|
+
};
|
|
104
|
+
export type ClinicRefillStatus = "requested" | "collected";
|
|
105
|
+
/** A refill request, collected at one clinic's pharmacy. At most one `requested` refill per prescription at a time. */
|
|
106
|
+
export type ClinicRefill = {
|
|
107
|
+
refillNo: string;
|
|
108
|
+
rxNo: string;
|
|
109
|
+
pharmacyCode: string;
|
|
110
|
+
status: ClinicRefillStatus;
|
|
111
|
+
requestedAt: string;
|
|
112
|
+
};
|
|
113
|
+
export type ClinicRows = {
|
|
114
|
+
clinics: Clinic[];
|
|
115
|
+
doctors: ClinicDoctor[];
|
|
116
|
+
plans: ClinicPlan[];
|
|
117
|
+
procedures: ClinicProcedure[];
|
|
118
|
+
coverage: ClinicCoverage[];
|
|
119
|
+
medications: ClinicMedication[];
|
|
120
|
+
prices: ClinicPharmacyPrice[];
|
|
121
|
+
patients: ClinicPatient[];
|
|
122
|
+
appointments: ClinicAppointment[];
|
|
123
|
+
prescriptions: ClinicPrescription[];
|
|
124
|
+
refills: ClinicRefill[];
|
|
125
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/sites/clinic/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type DiningRows } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The reservation site's rows: restaurants in the six cities, their seating
|
|
4
|
+
* and reservations already made. Drawn from a stream of its own
|
|
5
|
+
* (`substream(seed, "dining")`), so adding the site moved no other row. Some
|
|
6
|
+
* areas are fully booked at some times on purpose: a search has to check the
|
|
7
|
+
* tables, not just the menus and hours.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DINING_SIZES: {
|
|
10
|
+
readonly restaurantsPerCity: readonly [4, 6];
|
|
11
|
+
readonly guests: 40;
|
|
12
|
+
readonly reservations: 170;
|
|
13
|
+
readonly fullBlocks: 24;
|
|
14
|
+
};
|
|
15
|
+
export declare function diningRows(seed: number): DiningRows;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { CITY_LIST, FIRST_NAMES, LAST_NAMES, word } from "../../acme-v1/names.js";
|
|
2
|
+
import { int, pick, substream } from "../../prng.js";
|
|
3
|
+
import { addDays } from "../../stays.js";
|
|
4
|
+
import { diningClock, diningDepositCents, diningMinutes, diningSeatingTimes, diningTablesLeft } from "./rules.js";
|
|
5
|
+
import { DINING_AREAS, DINING_CUISINES, DINING_MENUS, DINING_WEEKDAYS, } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* The reservation site's rows: restaurants in the six cities, their seating
|
|
8
|
+
* and reservations already made. Drawn from a stream of its own
|
|
9
|
+
* (`substream(seed, "dining")`), so adding the site moved no other row. Some
|
|
10
|
+
* areas are fully booked at some times on purpose: a search has to check the
|
|
11
|
+
* tables, not just the menus and hours.
|
|
12
|
+
*/
|
|
13
|
+
export const DINING_SIZES = { restaurantsPerCity: [4, 6], guests: 40, reservations: 170, fullBlocks: 24 };
|
|
14
|
+
/** How often each menu and area appears; every restaurant has indoor tables. */
|
|
15
|
+
const MENU_ODDS = { vegetarian: 0.7, vegan: 0.4, "gluten-free": 0.5 };
|
|
16
|
+
const AREA_ODDS = { indoor: 1, terrace: 0.55, bar: 0.45, private: 0.35 };
|
|
17
|
+
const SUFFIXES = ["Kitchen", "Table", "Dining Room", "Canteen", "House", "Bistro", "Grill", "Eatery"];
|
|
18
|
+
const SETTINGS = ["on the market square", "by the river", "near the central station", "on a quiet side street", "in the old town", "above the harbour"];
|
|
19
|
+
const NOTES = ["Birthday dinner", "A table by the window if possible", "One guest uses a wheelchair", "We need a high chair", "One guest is allergic to shellfish", "Business dinner, a quiet table please"];
|
|
20
|
+
/** Seeded reservations fall in this span, so the reservable year has busy weeks and empty ones. */
|
|
21
|
+
const BUSY_FROM = "2027-04-05";
|
|
22
|
+
const BUSY_DAYS = 56;
|
|
23
|
+
function makeHours(rng) {
|
|
24
|
+
const closedDay = pick(rng, DINING_WEEKDAYS.filter((d) => d !== "friday" && d !== "saturday"));
|
|
25
|
+
const opens = pick(rng, ["11:30", "12:00", "12:00", "17:00", "17:30"]);
|
|
26
|
+
const closes = diningMinutes(pick(rng, ["22:00", "22:30", "23:00"]));
|
|
27
|
+
const hours = Object.fromEntries(DINING_WEEKDAYS.map((d) => {
|
|
28
|
+
if (d === closedDay)
|
|
29
|
+
return [d, null];
|
|
30
|
+
const late = d === "friday" || d === "saturday" ? Math.min(closes + 60, diningMinutes("23:30")) : d === "sunday" ? closes - 60 : closes;
|
|
31
|
+
return [d, { opens, closes: diningClock(late) }];
|
|
32
|
+
}));
|
|
33
|
+
return { closedDay, hours };
|
|
34
|
+
}
|
|
35
|
+
function makeSeating(rng, code) {
|
|
36
|
+
return DINING_AREAS.filter((a) => rng() < AREA_ODDS[a]).map((area) => {
|
|
37
|
+
if (area === "indoor")
|
|
38
|
+
return { restaurantCode: code, area, seats: pick(rng, [4, 6]), tables: int(rng, 2, 5) };
|
|
39
|
+
if (area === "terrace")
|
|
40
|
+
return { restaurantCode: code, area, seats: pick(rng, [2, 4]), tables: int(rng, 1, 3) };
|
|
41
|
+
if (area === "bar")
|
|
42
|
+
return { restaurantCode: code, area, seats: 2, tables: int(rng, 2, 4) };
|
|
43
|
+
return { restaurantCode: code, area, seats: pick(rng, [8, 10, 12]), tables: 1 };
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function makeRestaurants(rng) {
|
|
47
|
+
const restaurants = [];
|
|
48
|
+
const seating = [];
|
|
49
|
+
const names = new Set();
|
|
50
|
+
let n = 100;
|
|
51
|
+
for (const city of CITY_LIST) {
|
|
52
|
+
const count = int(rng, DINING_SIZES.restaurantsPerCity[0], DINING_SIZES.restaurantsPerCity[1]);
|
|
53
|
+
for (let i = 0; i < count; i++) {
|
|
54
|
+
let name = "";
|
|
55
|
+
do
|
|
56
|
+
name = `${word(rng)} ${pick(rng, SUFFIXES)}`;
|
|
57
|
+
while (names.has(name));
|
|
58
|
+
names.add(name);
|
|
59
|
+
const code = `RS-${++n}`;
|
|
60
|
+
const cuisine = pick(rng, DINING_CUISINES);
|
|
61
|
+
const { closedDay, hours } = makeHours(rng);
|
|
62
|
+
const areas = makeSeating(rng, code);
|
|
63
|
+
seating.push(...areas);
|
|
64
|
+
restaurants.push({
|
|
65
|
+
code,
|
|
66
|
+
name,
|
|
67
|
+
city,
|
|
68
|
+
cuisine,
|
|
69
|
+
priceLevel: int(rng, 1, 4),
|
|
70
|
+
description: `${name} serves ${cuisine} food ${pick(rng, SETTINGS)} in ${city}.`,
|
|
71
|
+
menus: DINING_MENUS.filter((m) => rng() < MENU_ODDS[m]),
|
|
72
|
+
closedDay,
|
|
73
|
+
hours,
|
|
74
|
+
depositPerGuestCents: rng() < 0.5 ? 0 : int(rng, 1, 5) * 500,
|
|
75
|
+
privateRoomFeeCents: areas.some((a) => a.area === "private") ? int(rng, 5, 20) * 1000 : null,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return { restaurants, seating };
|
|
80
|
+
}
|
|
81
|
+
function makeGuests(rng) {
|
|
82
|
+
const out = new Map();
|
|
83
|
+
while (out.size < DINING_SIZES.guests) {
|
|
84
|
+
const first = pick(rng, FIRST_NAMES);
|
|
85
|
+
const last = pick(rng, LAST_NAMES);
|
|
86
|
+
const email = `${first}.${last}${int(rng, 1, 9)}@example.com`.toLowerCase();
|
|
87
|
+
if (!out.has(email))
|
|
88
|
+
out.set(email, { name: `${first} ${last}`, email, phone: `555-${int(rng, 200, 899)}-${int(rng, 1000, 9999)}` });
|
|
89
|
+
}
|
|
90
|
+
return [...out.values()];
|
|
91
|
+
}
|
|
92
|
+
export function diningRows(seed) {
|
|
93
|
+
const rng = substream(seed, "dining");
|
|
94
|
+
const { restaurants, seating } = makeRestaurants(rng);
|
|
95
|
+
const guests = makeGuests(rng);
|
|
96
|
+
const restaurantOf = new Map(restaurants.map((r) => [r.code, r]));
|
|
97
|
+
const reservations = [];
|
|
98
|
+
const reserve = (s, date, time, status) => {
|
|
99
|
+
const r = restaurantOf.get(s.restaurantCode);
|
|
100
|
+
const guest = pick(rng, guests);
|
|
101
|
+
const partySize = s.area === "private" ? int(rng, 6, s.seats) : int(rng, Math.min(2, s.seats), s.seats);
|
|
102
|
+
reservations.push({
|
|
103
|
+
reservationNo: `RV-${10001 + reservations.length}`,
|
|
104
|
+
restaurantCode: r.code,
|
|
105
|
+
area: s.area,
|
|
106
|
+
date,
|
|
107
|
+
time,
|
|
108
|
+
partySize,
|
|
109
|
+
guestName: guest.name,
|
|
110
|
+
guestEmail: guest.email,
|
|
111
|
+
guestPhone: guest.phone,
|
|
112
|
+
note: rng() < 0.3 ? pick(rng, NOTES) : "",
|
|
113
|
+
status,
|
|
114
|
+
depositCents: diningDepositCents(r, s.area, partySize),
|
|
115
|
+
createdAt: new Date(Date.UTC(2027, 0, 2 + int(rng, 0, 80), int(rng, 7, 21), int(rng, 0, 59))).toISOString(),
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
/** A seating day and time in the busy span, or null on the restaurant's closed day. */
|
|
119
|
+
const when = (s) => {
|
|
120
|
+
const date = addDays(BUSY_FROM, int(rng, 0, BUSY_DAYS - 1));
|
|
121
|
+
const times = diningSeatingTimes(restaurantOf.get(s.restaurantCode), date);
|
|
122
|
+
return times.length ? { date, time: pick(rng, times) } : null;
|
|
123
|
+
};
|
|
124
|
+
for (let i = 0; i < DINING_SIZES.reservations; i++) {
|
|
125
|
+
const s = pick(rng, seating);
|
|
126
|
+
const at = when(s);
|
|
127
|
+
const status = rng() < 0.1 ? "cancelled" : "confirmed";
|
|
128
|
+
if (!at || (status === "confirmed" && diningTablesLeft(s, reservations, at.date, at.time) < 1))
|
|
129
|
+
continue;
|
|
130
|
+
reserve(s, at.date, at.time, status);
|
|
131
|
+
}
|
|
132
|
+
// Fully booked on purpose: every table of the area taken at one time, by seatings up to half an hour either side of it.
|
|
133
|
+
for (let i = 0; i < DINING_SIZES.fullBlocks; i++) {
|
|
134
|
+
const s = pick(rng, seating);
|
|
135
|
+
const at = when(s);
|
|
136
|
+
if (!at)
|
|
137
|
+
continue;
|
|
138
|
+
const times = diningSeatingTimes(restaurantOf.get(s.restaurantCode), at.date);
|
|
139
|
+
while (diningTablesLeft(s, reservations, at.date, at.time) > 0) {
|
|
140
|
+
const near = diningClock(diningMinutes(at.time) + pick(rng, [-30, 0, 0, 30]));
|
|
141
|
+
reserve(s, at.date, times.includes(near) && diningTablesLeft(s, reservations, at.date, near) > 0 ? near : at.time, "confirmed");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return { restaurants, seating, reservations };
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/sites/dining/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAY,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MA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dining/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type DiningArea, type DiningDayHours, type DiningReservation, type DiningRestaurant, type DiningRows, type DiningSeating, type DiningWeekday } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The reservation site's rules, as pure functions over rows. apps/dining
|
|
4
|
+
* enforces them on every write and answers every search with them, and the
|
|
5
|
+
* intent corpus derives its answer keys from them, so the site and the keys
|
|
6
|
+
* cannot disagree about what is free or what a deposit is.
|
|
7
|
+
*/
|
|
8
|
+
/** The dates the site takes reservations for. Fixed, not "from today", so a seed means the same evenings forever. */
|
|
9
|
+
export declare const DINING_WINDOW: {
|
|
10
|
+
readonly first: "2027-01-01";
|
|
11
|
+
readonly last: "2027-12-31";
|
|
12
|
+
};
|
|
13
|
+
/** How long a reservation holds its table. */
|
|
14
|
+
export declare const DINING_HOLD_MINUTES = 120;
|
|
15
|
+
/** Seating times are on the hour and the half hour. */
|
|
16
|
+
export declare const DINING_SLOT_MINUTES = 30;
|
|
17
|
+
/** Larger parties are not booked online. */
|
|
18
|
+
export declare const DINING_MAX_PARTY = 12;
|
|
19
|
+
export type DiningProblem = {
|
|
20
|
+
code: string;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
/** What a reservation asks for: one table in one area, for a party, from a seating time. */
|
|
24
|
+
export type DiningRequest = {
|
|
25
|
+
date: string;
|
|
26
|
+
time: string;
|
|
27
|
+
partySize: number;
|
|
28
|
+
area: DiningArea;
|
|
29
|
+
};
|
|
30
|
+
export type DiningQuery = {
|
|
31
|
+
city: string;
|
|
32
|
+
date: string;
|
|
33
|
+
time: string;
|
|
34
|
+
partySize: number;
|
|
35
|
+
area?: DiningArea;
|
|
36
|
+
cuisine?: string;
|
|
37
|
+
/** Dietary menus the restaurant must offer, every one of them. */
|
|
38
|
+
menus?: readonly string[];
|
|
39
|
+
maxPriceLevel?: number;
|
|
40
|
+
};
|
|
41
|
+
/** One area of one restaurant with a table free for the party for the two hours from the asked time. */
|
|
42
|
+
export type DiningOffer = {
|
|
43
|
+
restaurantCode: string;
|
|
44
|
+
restaurantName: string;
|
|
45
|
+
cuisine: string;
|
|
46
|
+
priceLevel: number;
|
|
47
|
+
area: DiningArea;
|
|
48
|
+
seats: number;
|
|
49
|
+
tablesLeft: number;
|
|
50
|
+
depositCents: number;
|
|
51
|
+
};
|
|
52
|
+
export type DiningSlot = {
|
|
53
|
+
area: DiningArea;
|
|
54
|
+
time: string;
|
|
55
|
+
tablesLeft: number;
|
|
56
|
+
};
|
|
57
|
+
/** "HH:MM" with a real hour and minute (any minute; seating times are checked separately). */
|
|
58
|
+
export declare function diningIsTime(s: string): boolean;
|
|
59
|
+
export declare function diningMinutes(time: string): number;
|
|
60
|
+
export declare function diningClock(minutes: number): string;
|
|
61
|
+
export declare function diningAreaLabel(area: DiningArea): string;
|
|
62
|
+
export declare function diningWeekdayOf(date: string): DiningWeekday;
|
|
63
|
+
/** The latest seating of a day: the table is held two hours, and the meal ends by closing time. */
|
|
64
|
+
export declare function diningLastSeating(h: DiningDayHours): string;
|
|
65
|
+
/** Every seating time on a date: each half hour from opening to the last seating. None on the closed day. */
|
|
66
|
+
export declare function diningSeatingTimes(r: DiningRestaurant, date: string): string[];
|
|
67
|
+
/**
|
|
68
|
+
* Tables of the area still free for the WHOLE two hours from `time` on `date`:
|
|
69
|
+
* the area's tables less the most reservations holding one at any half hour of
|
|
70
|
+
* that span. Cancelled reservations hold nothing; `exceptNo` leaves one
|
|
71
|
+
* reservation out (a change is checked against the others).
|
|
72
|
+
*/
|
|
73
|
+
export declare function diningTablesLeft(seating: DiningSeating, reservations: readonly DiningReservation[], date: string, time: string, exceptNo?: string): number;
|
|
74
|
+
/** Deposit taken when the reservation is made: per guest, plus the private-room fee for the private room. */
|
|
75
|
+
export declare function diningDepositCents(r: DiningRestaurant, area: DiningArea, partySize: number): number;
|
|
76
|
+
/** Why the restaurant cannot seat the request at all, before availability: date, time, party, opening hours, area, table size. */
|
|
77
|
+
export declare function diningFitProblem(r: DiningRestaurant, seating: DiningSeating | undefined, q: DiningRequest): DiningProblem | null;
|
|
78
|
+
/** diningFitProblem, then whether a table of the area is free for the two hours. The rule every reservation write is held to. */
|
|
79
|
+
export declare function diningReservationProblem(r: DiningRestaurant, seating: DiningSeating | undefined, q: DiningRequest, reservations: readonly DiningReservation[], exceptNo?: string): DiningProblem | null;
|
|
80
|
+
/**
|
|
81
|
+
* Every area of every restaurant in the city — of the cuisine, offering every
|
|
82
|
+
* asked menu, at no more than the price level — with a table that seats the
|
|
83
|
+
* party and is free for the two hours from the asked time. Restaurant code
|
|
84
|
+
* order, then area order.
|
|
85
|
+
*/
|
|
86
|
+
export declare function diningSearch(rows: DiningRows, q: DiningQuery): DiningOffer[];
|
|
87
|
+
/**
|
|
88
|
+
* One restaurant's day for a party: for each area whose tables seat it, every
|
|
89
|
+
* seating time and how many of its tables are free for the two hours from it
|
|
90
|
+
* (0 when full). Empty on the closed day or a date the site does not take.
|
|
91
|
+
*/
|
|
92
|
+
export declare function diningAvailability(r: DiningRestaurant, rows: Pick<DiningRows, "seating" | "reservations">, date: string, partySize: number): DiningSlot[];
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { isDate } from "../../stays.js";
|
|
2
|
+
import { DINING_AREAS, DINING_WEEKDAYS } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The reservation site's rules, as pure functions over rows. apps/dining
|
|
5
|
+
* enforces them on every write and answers every search with them, and the
|
|
6
|
+
* intent corpus derives its answer keys from them, so the site and the keys
|
|
7
|
+
* cannot disagree about what is free or what a deposit is.
|
|
8
|
+
*/
|
|
9
|
+
/** The dates the site takes reservations for. Fixed, not "from today", so a seed means the same evenings forever. */
|
|
10
|
+
export const DINING_WINDOW = { first: "2027-01-01", last: "2027-12-31" };
|
|
11
|
+
/** How long a reservation holds its table. */
|
|
12
|
+
export const DINING_HOLD_MINUTES = 120;
|
|
13
|
+
/** Seating times are on the hour and the half hour. */
|
|
14
|
+
export const DINING_SLOT_MINUTES = 30;
|
|
15
|
+
/** Larger parties are not booked online. */
|
|
16
|
+
export const DINING_MAX_PARTY = 12;
|
|
17
|
+
const TIME = /^([01]\d|2[0-3]):([0-5]\d)$/;
|
|
18
|
+
const AREA_LABEL = { indoor: "indoor", terrace: "terrace", bar: "bar", private: "private room" };
|
|
19
|
+
/** "HH:MM" with a real hour and minute (any minute; seating times are checked separately). */
|
|
20
|
+
export function diningIsTime(s) {
|
|
21
|
+
return TIME.test(s);
|
|
22
|
+
}
|
|
23
|
+
export function diningMinutes(time) {
|
|
24
|
+
const [h, m] = time.split(":").map(Number);
|
|
25
|
+
return (h ?? 0) * 60 + (m ?? 0);
|
|
26
|
+
}
|
|
27
|
+
export function diningClock(minutes) {
|
|
28
|
+
return `${String(Math.floor(minutes / 60)).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}`;
|
|
29
|
+
}
|
|
30
|
+
export function diningAreaLabel(area) {
|
|
31
|
+
return AREA_LABEL[area];
|
|
32
|
+
}
|
|
33
|
+
export function diningWeekdayOf(date) {
|
|
34
|
+
const sundayFirst = new Date(`${date}T00:00:00Z`).getUTCDay();
|
|
35
|
+
return DINING_WEEKDAYS[(sundayFirst + 6) % 7];
|
|
36
|
+
}
|
|
37
|
+
/** The latest seating of a day: the table is held two hours, and the meal ends by closing time. */
|
|
38
|
+
export function diningLastSeating(h) {
|
|
39
|
+
return diningClock(diningMinutes(h.closes) - DINING_HOLD_MINUTES);
|
|
40
|
+
}
|
|
41
|
+
/** Every seating time on a date: each half hour from opening to the last seating. None on the closed day. */
|
|
42
|
+
export function diningSeatingTimes(r, date) {
|
|
43
|
+
if (!isDate(date))
|
|
44
|
+
return [];
|
|
45
|
+
const h = r.hours[diningWeekdayOf(date)];
|
|
46
|
+
if (!h)
|
|
47
|
+
return [];
|
|
48
|
+
const out = [];
|
|
49
|
+
for (let m = diningMinutes(h.opens); m <= diningMinutes(h.closes) - DINING_HOLD_MINUTES; m += DINING_SLOT_MINUTES)
|
|
50
|
+
out.push(diningClock(m));
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Tables of the area still free for the WHOLE two hours from `time` on `date`:
|
|
55
|
+
* the area's tables less the most reservations holding one at any half hour of
|
|
56
|
+
* that span. Cancelled reservations hold nothing; `exceptNo` leaves one
|
|
57
|
+
* reservation out (a change is checked against the others).
|
|
58
|
+
*/
|
|
59
|
+
export function diningTablesLeft(seating, reservations, date, time, exceptNo) {
|
|
60
|
+
const held = reservations.filter((r) => r.restaurantCode === seating.restaurantCode && r.area === seating.area && r.date === date && r.status === "confirmed" && r.reservationNo !== exceptNo);
|
|
61
|
+
const start = diningMinutes(time);
|
|
62
|
+
let least = seating.tables;
|
|
63
|
+
for (let at = start; at < start + DINING_HOLD_MINUTES; at += DINING_SLOT_MINUTES) {
|
|
64
|
+
const taken = held.filter((r) => diningMinutes(r.time) <= at && at < diningMinutes(r.time) + DINING_HOLD_MINUTES).length;
|
|
65
|
+
least = Math.min(least, seating.tables - taken);
|
|
66
|
+
}
|
|
67
|
+
return Math.max(0, least);
|
|
68
|
+
}
|
|
69
|
+
/** Deposit taken when the reservation is made: per guest, plus the private-room fee for the private room. */
|
|
70
|
+
export function diningDepositCents(r, area, partySize) {
|
|
71
|
+
return partySize * r.depositPerGuestCents + (area === "private" ? (r.privateRoomFeeCents ?? 0) : 0);
|
|
72
|
+
}
|
|
73
|
+
const day = (d) => `${d[0].toUpperCase()}${d.slice(1)}s`;
|
|
74
|
+
/** Why the restaurant cannot seat the request at all, before availability: date, time, party, opening hours, area, table size. */
|
|
75
|
+
export function diningFitProblem(r, seating, q) {
|
|
76
|
+
if (!isDate(q.date))
|
|
77
|
+
return { code: "BAD_DATE", message: `${q.date} is not a date (YYYY-MM-DD)` };
|
|
78
|
+
if (q.date < DINING_WINDOW.first || q.date > DINING_WINDOW.last)
|
|
79
|
+
return { code: "OUTSIDE_WINDOW", message: `reservations are taken for dates from ${DINING_WINDOW.first} to ${DINING_WINDOW.last}` };
|
|
80
|
+
if (!diningIsTime(q.time) || diningMinutes(q.time) % DINING_SLOT_MINUTES !== 0)
|
|
81
|
+
return { code: "BAD_TIME", message: `seating times are on the hour or the half hour (HH:00 or HH:30), not ${q.time}` };
|
|
82
|
+
if (!Number.isInteger(q.partySize) || q.partySize < 1)
|
|
83
|
+
return { code: "BAD_PARTY", message: "a reservation is for at least one guest" };
|
|
84
|
+
if (q.partySize > DINING_MAX_PARTY)
|
|
85
|
+
return { code: "PARTY_LIMIT", message: `parties of more than ${DINING_MAX_PARTY} are not booked online` };
|
|
86
|
+
const weekday = diningWeekdayOf(q.date);
|
|
87
|
+
const h = r.hours[weekday];
|
|
88
|
+
if (!h)
|
|
89
|
+
return { code: "CLOSED", message: `${r.name} is closed on ${day(weekday)}` };
|
|
90
|
+
if (diningMinutes(q.time) < diningMinutes(h.opens) || diningMinutes(q.time) > diningMinutes(h.closes) - DINING_HOLD_MINUTES) {
|
|
91
|
+
return { code: "OUTSIDE_HOURS", message: `${r.name} seats guests from ${h.opens} to ${diningLastSeating(h)} on ${day(weekday)}: it closes at ${h.closes} and a table is held for 2 hours` };
|
|
92
|
+
}
|
|
93
|
+
if (!seating)
|
|
94
|
+
return { code: "NO_AREA", message: `${r.name} has no ${AREA_LABEL[q.area]} seating` };
|
|
95
|
+
if (q.partySize > seating.seats)
|
|
96
|
+
return { code: "TABLE_TOO_SMALL", message: `the ${AREA_LABEL[q.area]} tables at ${r.name} seat at most ${seating.seats}` };
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
/** diningFitProblem, then whether a table of the area is free for the two hours. The rule every reservation write is held to. */
|
|
100
|
+
export function diningReservationProblem(r, seating, q, reservations, exceptNo) {
|
|
101
|
+
const fit = diningFitProblem(r, seating, q);
|
|
102
|
+
if (fit)
|
|
103
|
+
return fit;
|
|
104
|
+
if (diningTablesLeft(seating, reservations, q.date, q.time, exceptNo) < 1) {
|
|
105
|
+
return { code: "FULL", message: `no ${AREA_LABEL[q.area]} table is free at ${r.name} on ${q.date} for 2 hours from ${q.time}` };
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const areaOrder = (a) => DINING_AREAS.indexOf(a);
|
|
110
|
+
const seatingOf = (rows, code) => rows.seating.filter((s) => s.restaurantCode === code).sort((x, y) => areaOrder(x.area) - areaOrder(y.area));
|
|
111
|
+
/**
|
|
112
|
+
* Every area of every restaurant in the city — of the cuisine, offering every
|
|
113
|
+
* asked menu, at no more than the price level — with a table that seats the
|
|
114
|
+
* party and is free for the two hours from the asked time. Restaurant code
|
|
115
|
+
* order, then area order.
|
|
116
|
+
*/
|
|
117
|
+
export function diningSearch(rows, q) {
|
|
118
|
+
const city = q.city.trim().toLowerCase();
|
|
119
|
+
const cuisine = q.cuisine?.trim().toLowerCase();
|
|
120
|
+
const menus = (q.menus ?? []).map((m) => m.trim().toLowerCase()).filter(Boolean);
|
|
121
|
+
const offers = [];
|
|
122
|
+
for (const r of [...rows.restaurants].sort((x, y) => x.code.localeCompare(y.code))) {
|
|
123
|
+
if (r.city.toLowerCase() !== city || (cuisine && r.cuisine !== cuisine))
|
|
124
|
+
continue;
|
|
125
|
+
if (!menus.every((m) => r.menus.includes(m)) || (q.maxPriceLevel !== undefined && r.priceLevel > q.maxPriceLevel))
|
|
126
|
+
continue;
|
|
127
|
+
for (const s of seatingOf(rows, r.code)) {
|
|
128
|
+
if (q.area && s.area !== q.area)
|
|
129
|
+
continue;
|
|
130
|
+
if (diningFitProblem(r, s, { date: q.date, time: q.time, partySize: q.partySize, area: s.area }))
|
|
131
|
+
continue;
|
|
132
|
+
const left = diningTablesLeft(s, rows.reservations, q.date, q.time);
|
|
133
|
+
if (left < 1)
|
|
134
|
+
continue;
|
|
135
|
+
offers.push({ restaurantCode: r.code, restaurantName: r.name, cuisine: r.cuisine, priceLevel: r.priceLevel, area: s.area, seats: s.seats, tablesLeft: left, depositCents: diningDepositCents(r, s.area, q.partySize) });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return offers;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* One restaurant's day for a party: for each area whose tables seat it, every
|
|
142
|
+
* seating time and how many of its tables are free for the two hours from it
|
|
143
|
+
* (0 when full). Empty on the closed day or a date the site does not take.
|
|
144
|
+
*/
|
|
145
|
+
export function diningAvailability(r, rows, date, partySize) {
|
|
146
|
+
const slots = [];
|
|
147
|
+
for (const s of seatingOf(rows, r.code)) {
|
|
148
|
+
for (const time of diningSeatingTimes(r, date)) {
|
|
149
|
+
if (diningFitProblem(r, s, { date, time, partySize, area: s.area }))
|
|
150
|
+
continue;
|
|
151
|
+
slots.push({ area: s.area, time, tablesLeft: diningTablesLeft(s, rows.reservations, date, time) });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return slots;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../src/sites/dining/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAgJ,MAAM,YAAY,CAAC;AAEzM;;;;;GAKG;AAEH,qHAAqH;AACrH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAW,CAAC;AAClF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,uDAAuD;AACvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,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