From 4d036a4e671b76833d0268ad269908c29a728763 Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:42:25 +0530 Subject: [PATCH 01/14] Update basic example with deterministic future date --- examples/basic_schedule.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/basic_schedule.py b/examples/basic_schedule.py index 489977a..56822d2 100644 --- a/examples/basic_schedule.py +++ b/examples/basic_schedule.py @@ -7,10 +7,10 @@ timezone="Asia/Kolkata", ) -slots = generator.generate( - "2026-09-21", - "2026-09-21", -) +slots = generator.generate("2026-10-05") + +assert slots +assert slots[0].start.hour == 9 -for slot in slots: +for slot in slots[:3]: print(slot.start, "->", slot.end) From 4edeb251112a5d1471d5645a46da09a21701ca93 Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:42:29 +0530 Subject: [PATCH 02/14] Make booking example deterministic and conflict-aware --- examples/booking.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/booking.py b/examples/booking.py index 386be46..623cc0d 100644 --- a/examples/booking.py +++ b/examples/booking.py @@ -1,4 +1,6 @@ -from slotify import AvailabilityEngine, SlotGenerator +from datetime import datetime + +from slotify import AvailabilityEngine, BookingConflictError, SlotGenerator generator = SlotGenerator( start="09:00", @@ -13,11 +15,16 @@ capacity=1, ) -available = engine.available_slots("2026-09-21") +now = datetime.fromisoformat("2026-10-04T08:00:00+05:30") +slot = generator.generate_for_date("2026-10-05")[0] + +booking = engine.reserve(slot, now=now) +print("Booked:", booking.booking_id) -if available: - booking = engine.reserve(available[0]) - print("Booked:", booking.booking_id) +try: + engine.reserve(slot, now=now) +except BookingConflictError: + print("Second booking rejected") - engine.cancel(booking.booking_id) - print("Cancelled") +engine.cancel(booking.booking_id, now=now) +print("Cancelled") From 0b4a982b92efcaba6da27e0c7867f49203b9082f Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:42:32 +0530 Subject: [PATCH 03/14] Add runnable temporary-hold example --- examples/holds.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 examples/holds.py diff --git a/examples/holds.py b/examples/holds.py new file mode 100644 index 0000000..80a8022 --- /dev/null +++ b/examples/holds.py @@ -0,0 +1,39 @@ +from datetime import datetime + +from slotify import AvailabilityEngine, HoldExpiredError, SlotGenerator + +generator = SlotGenerator( + start="09:00", + end="12:00", + duration=60, + timezone="Asia/Kolkata", +) + +engine = AvailabilityEngine( + generator, + resource_pool=("doctor-1", "doctor-2"), +) + +slot = generator.generate_for_date("2026-10-05")[0] +created = datetime.fromisoformat("2026-10-04T08:00:00+05:30") + +hold = engine.hold( + slot, + expires_at=datetime.fromisoformat("2026-10-04T08:15:00+05:30"), + now=created, +) + +assert not engine.is_available(slot, now=created) + +booking = engine.confirm_hold(hold.hold_id, now=created) +assert booking.resource_id in {"doctor-1", "doctor-2"} + +try: + engine.confirm_hold( + hold.hold_id, + now=datetime.fromisoformat("2026-10-04T08:20:00+05:30"), + ) +except Exception: + pass + +print("Confirmed:", booking.booking_id) From 0b4a37eb51cafeb0d88c1e79111ce6d8bb0da92d Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:42:35 +0530 Subject: [PATCH 04/14] Add runnable resource-pool example --- examples/resource_pool.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 examples/resource_pool.py diff --git a/examples/resource_pool.py b/examples/resource_pool.py new file mode 100644 index 0000000..75c7781 --- /dev/null +++ b/examples/resource_pool.py @@ -0,0 +1,26 @@ +from datetime import datetime + +from slotify import AvailabilityEngine, SlotGenerator + +generator = SlotGenerator( + start="09:00", + end="13:00", + duration=60, + timezone="Asia/Kolkata", +) + +now = datetime.fromisoformat("2026-10-04T08:00:00+05:30") +slots = generator.generate_for_date("2026-10-05") + +engine = AvailabilityEngine( + generator, + resource_pool=("doctor-1", "doctor-2", "doctor-3"), + resource_strategy="least_loaded", +) + +first = engine.reserve(slots[0], now=now) +second = engine.reserve(slots[0], now=now) + +assert {first.resource_id, second.resource_id} == {"doctor-1", "doctor-2"} + +print(first.resource_id, second.resource_id) From 2dad788a134ab7e404668c7d4310f1aac89616d5 Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:42:43 +0530 Subject: [PATCH 05/14] Reorganize docs around building real scheduling systems --- mkdocs.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index ea1053f..9920150 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,19 +24,25 @@ markdown_extensions: - tables nav: - - Home: index.md - - Getting Started: getting-started.md - - Concepts: concepts.md - - Configuration: configuration.md - - Availability & Booking: booking.md - - Integration: + - Start Here: + - Home: index.md + - Getting Started: getting-started.md + - Build Your First Booking System: build-your-first-booking.md + - Concepts: + - How Slotify Works: concepts.md + - Configuration: configuration.md + - Availability & Booking: booking.md + - Recipes: + - Common Scheduling Patterns: recipes.md + - Temporary Holds: holds.md + - Resource Pools: resources.md + - Integrations: - Django / DRF: django.md - - Core: - - Timezones & DST: timezones.md - - Recipes: recipes.md + - Reference: - API Guide: api.md - - Guides: + - Timezones & DST: timezones.md + - Production: - Testing & Production: testing.md - - Migrating to v0.2.0: migration.md - FAQ: faq.md - Changelog: changelog.md + - Migrating from v0.2/v0.3: migration.md From 0d87d10055711bab8bd43e6d9505a0c64548b8d1 Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:43:37 +0530 Subject: [PATCH 06/14] Add build-first documentation --- docs/build-your-first-booking.md | 232 +++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 docs/build-your-first-booking.md diff --git a/docs/build-your-first-booking.md b/docs/build-your-first-booking.md new file mode 100644 index 0000000..f543109 --- /dev/null +++ b/docs/build-your-first-booking.md @@ -0,0 +1,232 @@ +# Build Your First Booking System + +This guide is for developers who want to build a real booking flow. + +## The flow + +~~~text +Working hours + ↓ +Generate slots + ↓ +Show availability + ↓ +Customer selects + ↓ +Reserve + ↓ +Confirm / cancel / reschedule +~~~ + +Slotify handles scheduling. Your application handles users, authentication, payments, database models, HTTP, and UI. + +## 1. Install + +~~~bash +pip install slotify-scheduling +~~~ + +## 2. Create the scheduler + +~~~python +from slotify import SlotGenerator + +generator = SlotGenerator( + start="09:00", + end="17:00", + duration=30, + timezone="Asia/Kolkata", +) +~~~ + +## 3. Make it bookable + +~~~python +from slotify import AvailabilityEngine + +engine = AvailabilityEngine( + generator, + resource_id="doctor-123", + capacity=1, +) + +slots = engine.available_slots("2026-10-05") +booking = engine.reserve(slots[0]) +~~~ + +If another request has already taken the slot, reserve raises BookingConflictError. + +~~~python +from slotify import BookingConflictError + +try: + booking = engine.reserve(selected_slot) +except BookingConflictError: + return {"error": "That slot was just booked. Please choose another."} +~~~ + +## 4. Add booking rules + +~~~python +from datetime import timedelta +from slotify import BookingPolicy + +policy = BookingPolicy( + minimum_notice=timedelta(hours=2), + maximum_horizon=timedelta(days=30), + cancellation_window=timedelta(hours=12), +) + +engine = AvailabilityEngine( + generator, + resource_id="doctor-123", + policy=policy, +) +~~~ + +## 5. Add breaks and holidays + +~~~python +generator = SlotGenerator( + start="09:00", + end="17:00", + duration=30, + breaks=[("13:00", "14:00")], + timezone="Asia/Kolkata", +) +~~~ + +For weekly hours and closures: + +~~~python +from slotify import Schedule + +schedule = Schedule( + weekly={ + "monday": [("09:00", "17:00")], + "tuesday": [("09:00", "17:00")], + "wednesday": [("09:00", "17:00")], + "thursday": [("09:00", "17:00")], + "friday": [("09:00", "17:00")], + }, + closed_dates=["2026-10-02"], +) +~~~ + +## 6. Hold during checkout + +~~~python +from datetime import datetime + +hold = engine.hold( + selected_slot, + expires_at=datetime.fromisoformat("2026-10-05T09:10:00+05:30"), +) + +# after successful payment +booking = engine.confirm_hold(hold.hold_id) + +# if checkout is abandoned +engine.release_hold(hold.hold_id) +~~~ + +A hold is a temporary scheduling claim. It is not payment confirmation. + +## 7. Cancel and reschedule + +~~~python +engine.cancel(booking.booking_id) + +new_slot = engine.available_slots("2026-10-06")[0] +booking = engine.reschedule(booking.booking_id, new_slot) +~~~ + +## 8. Multiple providers + +If any provider can handle the appointment: + +~~~python +engine = AvailabilityEngine( + generator, + resource_pool=("doctor-1", "doctor-2", "doctor-3"), + resource_strategy="least_loaded", +) +~~~ + +## 9. Django / DRF architecture + +Keep your normal application models: + +~~~text +Provider +Customer +Booking +Payment +Service +~~~ + +Put Slotify in your service layer: + +~~~text +Django request + ↓ +View / API + ↓ +Scheduling service + ↓ +SlotGenerator + ↓ +AvailabilityEngine + ↓ +BookingStore + ↓ +Database +~~~ + +See the Django integration guide. + +## The production rule that matters most + +Availability shown to a customer is not a guarantee. + +Between checking availability and creating the booking, another customer can book the same slot. + +Your final reservation must therefore be atomic in your database store. + +~~~text +show availability + ↓ +customer selects + ↓ +attempt atomic reservation + ↓ +success → confirmation +failure → refresh availability +~~~ + +## Which API should I use? + +| I need to... | Use | +|---|---| +| Generate normal slots | SlotGenerator.generate() | +| Generate one date | generate_for_date() | +| Get bookable slots | available_slots() | +| Get the next slot | next_available() | +| Search a datetime range | available_between() | +| Find a slot long enough for a service | available_for_duration() | +| Check why unavailable | check_availability() | +| Reserve | reserve() | +| Reserve the first available slot | reserve_first_available() | +| Temporarily hold checkout | hold() | +| Confirm a hold | confirm_hold() | +| Cancel | cancel() | +| Reschedule | reschedule() | +| Create recurring bookings | reserve_recurring() | +| Let any provider handle it | resource_pool | +| Enforce booking limits | BookingPolicy | + +## What Slotify does not own + +Keep users, authentication, payments, notifications, frontend/UI, customer records, and business reporting in your application. + +Slotify remains the scheduling engine underneath those systems. From 85f23cfe3fdf37fa65450f6f4853e38578b50a39 Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:43:42 +0530 Subject: [PATCH 07/14] Add build-first documentation --- docs/holds.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 docs/holds.md diff --git a/docs/holds.md b/docs/holds.md new file mode 100644 index 0000000..dd2fff2 --- /dev/null +++ b/docs/holds.md @@ -0,0 +1,57 @@ +# Temporary Holds + +Use a hold when a customer selects a slot and needs a short period to finish checkout. + +~~~text +available + ↓ +hold + ↓ +payment + ↓ +confirm hold → booking +~~~ + +## Create + +~~~python +from datetime import datetime + +hold = engine.hold( + slot, + expires_at=datetime.fromisoformat("2026-10-05T09:10:00+05:30"), +) +~~~ + +## Confirm + +~~~python +booking = engine.confirm_hold(hold.hold_id) +~~~ + +## Release + +~~~python +engine.release_hold(hold.hold_id) +~~~ + +## Expiry + +The built-in in-memory hold store ignores expired holds. + +~~~python +from slotify import HoldExpiredError + +try: + engine.confirm_hold(hold.hold_id) +except HoldExpiredError: + print("Checkout expired") +~~~ + +## Production + +InMemoryHoldStore is intended for tests, prototypes, and simple single-process applications. + +For multiple workers, implement HoldStore with shared durable storage and make the final hold/booking operation concurrency-safe. + +A hold is not payment confirmation. Your payment provider remains the source of truth for payment. From 6b26001eb1eebbd8f4997aa34939a8a4d124f78b Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:43:45 +0530 Subject: [PATCH 08/14] Add build-first documentation --- docs/resources.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 docs/resources.md diff --git a/docs/resources.md b/docs/resources.md new file mode 100644 index 0000000..6efb3c6 --- /dev/null +++ b/docs/resources.md @@ -0,0 +1,63 @@ +# Resource Pools + +Use a resource pool when a booking can be handled by any one member of a group. + +Examples: doctors, stylists, trainers, rooms, or support agents. + +## Basic pool + +~~~python +engine = AvailabilityEngine( + generator, + resource_pool=("doctor-1", "doctor-2", "doctor-3"), +) + +booking = engine.reserve(slot) +print(booking.resource_id) +~~~ + +## Selection strategies + +### first_available + +Default. Checks resources in the configured order. + +~~~python +AvailabilityEngine( + generator, + resource_pool=("doctor-1", "doctor-2"), + resource_strategy="first_available", +) +~~~ + +### round_robin + +Rotates the starting resource. + +~~~python +AvailabilityEngine( + generator, + resource_pool=("doctor-1", "doctor-2"), + resource_strategy="round_robin", +) +~~~ + +### least_loaded + +Prefers the resource with fewer overlapping confirmed bookings. + +~~~python +AvailabilityEngine( + generator, + resource_pool=("doctor-1", "doctor-2"), + resource_strategy="least_loaded", +) +~~~ + +These strategies are allocation helpers. Your application should still filter resources based on qualifications, service, location, branch, or other business rules. + +## Production concurrency + +Resource selection does not replace concurrency control. + +Two requests can observe the same resource as available. The final reservation in your BookingStore must be atomic. From d93e22e16c96ab146ddf06650ac32010d3fbfca9 Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:43:52 +0530 Subject: [PATCH 09/14] Simplify runnable hold example --- examples/holds.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/examples/holds.py b/examples/holds.py index 80a8022..699ef2f 100644 --- a/examples/holds.py +++ b/examples/holds.py @@ -1,6 +1,6 @@ from datetime import datetime -from slotify import AvailabilityEngine, HoldExpiredError, SlotGenerator +from slotify import AvailabilityEngine, SlotGenerator generator = SlotGenerator( start="09:00", @@ -28,12 +28,4 @@ booking = engine.confirm_hold(hold.hold_id, now=created) assert booking.resource_id in {"doctor-1", "doctor-2"} -try: - engine.confirm_hold( - hold.hold_id, - now=datetime.fromisoformat("2026-10-04T08:20:00+05:30"), - ) -except Exception: - pass - print("Confirmed:", booking.booking_id) From b0742acca2e337c967220d99d0d6a16ca05a7f06 Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:43:58 +0530 Subject: [PATCH 10/14] Execute runnable examples in CI --- tests/test_examples.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/test_examples.py diff --git a/tests/test_examples.py b/tests/test_examples.py new file mode 100644 index 0000000..5cab0a0 --- /dev/null +++ b/tests/test_examples.py @@ -0,0 +1,18 @@ +from pathlib import Path +import runpy + +import pytest + + +EXAMPLES = [ + "basic_schedule.py", + "booking.py", + "holds.py", + "resource_pool.py", +] + + +@pytest.mark.parametrize("filename", EXAMPLES) +def test_example_scripts_run(filename): + path = Path(__file__).parents[1] / "examples" / filename + runpy.run_path(str(path), run_name="__main__") From de97e2b486596c921ee1b622ab4533b5c763237e Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:44:07 +0530 Subject: [PATCH 11/14] Add runnable examples to documentation navigation --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index 9920150..6e579bd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -36,6 +36,7 @@ nav: - Common Scheduling Patterns: recipes.md - Temporary Holds: holds.md - Resource Pools: resources.md + - Examples: examples.md - Integrations: - Django / DRF: django.md - Reference: From 9972614a5280f988a00d82eca24ba3048d38764c Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:44:10 +0530 Subject: [PATCH 12/14] Document runnable examples --- docs/examples.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/examples.md diff --git a/docs/examples.md b/docs/examples.md new file mode 100644 index 0000000..f2dbede --- /dev/null +++ b/docs/examples.md @@ -0,0 +1,18 @@ +# Runnable Examples + +The repository contains small scripts you can copy and run: + +- basic slot generation — [examples/basic_schedule.py](https://github.com/failedengineers/Slotify/blob/main/examples/basic_schedule.py) +- booking lifecycle — [examples/booking.py](https://github.com/failedengineers/Slotify/blob/main/examples/booking.py) +- temporary holds — [examples/holds.py](https://github.com/failedengineers/Slotify/blob/main/examples/holds.py) +- resource pools — [examples/resource_pool.py](https://github.com/failedengineers/Slotify/blob/main/examples/resource_pool.py) + +Run one locally: + +~~~bash +python examples/booking.py +~~~ + +These examples are also executed by the test suite so documentation code is less likely to drift from the actual API. + +The Django example is intentionally a service-layer example rather than a complete Django project; it shows where Slotify belongs inside an existing application. From 271715d589f414fd924f3c901b05eb9ce0147ffd Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:44:22 +0530 Subject: [PATCH 13/14] Simplify docs homepage around user goals --- docs/index.md | 158 ++++++++++++++++++++------------------------------ 1 file changed, 64 insertions(+), 94 deletions(-) diff --git a/docs/index.md b/docs/index.md index e055d9d..744e06a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,7 +2,7 @@ **Timezone-aware scheduling and appointment slot engine for Python.** -Slotify is a scheduling layer for appointment, availability, and resource-booking applications. +Slotify is the scheduling layer underneath appointment and resource-booking applications. ## Install @@ -10,6 +10,16 @@ Slotify is a scheduling layer for appointment, availability, and resource-bookin pip install slotify-scheduling ~~~ +## Start here + +If you just want to build something: + +**[→ Build Your First Booking System](build-your-first-booking.md)** + +If you want the basics first: + +**[→ Getting Started](getting-started.md)** + ## 60-second example ~~~python @@ -22,114 +32,74 @@ generator = SlotGenerator( timezone="Asia/Kolkata", ) -slots = generator.generate("2026-09-21", "2026-09-21") +slots = generator.generate("2026-10-05") -for slot in slots: +for slot in slots[:3]: print(slot.start, "->", slot.end) ~~~ -This creates timezone-aware 30-minute slots inside the working window. - -## What Slotify solves +## What Slotify handles -Real scheduling systems quickly need more than start and end times: - -- recurring weekly schedules -- date-specific overrides -- holidays and closures -- multiple working windows -- breaks -- timezone-aware slots -- daylight-saving transitions -- rolling/upcoming availability +- working schedules +- breaks and closures +- timezones and DST +- availability - capacity -- booking buffers -- minimum booking notice -- maximum booking horizon -- blocked periods -- reservations, cancellation, and rescheduling -- recurring appointment series -- multi-resource bookings -- booking buffers and capacity -- iCalendar (.ics) export - -Slotify keeps these scheduling rules in one Python layer. - -### v0.2.0 booking features - -~~~python -from slotify import RecurrenceRule - -rule = RecurrenceRule( - weekdays=(0,), - count=8, -) - -bookings = engine.reserve_recurring( - template_slot, - rule, -) -~~~ - -You can also reschedule an existing booking, apply cancellation and rescheduling rules, use multiple resources, and export a booking as iCalendar with `booking.to_ics()`. - - -## Where it fits +- resources and resource pools +- booking policies +- holds +- reservations +- cancellation and rescheduling +- recurring bookings +- iCalendar export + +## What your application handles + +- users and authentication +- customer/provider models +- payments +- notifications +- frontend/UI +- HTTP/API +- database persistence + +## How it fits ~~~text Your application -├── users / authentication -├── providers / resources -├── database -├── payments -├── notifications -└── frontend / API - | - v - Slotify - ├── Schedule - ├── SlotGenerator - ├── AvailabilityEngine - ├── BookingPolicy - └── Booking + ↓ +Scheduling service + ↓ +SlotGenerator + ↓ +AvailabilityEngine + ↓ +BookingStore / HoldStore + ↓ +Your database ~~~ -Slotify does **not** replace your Django/FastAPI/Flask application. It handles scheduling logic so your application can handle the rest. +## Choose what you need + +| Goal | Start here | +|---|---| +| I am completely new | Getting Started | +| I need a booking system | Build Your First Booking System | +| I need normal working hours | Configuration | +| I need availability | Availability & Booking | +| I need checkout holds | Temporary Holds | +| I have multiple providers | Resource Pools | +| I use Django / DRF | Django / DRF | +| I need timezone/DST help | Timezones & DST | +| I want API details | API Guide | +| I am deploying | Testing & Production | +| I need runnable code | Runnable Examples | ## Common use cases -- doctor and therapist appointments -- consultants and coaches -- salon and service appointments -- interviews and meetings -- classes and group sessions -- rooms and equipment -- staff/resource availability -- booking APIs - -## Choose your path - -**New to Slotify?** Start with [Getting Started](getting-started.md), then read [Core Concepts](concepts.md). - -**Using Django?** Go to [Django Integration](django.md). - -**Working across timezones?** Read [Timezone & DST](timezones.md). - -**Looking for configuration help?** See [Configuration](configuration.md). - -**Building booking flows?** See [Availability & Booking](booking.md). - -**Using Django?** See [Django / DRF](django.md). - -**Looking for copy-paste patterns?** See [Recipes](recipes.md). - -**Deploying to production?** Read [Testing & Production](testing.md). - -**Need the public API map?** See [API Guide](api.md). - -**Upgrading from 0.1.x?** Read [Migrating to v0.2.0](migration.md). +Doctor appointments, therapists, consultants, salons, trainers, classes, interviews, rooms, equipment, and staff/resource scheduling. -## Project links +## Links - [PyPI](https://pypi.org/project/slotify-scheduling/) - [GitHub](https://github.com/failedengineers/Slotify) From 39d687ceefd855556a828fffb8bbc127e8f2971b Mon Sep 17 00:00:00 2001 From: Kalash Gulati Date: Tue, 29 Sep 2026 13:45:01 +0530 Subject: [PATCH 14/14] Correct hold example for resource-pool behavior --- examples/holds.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/holds.py b/examples/holds.py index 699ef2f..c1c2738 100644 --- a/examples/holds.py +++ b/examples/holds.py @@ -23,7 +23,9 @@ now=created, ) -assert not engine.is_available(slot, now=created) +result = engine.check_availability(slot, now=created) +assert result.available +assert result.resource_id == "doctor-2" booking = engine.confirm_hold(hold.hold_id, now=created) assert booking.resource_id in {"doctor-1", "doctor-2"}