Skip to main content
Adzbyte Solutions
Web Development

Share Courts and Seats with Transactional Checks

Adrian Saycon
Adrian Saycon
November 23, 20265 min read
Share Courts and Seats with Transactional Checks

A session can have room for another player while its court is already occupied by a different session. It can also have an available court and no participant places left. Those are separate limits, and the scheduling code needs to enforce both.

The Dink Slot owner scheduling milestone implements court allocations and a private open-play roster together. Public reservations, checkout and payments remain disabled. This is an owner-managed beta, so the useful evidence is the implemented rules and recorded checks, not a claim about a busy public booking service.

Check the court when the session becomes active

An open-play draft records its planned courts and times, but it doesn’t claim active court allocations. Publication is the point where the implementation checks whether those resources can actually be used.

The publish command requires a future start. The branch and selected courts must be published, the session must fit the configured court hours, and an active allocation must not overlap another session on any selected court. Only after those checks does the transaction create or reactivate the allocation rows.

That keeps a draft useful for planning without letting it quietly reserve inventory. It also makes publication a meaningful server operation. A green-looking calendar cell in the browser isn’t enough to claim the court.

Use intervals that agree at the edges

The overlap query checks whether an existing allocation starts before the proposed end and ends after the proposed start. An allocation ending exactly when another begins doesn’t overlap under that rule. It’s a clear choice that the calendar and write path need to share.

The session stores normalized UTC endpoints alongside its local scheduling document and timezone. The input includes an explicit next-day flag for overnight use. Those details keep an evening session crossing midnight from looking like a negative or same-day duration.

I’d keep edge fixtures close to this query: equal endpoints, a contained session, a session crossing midnight and a conflict on only one of several courts. These are recommendations for reviewing the interval rule, not invented reports of what happened at a venue.

Lock the resources every writer depends on

The implementation takes an installation-wide settings lock before the branch, then court resources in a consistent order, then the session and roster records it needs. An edited session locks the union of old courts, new courts and retained allocation references.

That union is easy to overlook. Checking only the new court set would leave the previous allocation side outside the operation’s resource review. Moving a session is a change to what it releases as well as what it intends to use.

The shared installation lock is a straightforward correctness choice for this milestone. It also serializes more work than a highly partitioned design would. There are no throughput measurements here that justify calling it suitable for every size of booking system. Measure contention before deciding whether finer-grained locking is needed.

Count seats from the states that occupy them

The roster counts registered and checked-in entries as occupied places. Waiting and withdrawn entries don’t consume that capacity. A promotion moves a waiting entry into the registered state only after checking the current occupied count inside the transaction.

Waiting is an explicit state, not a seat reservation. Withdrawing someone doesn’t automatically select and promote another person in this implementation. The owner chooses the promotion action, and the server still checks whether the place is available.

Check-in preserves the occupied count because it changes a registered place into a checked-in one. Repeating check-in on an already checked-in live entry is a no-op without another history change. That gives a repeated action a defined result instead of letting the interface invent one.

Use the session version for roster decisions

A roster action depends on more than the participant’s own row. Another owner action may have used the last place or changed the session state. The mutation therefore expects the current session version.

A committed roster change advances both the relevant entry and session versions and records the changes. If two actions start from the same old session version, the second can’t blindly apply its earlier capacity assumptions. It must work from the newer session state.

The owner API separates missing versions, stale versions and rule conflicts. That helps the interface distinguish Reload the current session from This session is full. Both block a write, but they tell the owner different things about what to do next.

Keep lifecycle changes honest about obligations

The session can’t be structurally edited while published. Returning it to draft is limited to an upcoming session without live roster obligations. Cancellation and unpublication release active allocations while retaining their rows.

The catalog also checks dependent sessions before hiding a branch or court. Changing a location’s timezone is guarded once configured hours or relevant future sessions exist. A seemingly small settings edit can affect the meaning of scheduling data, so those checks belong beside the write.

These restrictions are part of the implemented owner workflow. They shouldn’t be described as completed payment, notification or customer-refund handling, because those features aren’t enabled.

Check competing actions in the real stack

The recorded milestone review includes WordPress and MySQL checks and real HTTP browser checks, including independent waiting-list promotion races. It also states the limits of that approval. It isn’t a full public booking or payment qualification.

That evidence supports a practical way to review scheduling work: make the time claim, seat claim and lifecycle rule visible in the same operation. A calendar that displays free space is helpful. The transaction deciding whether the next action is allowed is where those promises have to hold together.

Adrian Saycon

Written by

Adrian Saycon

A developer with a passion for emerging technologies, Adrian Saycon focuses on transforming the latest tech trends into great, functional products.

Discussion (0)

Your email is used only for comment moderation and is never published.

No comments yet. Be the first to share your thoughts.