@ordinatio/scheduling 0.5.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 (prepared 2026-11-10)
4
+
5
+ - **Fix: the organization table now has the `settings` and `updatedAt` columns the cancellation policy needs.** `GET` and `PUT
6
+ /admin/policy` in `@ordinatio/scheduling-api` read and write `Organization.settings` and check `Organization.updatedAt`, but the
7
+ packaged schema had neither column, so both routes answered 500 on a database built from it. A new migration adds them
8
+ (`settings` starts as `{}` and `updatedAt` as the time of the migration for existing rows). **After upgrading, run
9
+ `prisma migrate deploy`** against your database before using those two routes.
10
+
11
+ ## 0.5.1 (2026-10-29)
12
+
13
+ - **Fix: a weekday with no opening hours is now closed once the calendar has any hours.** Before, a calendar with hours set only for some
14
+ weekdays still offered slots all day on the other weekdays. A calendar with no availability rules at all is still open around the
15
+ clock (nothing is configured yet), and a date override still opens a day. If you relied on an empty weekday being open, add hours for it.
16
+
3
17
  ## 0.5.0 (2026-10-29)
4
18
 
5
19
  - **Security fix: booking analytics and group-class lists no longer rely on the database handle being limited to one business.**
package/dist/index.js CHANGED
@@ -1591,7 +1591,8 @@ function computeAvailableSlots(ctx, query) {
1591
1591
  );
1592
1592
  let activeRules = dateOverride ? [dateOverride] : [...weeklyRules];
1593
1593
  if (activeRules.length === 0) {
1594
- if (partialBlockConflicts.length > 0) {
1594
+ const hasConfiguredHours = rules.some((r) => !r.isBlocked);
1595
+ if (hasConfiguredHours || partialBlockConflicts.length > 0) {
1595
1596
  return { date: dateStr, calendarId, slots: [], timezone: tz };
1596
1597
  }
1597
1598
  activeRules.push({
package/dist/index.mjs CHANGED
@@ -1416,7 +1416,8 @@ function computeAvailableSlots(ctx, query) {
1416
1416
  );
1417
1417
  let activeRules = dateOverride ? [dateOverride] : [...weeklyRules];
1418
1418
  if (activeRules.length === 0) {
1419
- if (partialBlockConflicts.length > 0) {
1419
+ const hasConfiguredHours = rules.some((r) => !r.isBlocked);
1420
+ if (hasConfiguredHours || partialBlockConflicts.length > 0) {
1420
1421
  return { date: dateStr, calendarId, slots: [], timezone: tz };
1421
1422
  }
1422
1423
  activeRules.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordinatio/scheduling",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "description": "Scheduling engine for appointment-based businesses. API-first, no iframes.",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,3 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Organization" ADD COLUMN "settings" JSONB NOT NULL DEFAULT '{}',
3
+ ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
@@ -19,7 +19,11 @@ datasource db {
19
19
  model Organization {
20
20
  id String @id @default(cuid())
21
21
  name String
22
+ // Organization-wide settings kept as one JSON object; the cancellation policy lives under "cancellationPolicy".
23
+ settings Json @default("{}")
22
24
  createdAt DateTime @default(now())
25
+ // Moves on every change, which the policy route uses to refuse a save made from an out-of-date read.
26
+ updatedAt DateTime @default(now()) @updatedAt
23
27
 
24
28
  appointmentTypes AppointmentType[]
25
29
  servicePackages ServicePackage[]