@final-commerce/common 2.11.1 → 2.12.0-staging.2

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/README.md CHANGED
@@ -219,26 +219,6 @@ node -p "const c = require('@final-commerce/common'); c.formatCurrency(2500, 'EU
219
219
  # → €25.00
220
220
  ```
221
221
 
222
- ## Quality gates
223
-
224
- ### `gate-done` time budgets
225
-
226
- `gate-done` (the pre-push hook) runs four sweeps: npm audit, gitleaks, Vitest with coverage, and a bundle-size or build check. It gives them two separate time budgets, both set in milliseconds through environment variables:
227
-
228
- | Variable | Default | Covers |
229
- | -------------------------- | -------- | ---------------------------------------- |
230
- | `GATE_DONE_BUDGET_MS` | `90000` | npm audit, gitleaks and the bundle sweep |
231
- | `GATE_DONE_TEST_BUDGET_MS` | `300000` | the Vitest sweep on its own |
232
-
233
- A budget only counts time spent in its own sweeps, so a slow test suite never takes time from the other sweeps, and the other sweeps never take time from the tests. Husky's pre-push hook inherits your shell environment, so you can raise a budget for one push or for good:
234
-
235
- ```bash
236
- GATE_DONE_TEST_BUDGET_MS=600000 git push # one push
237
- export GATE_DONE_TEST_BUDGET_MS=600000 # in ~/.zshrc, for every push
238
- ```
239
-
240
- If a sweep runs past its budget, `gate-done` kills it and blocks the push with a timeout message (`Vitest killed after 300.0s by the test budget … not a test failure`), not as a test or audit failure. Values that are not positive integers are ignored with a warning, and the default applies.
241
-
242
222
  ## License
243
223
 
244
224
  Private — Final Commerce internal use only.
package/bin/gate-done.mjs CHANGED
@@ -2,80 +2,59 @@
2
2
  /**
3
3
  * gate-done — pre-push hook.
4
4
  *
5
- * Runs four sweeps under two time budgets:
5
+ * Runs four sweeps inside a 90-second wall-clock budget:
6
6
  *
7
7
  * 1. npm audit — known CVE check against the installed dependency tree (warn only)
8
8
  * 2. gitleaks — credential / secret scanning (git log + staged)
9
9
  * 3. vitest — full test suite with coverage threshold enforcement
10
10
  * 4. bundle — size-limit or custom bundle-size script (if configured)
11
11
  *
12
- * Budgets (milliseconds, read from the environment — Husky's pre-push inherits the shell):
13
- *
14
- * GATE_DONE_BUDGET_MS default 90000 shared by sweeps 1, 2 and 4
15
- * GATE_DONE_TEST_BUDGET_MS default 300000 sweep 3 (Vitest) on its own
16
- *
17
- * A budget only drains while its own sweeps run, so a slow test suite cannot
18
- * starve the bundle sweep and vice versa.
19
- *
20
12
  * Any sweep failure except npm audit exits 1, blocking the push.
21
- * A sweep killed by its budget also exits 1, but is reported as a timeout,
22
- * not as a failure of the thing it was checking.
13
+ * Budget overrun also exits 1.
23
14
  *
24
15
  * Install as Husky pre-push hook:
25
16
  * echo "npx gate-done" > .husky/pre-push
26
17
  */
27
18
 
19
+ import { spawnSync } from 'node:child_process';
28
20
  import { readFileSync } from 'node:fs';
29
21
  import { resolve } from 'node:path';
30
22
 
31
- import {
32
- DEFAULT_BUDGET_MS,
33
- DEFAULT_TEST_BUDGET_MS,
34
- budgetKillMessage,
35
- createBudget,
36
- readBudgetMs,
37
- runInBudget,
38
- } from './lib/budget.mjs';
39
-
23
+ const BUDGET_MS = 90_000;
40
24
  const t0 = Date.now();
41
25
 
42
26
  // ── helpers ──────────────────────────────────────────────────────────────────
43
27
 
44
- function elapsed() {
45
- return ((Date.now() - t0) / 1000).toFixed(1);
28
+ function remaining() {
29
+ return Math.max(0, BUDGET_MS - (Date.now() - t0));
46
30
  }
47
31
 
48
- function makeBudget(name, envVar, fallback) {
49
- const { ms, invalid } = readBudgetMs(process.env, envVar, fallback);
50
- if (invalid !== undefined) {
51
- warn(`${envVar}="${invalid}" is not a positive integer of milliseconds — using ${fallback}.`);
52
- }
53
- return createBudget(name, envVar, ms);
32
+ function elapsed() {
33
+ return ((Date.now() - t0) / 1000).toFixed(1);
54
34
  }
55
35
 
56
- function checkBudget(budget, label) {
57
- if (budget.exhausted()) {
58
- fail(
59
- `${budget.name} budget (${budget.envVar}=${budget.ms}) exhausted before "${label}" could start. ` +
60
- `Push blocked — not a ${label} failure.`,
61
- );
36
+ function checkBudget(label) {
37
+ if (remaining() <= 0) {
38
+ fail(`90s budget exhausted before "${label}" could complete. Push blocked.`);
62
39
  }
63
40
  }
64
41
 
65
42
  /**
66
- * Run a command, streaming output, charged to `budget`. The budget's remaining
67
- * time is the child's timeout, so a runaway child cannot overrun it. A child
68
- * killed by that timeout blocks the push with a timeout message instead of
69
- * being reported as a failure of the sweep.
43
+ * Run a command, streaming output. Returns the spawnSync result.
44
+ * Passes remaining budget as the process timeout so a runaway child
45
+ * cannot exceed the wall-clock limit on its own.
70
46
  */
71
- function run(budget, label, cmd) {
72
- const result = runInBudget(budget, cmd, { stdio: 'inherit' });
73
- if (result.timedOut) fail(budgetKillMessage(label, budget, result.durationMs) + ' Push blocked.');
74
- return result;
47
+ function run(cmd) {
48
+ return spawnSync(cmd, {
49
+ shell: true,
50
+ encoding: 'utf8',
51
+ stdio: 'inherit',
52
+ timeout: remaining(),
53
+ });
75
54
  }
76
55
 
77
- function capture(budget, cmd) {
78
- return runInBudget(budget, cmd);
56
+ function capture(cmd) {
57
+ return spawnSync(cmd, { shell: true, encoding: 'utf8', timeout: remaining() });
79
58
  }
80
59
 
81
60
  function fail(msg) {
@@ -95,22 +74,12 @@ function ok(msg) {
95
74
  process.stdout.write(`\x1b[32m✔ [${elapsed()}s] ${msg}\x1b[0m\n`);
96
75
  }
97
76
 
98
- // ── budgets ──────────────────────────────────────────────────────────────────
99
-
100
- const sweepBudget = makeBudget('sweep', 'GATE_DONE_BUDGET_MS', DEFAULT_BUDGET_MS);
101
- const testBudget = makeBudget('test', 'GATE_DONE_TEST_BUDGET_MS', DEFAULT_TEST_BUDGET_MS);
102
-
103
- info(
104
- `Budgets: sweeps ${sweepBudget.ms / 1000}s (GATE_DONE_BUDGET_MS), ` +
105
- `tests ${testBudget.ms / 1000}s (GATE_DONE_TEST_BUDGET_MS).`,
106
- );
107
-
108
77
  // ── 1. npm audit ─────────────────────────────────────────────────────────────
109
78
 
110
79
  info('Sweep 1/4 — npm audit (known CVEs)…');
111
- checkBudget(sweepBudget, 'npm audit');
80
+ checkBudget('npm audit');
112
81
 
113
- const auditResult = run(sweepBudget, 'npm audit', 'npm audit --audit-level=high');
82
+ const auditResult = run('npm audit --audit-level=high');
114
83
  if (auditResult.status !== 0) {
115
84
  warn('npm audit found high or critical vulnerabilities. Run `npm audit` for details.');
116
85
  } else {
@@ -120,9 +89,9 @@ if (auditResult.status !== 0) {
120
89
  // ── 2. gitleaks ───────────────────────────────────────────────────────────────
121
90
 
122
91
  info('Sweep 2/4 — gitleaks secrets scan…');
123
- checkBudget(sweepBudget, 'gitleaks');
92
+ checkBudget('gitleaks');
124
93
 
125
- const hasGitleaks = capture(sweepBudget, 'command -v gitleaks 2>/dev/null').status === 0;
94
+ const hasGitleaks = capture('command -v gitleaks 2>/dev/null').status === 0;
126
95
 
127
96
  if (!hasGitleaks) {
128
97
  warn(
@@ -132,7 +101,7 @@ if (!hasGitleaks) {
132
101
  } else {
133
102
  // Scan the full git history visible from HEAD — correct mode for a pre-push hook.
134
103
  // --no-git-serial scans refs in parallel for speed within the budget.
135
- const glResult = run(sweepBudget, 'gitleaks', 'gitleaks git --exit-code 1 .');
104
+ const glResult = run('gitleaks git --exit-code 1 .');
136
105
  if (glResult.status !== 0) {
137
106
  fail('gitleaks detected a potential secret. Remove it and retry the push.');
138
107
  }
@@ -142,9 +111,9 @@ if (!hasGitleaks) {
142
111
  // ── 3. vitest coverage ────────────────────────────────────────────────────────
143
112
 
144
113
  info('Sweep 3/4 — Vitest test suite + coverage thresholds…');
145
- checkBudget(testBudget, 'Vitest');
114
+ checkBudget('vitest');
146
115
 
147
- const vitestResult = run(testBudget, 'Vitest', 'npx vitest run --coverage');
116
+ const vitestResult = run('npx vitest run --coverage');
148
117
 
149
118
  if (vitestResult.status !== 0) {
150
119
  fail('Vitest coverage gate failed — fix failing tests or low-coverage areas before pushing.');
@@ -155,7 +124,7 @@ ok('Vitest: all tests passed, coverage thresholds met.');
155
124
  // ── 4. bundle size ────────────────────────────────────────────────────────────
156
125
 
157
126
  info('Sweep 4/4 — bundle size audit…');
158
- checkBudget(sweepBudget, 'bundle audit');
127
+ checkBudget('bundle audit');
159
128
 
160
129
  const pkgPath = resolve(process.cwd(), 'package.json');
161
130
  const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
@@ -166,21 +135,21 @@ const hasBundlesize = Boolean(pkg.devDependencies?.['bundlesize']) || Boolean(pk
166
135
  const hasBuildScript = Boolean(pkg.scripts?.build);
167
136
 
168
137
  if (hasBundleSizeScript) {
169
- const result = run(sweepBudget, 'bundle-size', 'npm run bundle-size');
138
+ const result = run('npm run bundle-size');
170
139
  if (result.status !== 0) fail('bundle-size script reported a violation. Push blocked.');
171
140
  ok('Bundle size: within limits.');
172
141
  } else if (hasSizeLimit) {
173
- const result = run(sweepBudget, 'size-limit', 'npx size-limit');
142
+ const result = run('npx size-limit');
174
143
  if (result.status !== 0) fail('size-limit reported a violation. Push blocked.');
175
144
  ok('Bundle size: size-limit passed.');
176
145
  } else if (hasBundlesize) {
177
- const result = run(sweepBudget, 'bundlesize', 'npx bundlesize');
146
+ const result = run('npx bundlesize');
178
147
  if (result.status !== 0) fail('bundlesize reported a violation. Push blocked.');
179
148
  ok('Bundle size: bundlesize passed.');
180
149
  } else if (hasBuildScript) {
181
150
  // No size tool configured — at minimum verify the build succeeds cleanly.
182
151
  info('No size-limit/bundlesize configured — running build as a smoke-check.');
183
- const result = run(sweepBudget, 'build', 'npm run build');
152
+ const result = run('npm run build');
184
153
  if (result.status !== 0) fail('Build failed during gate-done. Push blocked.');
185
154
  ok('Build: succeeded (no size budget configured).');
186
155
  } else {
@@ -189,9 +158,5 @@ if (hasBundleSizeScript) {
189
158
 
190
159
  // ── done ─────────────────────────────────────────────────────────────────────
191
160
 
192
- ok(
193
- `gate-done completed in ${elapsed()}s ` +
194
- `(sweeps ${(sweepBudget.spent() / 1000).toFixed(1)}/${sweepBudget.ms / 1000}s, ` +
195
- `tests ${(testBudget.spent() / 1000).toFixed(1)}/${testBudget.ms / 1000}s). Push proceeding.`,
196
- );
161
+ ok(`gate-done completed in ${elapsed()}s (budget: 90s). Push proceeding.`);
197
162
  process.exit(0);
package/dist/index.d.mts CHANGED
@@ -424,11 +424,25 @@ declare enum BookingType {
424
424
  }
425
425
  declare enum BookingRatePeriod {
426
426
  SLOT = "slot",
427
+ HOUR = "hour",
428
+ SESSION = "session",
427
429
  DAY = "day",
428
430
  NIGHT = "night",
429
431
  WEEK = "week",
430
432
  MONTH = "month"
431
433
  }
434
+ declare enum BookingDurationUnit {
435
+ MINUTE = "minute",
436
+ HOUR = "hour",
437
+ DAY = "day",
438
+ NIGHT = "night",
439
+ WEEK = "week",
440
+ MONTH = "month"
441
+ }
442
+ declare enum BookingSessionSale {
443
+ SESSION = "session",
444
+ COURSE = "course"
445
+ }
432
446
  declare enum BookingResourceKind {
433
447
  ASSET = "asset",
434
448
  ROOM = "room",
@@ -1642,22 +1656,51 @@ interface WeeklyHours {
1642
1656
  openMinute: number;
1643
1657
  closeMinute: number;
1644
1658
  }
1659
+ interface BookingDuration {
1660
+ count: number;
1661
+ unit: BookingDurationUnit | `${BookingDurationUnit}`;
1662
+ }
1663
+ interface BookingTimeSlots {
1664
+ length: BookingDuration;
1665
+ weeklyHours?: WeeklyHours[];
1666
+ }
1667
+ interface BookingDateRanges {
1668
+ weeklyHours?: WeeklyHours[];
1669
+ arrivalDays?: number[];
1670
+ checkInTime?: string | null;
1671
+ checkOutTime?: string | null;
1672
+ checkTimesByWeekday?: {
1673
+ weekday: number;
1674
+ checkInTime: string;
1675
+ checkOutTime: string;
1676
+ }[] | null;
1677
+ minStay?: BookingDuration;
1678
+ maxStay?: BookingDuration;
1679
+ }
1645
1680
  interface BookingRulesInput {
1646
1681
  ratePeriod: BookingRatePeriod | `${BookingRatePeriod}`;
1647
1682
  slot: {
1648
- lengthMinutes: number;
1683
+ lengthMinutes?: number;
1649
1684
  bufferMinutes?: number;
1650
1685
  minimumToRun?: number;
1651
1686
  minStay?: number;
1652
1687
  maxStay?: number;
1653
1688
  sharedAcrossProducts?: boolean;
1689
+ maxQtyPerBooking?: number;
1690
+ maxPartySize?: number;
1691
+ wholePeriods?: boolean;
1692
+ buffer?: BookingDuration;
1654
1693
  };
1655
1694
  window: {
1656
1695
  maxAdvanceDays?: number;
1696
+ maxAdvanceMinutes?: number;
1657
1697
  minNoticeMinutes?: number;
1658
1698
  holdMinutes?: number;
1659
1699
  bookableFrom?: Date | string | null;
1660
1700
  bookableTo?: Date | string | null;
1701
+ hold?: BookingDuration;
1702
+ minNotice?: BookingDuration;
1703
+ maxAdvance?: BookingDuration;
1661
1704
  };
1662
1705
  availability: {
1663
1706
  weeklyHours?: WeeklyHours[];
@@ -1668,8 +1711,29 @@ interface BookingRulesInput {
1668
1711
  arrivalDays?: number[];
1669
1712
  availableFrom?: Date | string | null;
1670
1713
  };
1714
+ sessions?: {
1715
+ sold: BookingSessionSale | `${BookingSessionSale}`;
1716
+ spots?: number;
1717
+ weekly?: {
1718
+ weekday: number;
1719
+ startMinute: number;
1720
+ endMinute: number;
1721
+ }[];
1722
+ dates?: {
1723
+ date: string;
1724
+ startMinute: number;
1725
+ endMinute: number;
1726
+ }[];
1727
+ } | null;
1728
+ checkTimesByWeekday?: {
1729
+ weekday: number;
1730
+ checkInTime: string;
1731
+ checkOutTime: string;
1732
+ }[] | null;
1671
1733
  checkInTime?: string | null;
1672
1734
  checkOutTime?: string | null;
1735
+ timeSlots?: BookingTimeSlots | null;
1736
+ dateRanges?: BookingDateRanges | null;
1673
1737
  }
1674
1738
  interface BusyWindow {
1675
1739
  startAt: Date;
@@ -1681,14 +1745,136 @@ interface GridSlot {
1681
1745
  bufferEndAt: Date;
1682
1746
  canStart: boolean;
1683
1747
  }
1748
+ declare const UNLIMITED_PLACES: number;
1684
1749
  declare class BookingRulesError extends Error {
1685
1750
  constructor(message: string);
1686
1751
  }
1687
1752
 
1688
1753
  declare function windowEndsAt(rule: BookingRulesInput, now: Date): Date | null;
1754
+ declare function windowEndsAtInZone(rule: BookingRulesInput, now: Date, timeZone: string | null): Date | null;
1755
+ declare function maxAdvanceMinutesOf(rule: Pick<BookingRulesInput, 'window'>): number;
1756
+ interface BookingRuleDurations {
1757
+ buffer?: BookingDuration;
1758
+ hold?: BookingDuration;
1759
+ minNotice?: BookingDuration;
1760
+ maxAdvance?: BookingDuration;
1761
+ }
1762
+ declare function ruleDurationsOf(rule: Pick<BookingRulesInput, 'slot' | 'window'>): BookingRuleDurations;
1763
+ declare function oldMaxAdvanceOf({ maxAdvanceMinutes, maxAdvanceDays, }: BookingRulesInput['window']): BookingDuration | undefined;
1764
+ declare function sessionCells(rule: BookingRulesInput, timeZone: string, from: Date, to: Date): GridSlot[];
1765
+ declare function calendarDate(value: string): [number, number, number];
1689
1766
  declare function buildGrid(rule: BookingRulesInput, timeZone: string, from: Date, to: Date, now: Date, busy?: BusyWindow[]): GridSlot[];
1690
1767
  declare function slotsForWindow(grid: GridSlot[], startAt: Date, endAt: Date): GridSlot[];
1691
1768
 
1769
+ type BookingDurationField = 'timeSlots.length' | 'slot.buffer' | 'window.hold' | 'window.minNotice' | 'window.maxAdvance' | 'dateRanges.minStay' | 'dateRanges.maxStay';
1770
+ type Units = readonly BookingDurationUnit[];
1771
+ declare function allowedDurationUnits(rule: Pick<BookingRulesInput, 'ratePeriod'>, field: BookingDurationField): Units;
1772
+ type BookingDurationProblemKind = 'count' | 'unit' | 'not-for-type' | 'min-above-max';
1773
+ interface BookingDurationProblem {
1774
+ field: BookingDurationField;
1775
+ kind: BookingDurationProblemKind;
1776
+ message: string;
1777
+ allowed?: readonly BookingDurationUnit[];
1778
+ min?: BookingDuration;
1779
+ max?: BookingDuration;
1780
+ }
1781
+ declare function durationProblems(rule: BookingRulesInput): BookingDurationProblem[];
1782
+ declare const shortestMinutesOf: ({ count, unit }: BookingDuration) => number;
1783
+ declare const longestMinutesOf: ({ count, unit }: BookingDuration) => number;
1784
+ declare const durationText: ({ count, unit }: BookingDuration) => string;
1785
+
1786
+ interface BookingRentalEnd {
1787
+ periods: number;
1788
+ endAt: string;
1789
+ lastDayKey: string;
1790
+ coveredSlots: {
1791
+ startAt: string;
1792
+ dayKey: string;
1793
+ }[];
1794
+ }
1795
+
1796
+ declare const DEFAULT_HOLD_MINUTES = 10;
1797
+ interface PlanWindowInput {
1798
+ rule: BookingRulesInput;
1799
+ timeZone: string;
1800
+ presence?: WeeklyHours[] | null;
1801
+ startAt: Date;
1802
+ endAt: Date;
1803
+ now: Date;
1804
+ busy?: BusyWindow[];
1805
+ }
1806
+ declare function planWindow({ rule, timeZone, presence, startAt, endAt, now, busy }: PlanWindowInput): {
1807
+ slots: GridSlot[];
1808
+ periods: number;
1809
+ endAt: Date;
1810
+ bufferEndAt: Date;
1811
+ };
1812
+ interface WindowForPeriodsInput {
1813
+ rule: BookingRulesInput;
1814
+ timeZone: string;
1815
+ startAt: Date;
1816
+ periods: number;
1817
+ now: Date;
1818
+ }
1819
+ declare function windowForPeriods({ rule, timeZone, startAt, periods, now }: WindowForPeriodsInput): {
1820
+ startAt: Date;
1821
+ endAt: Date;
1822
+ };
1823
+ interface RentalEndsInput {
1824
+ rule: BookingRulesInput;
1825
+ timeZone: string;
1826
+ startAt: Date;
1827
+ now: Date;
1828
+ untilDay: string;
1829
+ }
1830
+ declare function rentalEnds(input: RentalEndsInput): BookingRentalEnd[];
1831
+ interface PlanCourseInput {
1832
+ rule: BookingRulesInput;
1833
+ timeZone: string;
1834
+ presence?: WeeklyHours[] | null;
1835
+ now: Date;
1836
+ }
1837
+ declare function courseSessions(rule: BookingRulesInput, timeZone: string): GridSlot[];
1838
+ declare const courseStarted: (rule: BookingRulesInput, sessions: GridSlot[], now: Date) => boolean;
1839
+ declare function courseStartedInZone(rule: BookingRulesInput, sessions: GridSlot[], now: Date, timeZone: string): boolean;
1840
+ declare function planCourse({ rule, timeZone, presence, now }: PlanCourseInput): GridSlot[];
1841
+ declare function holdExpiresAt(rule: BookingRulesInput, now: Date): Date;
1842
+ declare function checkQtyPerBooking(rule: BookingRulesInput, qty: number): void;
1843
+ declare function checkPartySize(rule: BookingRulesInput, partySize: number): void;
1844
+ type BookingMethod = 'time-slots' | 'sessions' | 'date-ranges';
1845
+ declare function bookingMethodOf(rule: Pick<BookingRulesInput, 'ratePeriod'>): BookingMethod;
1846
+ declare const soldAsCourse: (rule: Pick<BookingRulesInput, "ratePeriod" | "sessions">) => boolean;
1847
+ declare function capacityOf(rule: Pick<BookingRulesInput, 'ratePeriod' | 'sessions'>, resource: {
1848
+ seats?: number | null;
1849
+ }): number;
1850
+ type BookingRuleParts = ({
1851
+ method: 'time-slots';
1852
+ } & Required<BookingTimeSlots>) | {
1853
+ method: 'sessions';
1854
+ sessions: NonNullable<BookingRulesInput['sessions']>;
1855
+ } | ({
1856
+ method: 'date-ranges';
1857
+ ratePeriod: BookingRulesInput['ratePeriod'];
1858
+ wholePeriods: boolean;
1859
+ } & BookingDateRanges);
1860
+ declare function bookingRuleParts(rule: BookingRulesInput): BookingRuleParts;
1861
+ interface BookingRuleNewFields {
1862
+ timeSlots?: Required<BookingTimeSlots>;
1863
+ dateRanges?: BookingDateRanges;
1864
+ 'slot.buffer'?: BookingDuration;
1865
+ 'window.hold': BookingDuration;
1866
+ 'window.minNotice'?: BookingDuration;
1867
+ 'window.maxAdvance'?: BookingDuration;
1868
+ }
1869
+ interface BookingRuleInNewShape {
1870
+ set: BookingRuleNewFields;
1871
+ unset: string[];
1872
+ problems: BookingDurationProblem[];
1873
+ notes: string[];
1874
+ changesBehaviour?: 'whole-periods';
1875
+ }
1876
+ declare function ruleInNewShape(rule: BookingRulesInput): BookingRuleInNewShape;
1877
+
1692
1878
  interface BookingOccupancy {
1693
1879
  resourceId: string;
1694
1880
  productId: string;
@@ -1709,11 +1895,13 @@ interface ResourceAvailability {
1709
1895
  capacity: number;
1710
1896
  booked: number;
1711
1897
  free: number;
1898
+ unlimited?: true;
1712
1899
  }
1713
1900
  interface AvailabilitySlot extends GridSlot {
1714
1901
  capacity: number;
1715
1902
  booked: number;
1716
1903
  free: number;
1904
+ unlimited?: true;
1717
1905
  resources: ResourceAvailability[];
1718
1906
  dayKey: string;
1719
1907
  }
@@ -1727,13 +1915,13 @@ interface ResourceInWindow {
1727
1915
  interface AvailabilityInput {
1728
1916
  productId: string;
1729
1917
  bookingRulesId?: string;
1730
- bookingType?: BookingType;
1731
1918
  rule: BookingRulesInput;
1732
1919
  resources: BookingResourceInput[];
1733
1920
  occupied: BookingOccupancy[];
1734
1921
  from: Date;
1735
1922
  to: Date;
1736
1923
  now: Date;
1924
+ timeZone?: string;
1737
1925
  }
1738
1926
  declare const withinPresence: (slot: GridSlot, timeZone: string, presence?: WeeklyHours[] | null) => boolean;
1739
1927
  declare function occupancyIn(occupied: BookingOccupancy[], productId: string, startAt: Date, bufferEndAt: Date, shared: boolean): {
@@ -1745,21 +1933,60 @@ declare function shopDayRange(fromDayKey: string, count: number, timeZone: strin
1745
1933
  from: Date;
1746
1934
  to: Date;
1747
1935
  };
1748
- declare function buildAvailability({ productId, bookingRulesId, bookingType, rule, resources, occupied, from, to, now, }: AvailabilityInput): {
1936
+ declare function buildAvailability({ productId, bookingRulesId, rule, resources, occupied, from, to, now, timeZone, }: AvailabilityInput): {
1937
+ course: ({
1938
+ sessions: number;
1939
+ alreadyStarted: boolean;
1940
+ sessionTimes: {
1941
+ startAt: Date;
1942
+ endAt: Date;
1943
+ }[];
1944
+ startAt: Date;
1945
+ endAt: Date;
1946
+ resources: ({
1947
+ resourceId: string;
1948
+ free: number;
1949
+ unlimited?: undefined;
1950
+ } | {
1951
+ resourceId: string;
1952
+ free: number;
1953
+ unlimited: true;
1954
+ })[];
1955
+ } & {
1956
+ maxQtyNow?: number;
1957
+ }) | undefined;
1749
1958
  resources: ResourceInWindow[];
1750
- slots: AvailabilitySlot[];
1959
+ slots: (AvailabilitySlot & {
1960
+ unlimited?: true;
1961
+ } & {
1962
+ maxQtyNow?: number;
1963
+ })[];
1751
1964
  timeZone: string;
1752
1965
  days: string[];
1753
1966
  productId: string;
1754
1967
  bookingRulesId: string | undefined;
1755
- bookingType: BookingType | undefined;
1756
- ratePeriod: "slot" | "day" | "night" | "week" | "month" | BookingRatePeriod;
1968
+ ratePeriod: "slot" | "hour" | "session" | "day" | "night" | "week" | "month" | BookingRatePeriod;
1969
+ bookingMethod: BookingMethod;
1757
1970
  minimumToRun: number | undefined;
1758
1971
  minStay: number | undefined;
1759
1972
  maxStay: number | undefined;
1973
+ minStayLength: BookingDuration | undefined;
1974
+ maxStayLength: BookingDuration | undefined;
1975
+ maxQtyPerBooking: number | undefined;
1976
+ maxPartySize: number | undefined;
1760
1977
  bookableUntil: Date | null;
1761
1978
  beyondWindow: boolean;
1762
1979
  };
1980
+ declare function pickFreeResource<T extends {
1981
+ free: number;
1982
+ }>(slot: {
1983
+ resources: T[];
1984
+ }, qty?: number): T | undefined;
1985
+ declare function fewestFreeOver(slots: {
1986
+ startAt: Date;
1987
+ endAt: Date;
1988
+ resources: ResourceAvailability[];
1989
+ }[], from: Date, to: Date): ResourceAvailability[];
1763
1990
  interface ResourcePresenceRow {
1764
1991
  resourceId: string;
1765
1992
  outletId: string;
@@ -1772,23 +1999,6 @@ declare function presentAt<T extends {
1772
1999
  presence?: WeeklyHours[] | null;
1773
2000
  }[];
1774
2001
 
1775
- declare const DEFAULT_HOLD_MINUTES = 10;
1776
- interface PlanWindowInput {
1777
- rule: BookingRulesInput;
1778
- timeZone: string;
1779
- presence?: WeeklyHours[] | null;
1780
- startAt: Date;
1781
- endAt: Date;
1782
- now: Date;
1783
- busy?: BusyWindow[];
1784
- }
1785
- declare function planWindow({ rule, timeZone, presence, startAt, endAt, now, busy }: PlanWindowInput): {
1786
- slots: GridSlot[];
1787
- endAt: Date;
1788
- bufferEndAt: Date;
1789
- };
1790
- declare const holdExpiresAt: (rule: BookingRulesInput, now: Date) => Date;
1791
-
1792
2002
  interface ShippingPlace {
1793
2003
  country: string;
1794
2004
  province?: string | null;
@@ -1966,4 +2176,4 @@ declare const EXPENSE_DEFAULT_CATEGORIES: readonly [{
1966
2176
  }];
1967
2177
  type ExpenseDefaultCategoryKey = (typeof EXPENSE_DEFAULT_CATEGORIES)[number]['key'];
1968
2178
 
1969
- export { ADYEN_JOB_TITLE_ASSOCIATION_TYPES, ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES, ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES, ADYEN_ROLLOUT_COUNTRY_CODES, ADYEN_STORE_STATE_PROVINCE_COUNTRIES, ADYEN_TAX_NUMBER_FORMATS, ADYEN_TAX_NUMBER_MIN_LENGTH, AFFIRM_COUNTRY_CODES, AFFIRM_PRICE_PLANS, type AddressLike, type AdyenBnplSettings, type AdyenBnplSkippedStore, type AdyenBnplUpdateResult, type AffirmPricePlan, type Amount, type AssignUserChange, AttributeType, type AvailabilityInput, type AvailabilitySlot, type AvailableTransition, BNPL_METHOD_STATUS, BNPL_SKIP_REASON, type BnplMethodStatus, type BnplSkipReason, type BookingOccupancy, BookingRatePeriod, type BookingResourceInput, BookingResourceKind, BookingResourceStatus, BookingRulesError, type BookingRulesInput, BookingType, type BusyWindow, CANADA_PROVINCES, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, type CategoryModifierRow, type CategoryRow, CompanyType, type CompositeAvailabilityRows, type CompositeMakeable, type CompositeMakeableRow, type CompositePriceItem, type CompositePricePart, type CompositeReservationOrder, type CompositeShelf, type CompositeStockPart, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CountryOption, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_HOLD_MINUTES, DEFAULT_RESOLVED_CONFIG, DEFAULT_UNIT_ID, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, DualWriteStrategy, EUFixedRates, EUROPE, EVERYWHERE_KEY, EXPENSE_DEFAULT_CATEGORIES, EXPENSE_NAME_MAX_LENGTH, EXPENSE_PAYMENT_METHOD_PRESETS, type EndOfSessionReport, type ExpenseDefaultCategoryKey, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, type GridSlot, HttpMethod, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LegacyWriteStrategy, LibraryItemType, type LineStockMove, MAX_PRECISION, type Measurable, type MeasurementBase, type MeasurementUnit, type MeasurementUnitFamily, MenuProject, type ModifierChoiceRow, type ModifierRow, type ModifiersBreakdown, type ModifiersTuple, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, type NormalizedAddress, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForAssignedUsers, type OrderLikeForContext, type OrderLikeForInCart, type OrderLikeForLegacyInference, type OrderLineItem, type OrderMutationData, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderReservationForContext, type OrderStateEventPayload, type OrderStateWritable, type OrderStatusDefinition, type OrderStatusValidationError, type OrderWriteStrategy, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_CHANNELS, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, type PaymentChannel, PaymentMethod, PaymentProcessor, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, type PlanWindowInput, Platform, type PoolDrawing, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, ProcessorType, type ProductDiscountBucket, type ProductFeeBucket, ProductSalesChartStep, ProductSalesReportCompare, ProductStatus, ProductType, type Province, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ReservationStatus, ResidualPaymentMethod, ResidualStatus, type ResolveInputs, type ResolveShippingInput, type ResolveTemplateResult, type ResourceAvailability, ResourceAvailabilityState, type ResourceInWindow, type ResourcePresenceRow, SHIPPING_COUNTRIES, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, SYSTEM_FAMILIES, SYSTEM_FAMILY_IDS, SYSTEM_UNITS, SYSTEM_UNIT_IDS, SalesLineAction, SalesLineSourceArray, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementBuckets, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, ShippingChannel, ShippingNoOptionReason, type ShippingOptionRule, ShippingOptionType, type ShippingPlace, type ShippingPriceTier, type ShippingQuoteOption, ShippingRateType, type ShippingResolution, type ShippingTuple, ShippingZoneError, ShippingZoneKind, type ShippingZoneProblem, type ShippingZoneRule, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StockLine, type StockLineComponent, type StockReservationLink, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, type WeeklyHours, addAmounts, addressPlaceKeys, adyenLegalEntityRequiresStateOrProvince, adyenRequiresJobTitle, adyenStoreRequiresStateOrProvince, adyenSupportsTaxNumberAbsent, adyenTaxNumberFormat, amountToString, ancestorChain, applyAssignment, assertUnitSane, availableIn, baseFor, baseFulfillmentDefinitions, baseOf, basePaymentDefinitions, buildAvailability, buildGrid, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, cheapestCompositeItem, cheapestCompositePrice, compositeItemCost, compositeItemUnavailable, compositeMakeable, compositeModifierMismatches, compositeReservationMismatches, compositeVariantInStock, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, currentAssignees, deriveDisplayState, deriveFamilyCode, deriveUnitId, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, extendPrice, extendPriceFor, formatCurrency, formatInUnit, formatMinorUnitsToString, formatQuantity, fromBase, fromMinorUnits, generateMongoID, getAvailableTransitions, getCashAmountDue, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getGoodsPortion, getLineSubtotal, getMinorUnitMultiplier, getMinorUnits, getPaymentLegTotal, getPricingRegionFromCountry, getSettlementTotal, getTotalCollected, hasInCartFlag, hasSellableChoice, holdExpiresAt, inferStatesFromLegacyStatus, isAdyenRolloutCountry, isAffirmCountry, isAffirmPricePlan, isChoiceAvailableAtOutlet, isConditionOperator, isFulfillmentState, isInCart, isPaymentState, isSupportedCurrency, isSystemFamilyCode, isValidQuantity, isWhole, lineStockMoves, listCountries, listProvinces, listShippingCountries, mapToLegacyStatus, maxPrecisionFor, mergeFragment, modifiersSellable, multiplyAmount, normalizeAddress, normalizeCityKey, normalizeCountry, normalizeMongoIdString, normalizePostCode, normalizeProvince, occupancyIn, orderAssignments, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, placeKey, planWindow, poolDemand, poolOf, poolShortfall, poolStockAt, postCodeMatchesProvince, presentAt, priceForTotal, provincesForPostCode, removeFragment, resolveFamily, resolveModifiersForProduct, resolveShipping, resolveTemplate, resolveUnit, roundToPrecision, sameFamily, setOrderState, shipsToCountry, shopDayKey, shopDayRange, signReportForDisplay, slotsForWindow, stringifyMinorUnits, subtractAmounts, toBase, toMinorUnits, validateConfig, validateFragmentCompatibility, validateOrderStatuses, validateShippingZone, violatesFinancialInvariant, windowEndsAt, withinPresence };
2179
+ export { ADYEN_JOB_TITLE_ASSOCIATION_TYPES, ADYEN_LEGAL_ENTITY_STATE_PROVINCE_COUNTRIES, ADYEN_NO_TAX_NUMBER_ABSENT_COUNTRIES, ADYEN_ROLLOUT_COUNTRY_CODES, ADYEN_STORE_STATE_PROVINCE_COUNTRIES, ADYEN_TAX_NUMBER_FORMATS, ADYEN_TAX_NUMBER_MIN_LENGTH, AFFIRM_COUNTRY_CODES, AFFIRM_PRICE_PLANS, type AddressLike, type AdyenBnplSettings, type AdyenBnplSkippedStore, type AdyenBnplUpdateResult, type AffirmPricePlan, type Amount, type AssignUserChange, AttributeType, type AvailabilityInput, type AvailabilitySlot, type AvailableTransition, BNPL_METHOD_STATUS, BNPL_SKIP_REASON, type BnplMethodStatus, type BnplSkipReason, type BookingDateRanges, type BookingDuration, type BookingDurationField, type BookingDurationProblem, type BookingDurationProblemKind, BookingDurationUnit, type BookingMethod, type BookingOccupancy, BookingRatePeriod, type BookingResourceInput, BookingResourceKind, BookingResourceStatus, type BookingRuleDurations, type BookingRuleInNewShape, type BookingRuleNewFields, type BookingRuleParts, BookingRulesError, type BookingRulesInput, BookingSessionSale, type BookingTimeSlots, BookingType, type BusyWindow, CANADA_PROVINCES, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, type CategoryModifierRow, type CategoryRow, CompanyType, type CompositeAvailabilityRows, type CompositeMakeable, type CompositeMakeableRow, type CompositePriceItem, type CompositePricePart, type CompositeReservationOrder, type CompositeShelf, type CompositeStockPart, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CountryOption, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_HOLD_MINUTES, DEFAULT_RESOLVED_CONFIG, DEFAULT_UNIT_ID, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, DualWriteStrategy, EUFixedRates, EUROPE, EVERYWHERE_KEY, EXPENSE_DEFAULT_CATEGORIES, EXPENSE_NAME_MAX_LENGTH, EXPENSE_PAYMENT_METHOD_PRESETS, type EndOfSessionReport, type ExpenseDefaultCategoryKey, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, type GridSlot, HttpMethod, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LegacyWriteStrategy, LibraryItemType, type LineStockMove, MAX_PRECISION, type Measurable, type MeasurementBase, type MeasurementUnit, type MeasurementUnitFamily, MenuProject, type ModifierChoiceRow, type ModifierRow, type ModifiersBreakdown, type ModifiersTuple, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, type NormalizedAddress, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForAssignedUsers, type OrderLikeForContext, type OrderLikeForInCart, type OrderLikeForLegacyInference, type OrderLineItem, type OrderMutationData, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderReservationForContext, type OrderStateEventPayload, type OrderStateWritable, type OrderStatusDefinition, type OrderStatusValidationError, type OrderWriteStrategy, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_CHANNELS, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, type PaymentChannel, PaymentMethod, PaymentProcessor, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, type PlanCourseInput, type PlanWindowInput, Platform, type PoolDrawing, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, ProcessorType, type ProductDiscountBucket, type ProductFeeBucket, ProductSalesChartStep, ProductSalesReportCompare, ProductStatus, ProductType, type Province, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, type RentalEndsInput, ReservationStatus, ResidualPaymentMethod, ResidualStatus, type ResolveInputs, type ResolveShippingInput, type ResolveTemplateResult, type ResourceAvailability, ResourceAvailabilityState, type ResourceInWindow, type ResourcePresenceRow, SHIPPING_COUNTRIES, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, SYSTEM_FAMILIES, SYSTEM_FAMILY_IDS, SYSTEM_UNITS, SYSTEM_UNIT_IDS, SalesLineAction, SalesLineSourceArray, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementBuckets, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, ShippingChannel, ShippingNoOptionReason, type ShippingOptionRule, ShippingOptionType, type ShippingPlace, type ShippingPriceTier, type ShippingQuoteOption, ShippingRateType, type ShippingResolution, type ShippingTuple, ShippingZoneError, ShippingZoneKind, type ShippingZoneProblem, type ShippingZoneRule, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StockLine, type StockLineComponent, type StockReservationLink, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UNLIMITED_PLACES, UserTypes, type WeeklyHours, type WindowForPeriodsInput, addAmounts, addressPlaceKeys, adyenLegalEntityRequiresStateOrProvince, adyenRequiresJobTitle, adyenStoreRequiresStateOrProvince, adyenSupportsTaxNumberAbsent, adyenTaxNumberFormat, allowedDurationUnits, amountToString, ancestorChain, applyAssignment, assertUnitSane, availableIn, baseFor, baseFulfillmentDefinitions, baseOf, basePaymentDefinitions, bookingMethodOf, bookingRuleParts, buildAvailability, buildGrid, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, calendarDate, canTransition, capacityOf, cheapestCompositeItem, cheapestCompositePrice, checkPartySize, checkQtyPerBooking, compositeItemCost, compositeItemUnavailable, compositeMakeable, compositeModifierMismatches, compositeReservationMismatches, compositeVariantInStock, conditionSummary, convertFixedFeeToLocalCurrency, courseSessions, courseStarted, courseStartedInZone, createAmount, crossAxisRuleApplies, currentAssignees, deriveDisplayState, deriveFamilyCode, deriveUnitId, displayRuleMatchesPair, divideAmount, durationProblems, durationText, evaluateCondition, evaluateConditionSet, extendPrice, extendPriceFor, fewestFreeOver, formatCurrency, formatInUnit, formatMinorUnitsToString, formatQuantity, fromBase, fromMinorUnits, generateMongoID, getAvailableTransitions, getCashAmountDue, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getGoodsPortion, getLineSubtotal, getMinorUnitMultiplier, getMinorUnits, getPaymentLegTotal, getPricingRegionFromCountry, getSettlementTotal, getTotalCollected, hasInCartFlag, hasSellableChoice, holdExpiresAt, inferStatesFromLegacyStatus, isAdyenRolloutCountry, isAffirmCountry, isAffirmPricePlan, isChoiceAvailableAtOutlet, isConditionOperator, isFulfillmentState, isInCart, isPaymentState, isSupportedCurrency, isSystemFamilyCode, isValidQuantity, isWhole, lineStockMoves, listCountries, listProvinces, listShippingCountries, longestMinutesOf, mapToLegacyStatus, maxAdvanceMinutesOf, maxPrecisionFor, mergeFragment, modifiersSellable, multiplyAmount, normalizeAddress, normalizeCityKey, normalizeCountry, normalizeMongoIdString, normalizePostCode, normalizeProvince, occupancyIn, oldMaxAdvanceOf, orderAssignments, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, pickFreeResource, placeKey, planCourse, planWindow, poolDemand, poolOf, poolShortfall, poolStockAt, postCodeMatchesProvince, presentAt, priceForTotal, provincesForPostCode, removeFragment, rentalEnds, resolveFamily, resolveModifiersForProduct, resolveShipping, resolveTemplate, resolveUnit, roundToPrecision, ruleDurationsOf, ruleInNewShape, sameFamily, sessionCells, setOrderState, shipsToCountry, shopDayKey, shopDayRange, shortestMinutesOf, signReportForDisplay, slotsForWindow, soldAsCourse, stringifyMinorUnits, subtractAmounts, toBase, toMinorUnits, validateConfig, validateFragmentCompatibility, validateOrderStatuses, validateShippingZone, violatesFinancialInvariant, windowEndsAt, windowEndsAtInZone, windowForPeriods, withinPresence };