""" Options: Date: 2024-11-21 11:41:53 Version: 8.23 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://api.bokamera.se #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: BookingLogQuery.* #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 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BaseModel: pass @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BookingLogEventType(BaseModel): # @Required() name: Optional[str] = None # @Required() description: Optional[str] = None modified_date: Optional[datetime.datetime] = None # @Required() id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BookingLog(BaseModel): # @References(typeof(BookingLogEventType)) event_type_id: int = 0 event_type: Optional[BookingLogEventType] = None # @Required() company_id: Optional[str] = None # @Required() booking_id: int = 0 id: int = 0 comments: Optional[str] = None user_id: Optional[str] = None # @Required() created: datetime.datetime = datetime.datetime(1, 1, 1) modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BookingLogEventTypeResponse: # @ApiMember(Description="The event type id") id: int = 0 """ The event type id """ # @ApiMember(Description="The event type name") name: Optional[str] = None """ The event type name """ # @ApiMember(Description="The event type description") description: Optional[str] = None """ The event type description """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BookingLogQueryResponse: # @ApiMember(Description="The booking log id") id: int = 0 """ The booking log id """ # @ApiMember(Description="The booking id") booking_id: int = 0 """ The booking id """ # @ApiMember(Description="The type of event") event_type_id: int = 0 """ The type of event """ # @ApiMember(Description="The type of event") event_type: Optional[BookingLogEventTypeResponse] = None """ The type of event """ # @ApiMember(Description="Comments that could be added to the event log item") comments: Optional[str] = None """ Comments that could be added to the event log item """ # @ApiMember(Description="The user created the event") user_name: Optional[str] = None """ The user created the event """ # @ApiMember(Description="Then date when the event occured") created: datetime.datetime = datetime.datetime(1, 1, 1) """ Then date when the event occured """ # @Route("/bookinglog", "GET") # @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) # @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403) # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BookingLogQuery(QueryDb2[BookingLog, BookingLogQueryResponse], IReturn[QueryResponse[BookingLogQueryResponse]]): # @ApiMember(Description="Enter the company and booking id you want to see log for, if blank company id and you are an admin, your company id will be used", IsRequired=true, ParameterType="query") company_id: Optional[str] = None """ Enter the company and booking id you want to see log for, if blank company id and you are an admin, your company id will be used """ # @ApiMember(Description="Enter the booking id you want to get the log", IsRequired=true, ParameterType="query") booking_id: int = 0 """ Enter the booking id you want to get the log """