GET | /scheduling/booking-status-events | List of booking status changes in a time frame. |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiDtoBase:
api_key: Optional[str] = None
store_id: Optional[int] = None
chain_id: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventsRequestDto(ApiDtoBase):
from_date: datetime.datetime = datetime.datetime(1, 1, 1)
to_date: datetime.datetime = datetime.datetime(1, 1, 1)
booking_type_filter: int = 0
consult_filter: int = 0
status_filter: Optional[int] = None
class RestrictedResourceType(str, Enum):
STORE = 'Store'
CHAIN = 'Chain'
USER = 'User'
UNDEFINED = 'Undefined'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventsRequest(BookingStatusEventsRequestDto, IRestrictedApiRequest):
# @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
api_key: Optional[str] = None
"""
Api Key - grants access to resources
"""
# @ApiMember(DataType="integer", Description="Chain ID", Name="ChainId", ParameterType="query")
chain_id: Optional[int] = None
"""
Chain ID
"""
# @ApiMember(DataType="integer", Description="Store ID", Name="StoreId", ParameterType="query")
store_id: Optional[int] = None
"""
Store ID
"""
# @ApiMember(DataType="date", Description="UTC Format", IsRequired=true, Name="FromDate", ParameterType="query")
from_date: datetime.datetime = datetime.datetime(1, 1, 1)
"""
UTC Format
"""
# @ApiMember(DataType="date", Description="Max 24 Hours (UTC Format)", IsRequired=true, Name="ToDate", ParameterType="query")
to_date: datetime.datetime = datetime.datetime(1, 1, 1)
"""
Max 24 Hours (UTC Format)
"""
# @ApiMember(DataType="integer", Description="0 = All, 1 = Classes, 2 = Services", IsRequired=true, Name="BookingTypeFilter", ParameterType="query")
booking_type_filter: int = 0
"""
0 = All, 1 = Classes, 2 = Services
"""
# @ApiMember(DataType="integer", Description="0 = Any, 1 = Only Consults, 2 = Exclude Consults", IsRequired=true, Name="ConsultFilter", ParameterType="query")
consult_filter: int = 0
"""
0 = Any, 1 = Only Consults, 2 = Exclude Consults
"""
# @ApiMember(DataType="integer", Description="Leave blank for any, otherwise use ClubReady BookingStatus enum", Name="StatusFilter", ParameterType="query")
status_filter: Optional[int] = None
"""
Leave blank for any, otherwise use ClubReady BookingStatus enum
"""
restricted_id: Optional[int] = None
restricted_resource_type: Optional[RestrictedResourceType] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiResponseBase:
success: bool = False
message: Optional[str] = None
class BookingStatus(IntEnum):
UNDEFINED = 0
UNAVAILABLE = 1
OPEN = 2
CANCELLED_WITHIN_POLICY = 3
CANCELLED_OUTSIDE_POLICY = 4
COMPLETED = 5
NO_SHOW = 6
RESCHEDULED_WITHIN_POLICY = 8
RESCHEDULED_BY_ADMIN = 9
CANCELLED_BY_ADMIN_NOT_CUSTOMER_FAULT = 10
PENDING = 11
WAIT_LISTED = 12
ERROR = -1
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventItem:
chain_id: Optional[int] = None
store_id: Optional[int] = None
user_id: int = 0
booking_id: int = 0
class_schedule_id: Optional[int] = None
service_id: Optional[int] = None
session_size_id: Optional[int] = None
booking_date_time: datetime.datetime = datetime.datetime(1, 1, 1)
status: Optional[BookingStatus] = None
status_id: int = 0
status_changed: datetime.datetime = datetime.datetime(1, 1, 1)
consult: bool = False
booked_from_wait_list: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventsResponseDto(ApiResponseBase):
booking_status_events: Optional[List[BookingStatusEventItem]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BookingStatusEventsResponse(BookingStatusEventsResponseDto):
success: bool = False
message: Optional[str] = None
booking_status_events: Optional[List[BookingStatusEventItem]] = None
Python BookingStatusEventsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /scheduling/booking-status-events HTTP/1.1 Host: clubready.com Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Success":false,"Message":"String","BookingStatusEvents":[{"ChainId":0,"StoreId":0,"UserId":0,"BookingId":0,"ClassScheduleId":0,"ServiceId":0,"SessionSizeId":0,"BookingDateTime":"0001-01-01T00:00:00.0000000","Status":"Undefined","StatusId":0,"StatusChanged":"0001-01-01T00:00:00.0000000","Consult":false,"BookedFromWaitList":false}]}