phil / waitlist-bundle
Full sessions, workshops and events lose the places freed by cancellations: a waiting list offers them in turn, with a deadline, and passes lapsed offers on.
Package info
github.com/parler-haut-interagir-librement/waitlist-bundle
Type:symfony-bundle
pkg:composer/phil/waitlist-bundle
Requires
- php: >=8.5
- ext-mbstring: *
- doctrine/orm: ^3.8
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- symfony/config: ^8.2
- symfony/console: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/uid: ^8.2
Requires (Dev)
- doctrine/dbal: ^4.6
- doctrine/doctrine-bundle: ^3.4
- doctrine/persistence: ^4.2
- phil/notifications-bundle: ^0.4@dev
- phpunit/phpunit: ^13.4
- psr/log: ^3.0
- symfony/clock: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/event-dispatcher-contracts: ^3.8
- symfony/framework-bundle: ^8.2
- symfony/http-kernel: ^8.2
- symfony/messenger: ^8.2
Suggests
- phil/notifications-bundle: To tell each participant that a place is offered to them, or that their offer lapsed
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-28 03:39:40 UTC
README
Full sessions, workshops and events lose the places freed by cancellations: a waiting list offers them in turn, with a deadline, and passes lapsed offers on.
phil/waitlist-bundle gives anything with a capacity a waiting list: a session, a workshop, an event, a product in short
supply. The application names what the list is for — a kind and an identifier, such as session and S-42 — and keeps
counting its own capacity. Participants join the list and see their position. When places free up, the application
releases them to the list, which offers them to the next entries; each offer is held until a deadline. An entry accepts
it — the application then gives the places —, declines it, or lets it lapse, and the places go to the next entries at
once. Places that fit nobody yet are held until someone fits.
Each request runs under its list's lock, so that two requests never offer the same place; joining twice gives back the same entry, its rank unchanged. The entries are offered places strictly in order by default, or passing over a group that needs more, through a policy the application may replace. A list may also be a draw: the entries made before the draw are ordered by a published seed, so that anyone can check the order, and those who join afterwards wait behind them. Every change is an event that carries identifiers only; with phil/notifications-bundle, the participant is told that a place is offered to them, or that their offer lapsed.
It stores identifiers of participants, never their names or addresses.
Status
| Part | State |
|---|---|
Waitlist and Entry in Doctrine, mapped by attributes, moments in UTC |
Implemented and tested on SQLite |
Waitlists: open, join, position, release, offer with a deadline, accept, decline, leave, lapse, reclaim, close |
Implemented and tested |
| The draw with a published seed | Implemented and tested |
FirstInLine, FirstThatFits and the OfferPolicy port |
Implemented and tested |
The phil:waitlist:lapse command |
Implemented and tested |
| The notifications through phil/notifications-bundle, an optional integration | Implemented and tested |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, registering the bundle, the schema, the command on a schedule. |
| Configuration | The options of phil_waitlist. |
| Waiting lists | Opening a list, joining, the position, releasing places, offers and their deadline, the draw, the lock, the events. |
| Notifications | Telling participants of their offers through phil/notifications-bundle. |
| Extension points | The ports, events and options an application chooses or replaces. |
| Testing | The bundle's tests and its mutation bar. |
| Reference | Every type of the bundle, with its role. |
Quick start
composer require phil/waitlist-bundle
use Phil\WaitlistBundle\Application\Exception\WaitlistRefused; use Phil\WaitlistBundle\Application\Waitlists; $waitlist = $waitlists->open('session', $session->id); try { $entry = $waitlists->join($waitlist->id, $accountId, places: 2); $waitlists->standing($entry->id)->position; // 1 for the next in line } catch (WaitlistRefused $refused) { $refused->reason; // RefusalReason::Closed, or TooManyPlaces } // A registration was cancelled in the application: two places are free. $waitlists->release($waitlist->id, 2); // offered to the next entries, each until its deadline $waitlists->accept($entry->id); // OfferAccepted: the application gives the places
# Every minute: the offers whose deadline has come lapse, their places go to the next entries.
php bin/console phil:waitlist:lapse
Requirements
PHP 8.5 or later, Symfony 8.2 or later, Doctrine ORM 3.8 or later.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.