codex_services.booking._shared.dto
dto
codex_services.booking._shared.dto
Base DTOs shared across all booking types.
Each booking type (slot_master, room, etc.) inherits from these and adds domain-specific fields.
Classes
ResourceAvailability
Bases: BaseDTO
Base availability of a resource (executor, room, equipment, etc.).
Fields
resource_id (str): Unique identifier of the resource. free_windows (list[tuple[datetime, datetime]]): Available time windows. Each tuple is (start, end) where start < end.
Source code in src/codex_services/booking/_shared/dto.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
Functions
validate_windows_order()
Validate that each free window is chronologically correct.
Source code in src/codex_services/booking/_shared/dto.py
29 30 31 32 33 34 35 | |
BookingRequest
Bases: BaseDTO
Base booking request.
Fields
booking_date (date): Target date for the booking.
Source code in src/codex_services/booking/_shared/dto.py
41 42 43 44 45 46 47 48 49 | |
BookingSolution
Bases: BaseDTO
Base result — one booked slot.
Fields
resource_id (str): Assigned resource identifier. start_time (datetime): Scheduled start time. end_time (datetime): Scheduled end time.
Source code in src/codex_services/booking/_shared/dto.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
Attributes
duration_minutes
property
Calculate actual duration in minutes.
BookingResult
Bases: BaseDTO
Base result — list of solutions.
Concrete booking types override the solutions field with a specific type.
Source code in src/codex_services/booking/_shared/dto.py
72 73 74 75 76 77 78 79 80 81 82 | |
Attributes
has_solutions
property
Return True if at least one solution was found.