""" Options: Date: 2024-12-03 18:36:23 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: RecuringScheduleQuery.* #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 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 BaseModel: pass @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldValue(BaseModel): # @Required() company_id: Optional[str] = None id: int = 0 # @Required() value: Optional[str] = None # @Required() active: bool = False sort_order: Optional[int] = None modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomField(BaseModel): # @Required() table: Optional[str] = None # @Required() column: Optional[str] = None # @Required() data_type: Optional[str] = None # @Required() description: Optional[str] = None # @Required() active: bool = False modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RegEx(BaseModel): # @Required() name: Optional[str] = None # @Required() description: Optional[str] = None # @Required() reg_ex_code: Optional[str] = None error_message: Optional[str] = None modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldServiceRelation(BaseModel): # @Required() company_id: Optional[str] = None id: int = 0 # @Required() custom_field_config_id: int = 0 # @Required() service_id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CustomFieldConfig(BaseModel): # @Ignore() values: Optional[List[CustomFieldValue]] = None custom_field: Optional[CustomField] = None # @Ignore() reg_ex: Optional[RegEx] = None # @Ignore() services: Optional[List[Service]] = None custom_field_service_relation: Optional[List[CustomFieldServiceRelation]] = None # @Required() company_id: Optional[str] = None id: int = 0 group_id: Optional[int] = None # @Required() field_id: int = 0 # @Required() icon_id: int = 0 reg_ex_id: Optional[int] = None # @Required() name: Optional[str] = None # @Required() description: Optional[str] = None # @Required() datatype: Optional[str] = None # @Required() max_length: int = 0 # @Required() is_public: bool = False # @Required() is_hidden: bool = False # @Required() is_mandatory: bool = False default_value: Optional[str] = None reg_ex_error_message: Optional[str] = None mandatory_error_message: Optional[str] = None width: Optional[int] = None # @Required() multiple_line_text: bool = False modified_date: Optional[datetime.datetime] = None 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 @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 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 CustomFieldDataResponse: id: int = 0 column: Optional[str] = None name: Optional[str] = None description: Optional[str] = None value: Optional[str] = None # @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'") data_type: Optional[str] = None """ Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Resource(BaseModel, ICustomFieldTable, IBaseModelCreated, IBaseModelUpdated): # @Ignore() priority: int = 0 # @Ignore() schedules: Optional[IList[ISchedule]] = None # @Ignore() exceptions: Optional[IList[ITimeException]] = None # @Ignore() bookings: Optional[IList[IBookedTime]] = None # @Ignore() custom_fields_config: Optional[IList[CustomFieldConfig]] = None # @Ignore() custom_fields_data: Optional[IList[CustomFieldDataResponse]] = None # @Required() company_id: Optional[str] = None id: int = 0 # @Required() name: Optional[str] = None # @Required() active: bool = False description: Optional[str] = None image_url: Optional[str] = None # @Required() updated_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() color: Optional[str] = None email: Optional[str] = None mobile_phone: Optional[str] = None email_notification: Optional[bool] = None sms_notification: Optional[bool] = None # @Required() send_s_m_s_reminder: bool = False # @Required() send_email_reminder: bool = False modified_date: Optional[datetime.datetime] = None access_group: Optional[str] = None text_field1: Optional[str] = None text_field2: Optional[str] = None text_field3: Optional[str] = None text_field4: Optional[str] = None text_field5: Optional[str] = None text_field6: Optional[str] = None text_field7: Optional[str] = None text_field8: Optional[str] = None text_field9: Optional[str] = None text_field10: Optional[str] = None text_field11: Optional[str] = None text_field12: Optional[str] = None text_field13: Optional[str] = None text_field14: Optional[str] = None text_field15: Optional[str] = None text_field16: Optional[str] = None text_field17: Optional[str] = None text_field18: Optional[str] = None text_field19: Optional[str] = None text_field20: Optional[str] = None class ScheduleType(str, Enum): NOT_DEFINED = 'NotDefined' RECURRING_SCHEDULE = 'RecurringSchedule' DATE_SCHEDULE = 'DateSchedule' class ISchedule: resources: Optional[IList[Resource]] = None type: Optional[ScheduleType] = None active: bool = False is_resource_specific: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecurringScheduleDate(BaseModel, IInterval): # @Ignore() from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) # @Ignore() to: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() company_id: Optional[str] = None id: int = 0 # @Required() recurring_schedule_id: int = 0 # @Required() date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() start_time: datetime.timedelta = datetime.timedelta() # @Required() end_time: datetime.timedelta = datetime.timedelta() modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecurringScheduleResourceRelation(BaseModel): # @Required() company_id: Optional[str] = None # @Required() recurring_schedule_id: int = 0 # @Required() resource_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None class BokaMeraDayOfWeek(IntEnum): MONDAY = 1 TUESDAY = 2 WEDNESDAY = 3 THURSDAY = 4 FRIDAY = 5 SATURDAY = 6 SUNDAY = 7 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecurringScheduleDayOfWeekRelation(BaseModel): # @Ignore() day_of_week: Optional[BokaMeraDayOfWeek] = None # @Required() day_of_week_id: int = 0 # @Required() company_id: Optional[str] = None # @Required() recurring_schedule_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ServiceRecurringScheduleRelation(BaseModel): # @Required() company_id: Optional[str] = None # @Required() service_id: int = 0 # @Required() recurring_schedule_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecurringScheduleException(BaseModel, IScheduleException): # @Required() company_id: Optional[str] = None # @Required() recurring_schedule_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None # @Required() start_time: datetime.timedelta = datetime.timedelta() # @Required() end_time: datetime.timedelta = datetime.timedelta() class IScheduleException: start_time: datetime.timedelta = datetime.timedelta() end_time: datetime.timedelta = datetime.timedelta() @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecurringSchedule(BaseModel, ISchedule, IBaseModelCreated, IBaseModelUpdated): # @Ignore() type: Optional[ScheduleType] = None # @Ignore() dates: Optional[IList[RecurringScheduleDate]] = None # @Ignore() resources: Optional[IList[Resource]] = None # @Ignore() services: Optional[IList[Service]] = None recurring_schedule_resource_relation: Optional[List[RecurringScheduleResourceRelation]] = None recurring_schedule_dates: Optional[List[RecurringScheduleDate]] = None recurring_schedule_day_of_week_relation: Optional[List[RecurringScheduleDayOfWeekRelation]] = None service_recurring_schedule_relation: Optional[List[ServiceRecurringScheduleRelation]] = None recurring_schedule_exceptions: Optional[List[RecurringScheduleException]] = None # @Ignore() exceptions: Optional[IList[IScheduleException]] = None # @Ignore() is_recurring_by_day_of_week: bool = False # @Ignore() is_recurring_by_dates: bool = False # @Ignore() is_resource_specific: bool = False # @Required() company_id: Optional[str] = None id: int = 0 # @Required() name: Optional[str] = None # @Required() description: Optional[str] = None # @Required() time_interval: int = 0 # @Required() start_time: datetime.timedelta = datetime.timedelta() # @Required() end_time: datetime.timedelta = datetime.timedelta() # @Required() number_of_schedule_days: int = 0 # @Required() updated_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() enable_booking_until_closing_time: bool = False # @Required() valid_from: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() valid_to: datetime.datetime = datetime.datetime(1, 1, 1) modified_date: Optional[datetime.datetime] = None # @Required() active: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DayOfWeekDto: day_of_week_id: int = 0 dot_net_day_of_week_id: int = 0 day_of_week: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ScheduleResources: id: int = 0 # @ApiMember(Description="Name of the resource") name: Optional[str] = None """ Name of the resource """ # @ApiMember(Description="The image url of the resource") image_url: Optional[str] = None """ The image url of the resource """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ScheduleServices: id: int = 0 # @ApiMember(Description="Name of the service") name: Optional[str] = None """ Name of the service """ # @ApiMember(Description="The image url of the service") image_url: Optional[str] = None """ The image url of the service """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecurringScheduleExceptionResponse: # @ApiMember(Description="Start time of the schedule exception.") start_time: datetime.timedelta = datetime.timedelta() """ Start time of the schedule exception. """ # @ApiMember(Description="End time of the schedule exception.") end_time: datetime.timedelta = datetime.timedelta() """ End time of the schedule exception. """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecurringScheduleDateResponse: id: int = 0 date: datetime.datetime = datetime.datetime(1, 1, 1) start_time: datetime.timedelta = datetime.timedelta() end_time: datetime.timedelta = datetime.timedelta() response_status: Optional[ResponseStatus] = None class IBaseModelCreated: created_date: datetime.datetime = datetime.datetime(1, 1, 1) class IBaseModelUpdated: updated_date: datetime.datetime = datetime.datetime(1, 1, 1) class ICustomFieldTable: custom_fields_config: Optional[IList[CustomFieldConfig]] = None custom_fields_data: Optional[IList[CustomFieldDataResponse]] = None text_field1: Optional[str] = None text_field2: Optional[str] = None text_field3: Optional[str] = None text_field4: Optional[str] = None text_field5: Optional[str] = None text_field6: Optional[str] = None text_field7: Optional[str] = None text_field8: Optional[str] = None text_field9: Optional[str] = None text_field10: Optional[str] = None text_field11: Optional[str] = None text_field12: Optional[str] = None text_field13: Optional[str] = None text_field14: Optional[str] = None text_field15: Optional[str] = None text_field16: Optional[str] = None text_field17: Optional[str] = None text_field18: Optional[str] = None text_field19: Optional[str] = None text_field20: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecurringScheduleQueryResponse: # @ApiMember(Description="The schedule id") id: int = 0 """ The schedule id """ # @ApiMember(Description="Name of the schedule") name: Optional[str] = None """ Name of the schedule """ # @ApiMember(Description="Description of the schedule") description: Optional[str] = None """ Description of the schedule """ # @ApiMember(Description="If the schedule is active or not") active: bool = False """ If the schedule is active or not """ # @ApiMember(Description="Time interval for available times Here you set the interval at which times should appear. For example, if you select the range 15minutes, and your service has an duration of 1 hour and opening hours are 9AM to 6PM you will see the following suggested times: 09AM-10PM 09:15AM-10:15PM, 09:30AM-10:30PM , ..... 04:45PM-05:45, 05:00PM-06:00PM", IsRequired=true) time_interval: int = 0 """ Time interval for available times Here you set the interval at which times should appear. For example, if you select the range 15minutes, and your service has an duration of 1 hour and opening hours are 9AM to 6PM you will see the following suggested times: 09AM-10PM 09:15AM-10:15PM, 09:30AM-10:30PM , ..... 04:45PM-05:45, 05:00PM-06:00PM """ # @ApiMember(Description="The timestamp to which the schedule is valid from", IsRequired=true) valid_from: datetime.datetime = datetime.datetime(1, 1, 1) """ The timestamp to which the schedule is valid from """ # @ApiMember(Description="The timestamp to which the schedule is valid to", IsRequired=true) valid_to: datetime.datetime = datetime.datetime(1, 1, 1) """ The timestamp to which the schedule is valid to """ # @ApiMember(Description="The time for the schedule opening hours (starttime)", IsRequired=true) start_time: datetime.timedelta = datetime.timedelta() """ The time for the schedule opening hours (starttime) """ # @ApiMember(Description="The time for the schedule opening hours (endtime)", IsRequired=true) end_time: datetime.timedelta = datetime.timedelta() """ The time for the schedule opening hours (endtime) """ # @ApiMember(Description="The number of days the schedule is valid from todays date", IsRequired=true) number_of_schedule_days: int = 0 """ The number of days the schedule is valid from todays date """ # @ApiMember(Description="If the schedule is only connected to some specific resources. Note: You must have IncludeResources property to see this.", IsRequired=true) is_resource_specific: Optional[bool] = None """ If the schedule is only connected to some specific resources. Note: You must have IncludeResources property to see this. """ # @ApiMember(Description="The timestamp when the schedule was updated", IsRequired=true) updated_date: datetime.datetime = datetime.datetime(1, 1, 1) """ The timestamp when the schedule was updated """ # @ApiMember(Description="The timestamp when the schedule was created", IsRequired=true) created_date: datetime.datetime = datetime.datetime(1, 1, 1) """ The timestamp when the schedule was created """ # @ApiMember(Description="Allow bookings end time exceeds the opening hours Here you can choose whether it should be possible to make a reservation exceeding the opening hours. This should be ticked when a service duration is longer than 24 hours (possible to book over midnight).", IsRequired=true) enable_booking_until_closing_time: bool = False """ Allow bookings end time exceeds the opening hours Here you can choose whether it should be possible to make a reservation exceeding the opening hours. This should be ticked when a service duration is longer than 24 hours (possible to book over midnight). """ # @ApiMember(Description="If recurring, an array indicating which days of the week the exception recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs") days_of_week: Optional[List[DayOfWeekDto]] = None """ If recurring, an array indicating which days of the week the exception recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs """ # @ApiMember(Description="The resources that is connected to the schedule") resources: Optional[List[ScheduleResources]] = None """ The resources that is connected to the schedule """ # @ApiMember(Description="The services that is connected to the schedule") services: Optional[List[ScheduleServices]] = None """ The services that is connected to the schedule """ # @ApiMember(Description="The exceptions that is added to the schedule") exceptions: Optional[List[RecurringScheduleExceptionResponse]] = None """ The exceptions that is added to the schedule """ # @ApiMember(Description="Schedule dates, used when the schedule is not a rolling schedule using days of week") schedule_dates: Optional[List[RecurringScheduleDateResponse]] = None """ Schedule dates, used when the schedule is not a rolling schedule using days of week """ response_status: Optional[ResponseStatus] = None # @Route("/schedules/recurring", "GET") # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RecuringScheduleQuery(QueryDb2[RecurringSchedule, RecurringScheduleQueryResponse], IReturn[QueryResponse[RecurringScheduleQueryResponse]]): # @ApiMember(Description="Enter the company you want to see news for, if blank and you are an admin, your company id will be used", ParameterType="path") company_id: Optional[str] = None """ Enter the company you want to see news for, if blank and you are an admin, your company id will be used """ # @ApiMember(DataType="dateTime", Description="Enter the From Date you want to see news from, only allowed if admin", ParameterType="query") valid_from: Optional[datetime.datetime] = None """ Enter the From Date you want to see news from, only allowed if admin """ # @ApiMember(DataType="dateTime", Description="Enter the To Date you want to see news to, only allowed if admin", ParameterType="query") valid_to: Optional[datetime.datetime] = None """ Enter the To Date you want to see news to, only allowed if admin """ # @ApiMember(DataType="bool", Description="If you want to include the connected days for the schedule", ParameterType="query") include_recurring_days: bool = False """ If you want to include the connected days for the schedule """ # @ApiMember(DataType="bool", Description="If you want to include the connected resources for the schedule", ParameterType="query") include_connected_resources: bool = False """ If you want to include the connected resources for the schedule """ # @ApiMember(DataType="bool", Description="If you want to include the connected services for the schedule", ParameterType="query") include_connected_services: bool = False """ If you want to include the connected services for the schedule """ # @ApiMember(DataType="bool", Description="If you want to include the exceptions for the schedule", ParameterType="query") include_exceptions: bool = False """ If you want to include the exceptions for the schedule """ # @ApiMember(DataType="boolean", Description="Use this parameter if you want to only show active news") active: Optional[bool] = None """ Use this parameter if you want to only show active news """ # @ApiMember(DataType="bool", Description="If you want to include the connected dates for the schedule. This is used when the schedule having setting, different opening hours per week (not rolling schedule using days of week).", ParameterType="query") include_schedule_dates: bool = False """ If you want to include the connected dates for the schedule. This is used when the schedule having setting, different opening hours per week (not rolling schedule using days of week). """