Venue & Facilities Operations
Real-time resource scheduling, conflict-free booking holds, operating hours, blackout windows, and facility management.
The Venue module governs physical sports facilities, fields, pitches, courts, and schedulable resources across multi-campus organizations. It provides atomic booking hold acquisitions, dynamic availability resolution, blackout enforcement, and seamless integration with pricing and payment engines.
Core Architectural Capabilities
Built for multi-facility operations with high concurrency, strict multi-tenancy, and high-performance availability lookups.
Multi-Campus Venues
Hierarchical organization of venues, facilities, sub-facilities, and schedulable zones with geo-coordinates and amenity tags.
Dynamic Availability Engine
High-speed schedule calculation factoring in recurring operating hours, maintenance windows, and seasonal exceptions.
Atomic Booking Holds
Temporary 15-minute resource locks that reserve time slots during payment checkout without risk of race conditions.
Reservation Lifecycle
Comprehensive state machine governing reservations from Draft and Tentative to Confirmed, Completed, and Cancelled.
Schedulable Assets
Granular slot scheduling for courts, full pitches, half pitches, and equipment with capacity limits.
Maintenance & Blackouts
Immediate operational overrides for tournament closures, pitch maintenance, and unexpected weather events.
Domain Aggregate Root: Reservation
The Reservation aggregate root enforces slot integrity, tenant isolation, hold verification, and dispatches domain events upon state transition.
public sealed class Reservation : TenantAggregateRoot
{
public Guid VenueId { get; private set; }
public Guid FacilityId { get; private set; }
public Guid SchedulableResourceId { get; private set; }
public DateTimeOffset StartTimeUtc { get; private set; }
public DateTimeOffset EndTimeUtc { get; private set; }
public ReservationStatus Status { get; private set; }
public Guid? BookingHoldId { get; private set; }
public string CustomerReferenceId { get; private set; } = string.Empty;
public decimal TotalAmount { get; private set; }
public string Currency { get; private set; } = "USD";
public Result Confirm(string transactionReference)
{
if (Status != ReservationStatus.Tentative && Status != ReservationStatus.Draft)
return Result.Failure("Cannot confirm reservation in current state");
Status = ReservationStatus.Confirmed;
RaiseDomainEvent(new ReservationConfirmedDomainEvent(Id, TenantId, VenueId, StartTimeUtc, EndTimeUtc));
return Result.Success();
}
}Two-Phase Booking & Hold Lifecycle
From the moment an athlete or admin selects a slot to final payment confirmation and ledger recording:
Primary API Endpoints
Key REST endpoints exposed by VenueControllers for resource scheduling, availability evaluation, and reservation management.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/v1/venue/venues | List venues and facilities with filtering by branch and amenities | 🔒 Required |
| POST | /api/v1/venue/venues | Register a new sports venue with operating parameters | 🔒 Required |
| GET | /api/v1/venue/facilities | Query facilities and zones within a specific venue | 🔒 Required |
| GET | /api/v1/venue/resources | Retrieve schedulable resources and slot granularity | 🔒 Required |
| POST | /api/v1/venue/availability/check | Evaluate slot availability for a specified date and resource | 🔒 Required |
| POST | /api/v1/venue/holds/acquire | Acquire an atomic 15-minute booking hold on a resource slot | 🔒 Required |
| POST | /api/v1/venue/reservations | Initiate a draft reservation linked to an active hold | 🔒 Required |
| POST | /api/v1/venue/reservations/{id}/confirm | Confirm a reservation upon payment gateway webhook handshake | 🔒 Required |
| POST | /api/v1/venue/blackouts | Schedule a maintenance or tournament blackout window | 🔒 Required |
| GET | /api/v1/venue/operations-calendar | Fetch aggregated operational schedule across all resources | 🔒 Required |