""" Options: Date: 2024-06-16 23:59:24 Version: 8.23 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://testapi.bokamera.se #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: DeleteResource.* #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 ICompany: company_id: Optional[str] = None class BookingStatusEnum(IntEnum): BOOKED = 1 UNBOOKED = 2 RESERVED = 3 CANCELED = 4 AWAITING_PAYMENT = 5 AWAITING_PAYMENT_NO_TIME_LIMIT = 6 PAYED = 7 AWAITING_PAYMENT_REQUEST_FROM_ADMIN = 8 AWAITING_PAYMENT_FROM_PROVIDER = 9 INVOICED = 10 class IInterval: from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) to: datetime.datetime = datetime.datetime(1, 1, 1) @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BookedCustomer: id: Optional[str] = None firstname: Optional[str] = None lastname: Optional[str] = None email: Optional[str] = None phone: Optional[str] = None facebook_user_name: Optional[str] = None image_url: Optional[str] = None corporate_identity_number: Optional[str] = None invoice_address1: Optional[str] = None invoice_address2: Optional[str] = None invoice_city: Optional[str] = None invoice_postal_code: Optional[str] = None invoice_country_code: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class TimeException(ITimeException): # @ApiMember(Description="Time exception id") id: int = 0 """ Time exception id """ # @ApiMember(Description="Indicates whether or not the time exception is recurring") is_recurring: bool = False """ Indicates whether or not the time exception is recurring """ # @ApiMember(Description="Indicates whether the time exception is blocking the time or not") is_block: bool = False """ Indicates whether the time exception is blocking the time or not """ # @ApiMember(Description="The reason of the time exception, example: Vacation, doctors appointment, ...") reason_text: Optional[str] = None """ The reason of the time exception, example: Vacation, doctors appointment, ... """ # @ApiMember(Description="The public reason of the time exception, example: Vacation, doctors appointment, ...") reason_text_public: Optional[str] = None """ The public reason of the time exception, example: Vacation, doctors appointment, ... """ # @ApiMember(Description="Time exception start") from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) """ Time exception start """ # @ApiMember(Description="Time exception end") to: datetime.datetime = datetime.datetime(1, 1, 1) """ Time exception end """ # @ApiMember(Description="Resources that owns this exception") resource_ids: Optional[List[int]] = None """ Resources that owns this exception """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class BookedTime(IBookedTime): # @ApiMember(Description="Booking id") id: int = 0 """ Booking id """ # @ApiMember(Description="The booked service") service_id: int = 0 """ The booked service """ # @ApiMember(Description="Booking start") from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) """ Booking start """ # @ApiMember(Description="Booking end") to: datetime.datetime = datetime.datetime(1, 1, 1) """ Booking end """ # @ApiMember(Description="Number of booked spots") booked_spots: int = 0 """ Number of booked spots """ # @ApiMember(Description="Number of total spots for the service") total_spots: int = 0 """ Number of total spots for the service """ # @ApiMember(Description="The pause after the booking") pause_after_in_minutes: int = 0 """ The pause after the booking """ # @ApiMember(Description="The booking status") status_id: int = 0 """ The booking status """ status: Optional[BookingStatusEnum] = None # @ApiMember(Description="The customer the booking belongs to") customer: Optional[BookedCustomer] = None """ The customer the booking belongs to """ class ITimeException(IInterval): id: int = 0 reason_text: Optional[str] = None is_block: bool = False reason_text_public: Optional[str] = None is_recurring: bool = False resource_ids: Optional[List[int]] = None class IBookedTime(IInterval): id: int = 0 service_id: int = 0 booked_spots: int = 0 total_spots: int = 0 pause_after_in_minutes: int = 0 status: Optional[BookingStatusEnum] = None status_id: int = 0 customer: Optional[BookedCustomer] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ResourceQueryResponse: # @ApiMember(Description="The resource id") id: int = 0 """ The resource id """ # @ApiMember(Description="The resource name") name: Optional[str] = None """ The resource name """ # @ApiMember(Description="The resource description") description: Optional[str] = None """ The resource description """ # @ApiMember(Description="If resource is active or not") active: bool = False """ If resource is active or not """ # @ApiMember(Description="The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.") color: Optional[str] = None """ The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue. """ # @ApiMember(Description="The email of the resource") email: Optional[str] = None """ The email of the resource """ # @ApiMember(Description="The image url of the resource") image_url: Optional[str] = None """ The image url of the resource """ # @ApiMember(Description="The mobile phone number of the resource") mobile_phone: Optional[str] = None """ The mobile phone number of the resource """ # @ApiMember(Description="Used by example code locks to know what access group the resource is assigned to") access_group: Optional[str] = None """ Used by example code locks to know what access group the resource is assigned to """ # @ApiMember(Description="If the resource should receive email notification when booked") email_notification: bool = False """ If the resource should receive email notification when booked """ # @ApiMember(Description="If the resource should receive SMS notification when booked") sms_notification: bool = False """ If the resource should receive SMS notification when booked """ # @ApiMember(Description="If the resource should receive email reminders on bookings") send_email_reminder: Optional[bool] = None """ If the resource should receive email reminders on bookings """ # @ApiMember(Description="If the resource should receive SMS reminders on bookings") send_s_m_s_reminder: Optional[bool] = None """ If the resource should receive SMS reminders on bookings """ # @ApiMember(Description="The resource time exceptions") exceptions: Optional[List[TimeException]] = None """ The resource time exceptions """ # @ApiMember(Description="The resource bookings") bookings: Optional[List[BookedTime]] = None """ The resource bookings """ # @ApiMember(Description="Then date when the resource was created") created: datetime.datetime = datetime.datetime(1, 1, 1) """ Then date when the resource was created """ # @ApiMember(Description="Then date when the resource was updated") updated: datetime.datetime = datetime.datetime(1, 1, 1) """ Then date when the resource was updated """ response_status: Optional[ResponseStatus] = None # @Route("/resource/{Id}", "DELETE") # @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) # @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403) # @ApiResponse(Description="Bookings exists that needs to be unbooked before creating this time exceptions, use the /timeexceptions/collidingevents to find which bookings and use the booking service to unbook them", StatusCode=409) # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DeleteResource(IReturn[ResourceQueryResponse], ICompany): # @ApiMember(Description="Enter the company id, if blank company id and you are an admin, your company id will be used.", IsRequired=true) company_id: Optional[str] = None """ Enter the company id, if blank company id and you are an admin, your company id will be used. """ # @ApiMember(Description="Id of the resource to delete", IsRequired=true) id: int = 0 """ Id of the resource to delete """ # @ApiMember(Description="If this equals true it will force to set the resource as active = false, this is used when bookings exists on the resource and it can't be deleted. ") force: bool = False """ If this equals true it will force to set the resource as active = false, this is used when bookings exists on the resource and it can't be deleted. """