""" Options: Date: 2024-12-22 21:19:56 Version: 8.51 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://blazor-gallery.servicestack.net #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: QueryBookings.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ 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 class RoomType(str, Enum): SINGLE = 'Single' DOUBLE = 'Double' QUEEN = 'Queen' TWIN = 'Twin' SUITE = 'Suite' @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Coupon: """ Discount Coupons """ id: Optional[str] = None description: Optional[str] = None discount: int = 0 expiry_date: datetime.datetime = datetime.datetime(1, 1, 1) @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Booking(AuditBase): """ Booking Details """ id: int = 0 name: Optional[str] = None room_type: Optional[RoomType] = None room_number: int = 0 booking_start_date: datetime.datetime = datetime.datetime(1, 1, 1) booking_end_date: Optional[datetime.datetime] = None cost: Decimal = decimal.Decimal(0) # @References(typeof(Coupon)) coupon_id: Optional[str] = None discount: Optional[Coupon] = None notes: Optional[str] = None cancelled: Optional[bool] = None # @Route("/bookings", "GET") # @Route("/bookings/{Id}", "GET") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class QueryBookings(QueryDb[Booking], IReturn[QueryResponse[Booking]]): """ Find Bookings """ id: Optional[int] = None