""" Options: Date: 2024-06-26 09:13:54 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: ServicePricesQuery.* #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 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 Currency(BaseModel): # @Required() name: Optional[str] = None # @Required() currency_sign: Optional[str] = None # @Required() active: bool = False modified_date: Optional[datetime.datetime] = None # @Required() id: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class Customer(BaseModel, IUser, ICustomFieldTable): identity_id: int = 0 id: Optional[str] = None # @Ignore() customer_id: Optional[str] = None # @Ignore() access_keys: Optional[IList[UserAccessKeys]] = None email: Optional[str] = None # @Ignore() external_references: Optional[IList[ExternalReference]] = None # @Ignore() custom_fields_config: Optional[IList[CustomFieldConfig]] = None # @Ignore() custom_fields_data: Optional[IList[CustomFieldDataResponse]] = None # @Ignore() comments: Optional[IList[CustomerComment]] = None firstname: Optional[str] = None # @Ignore() image_url: Optional[str] = None # @Required() active: bool = False facebook_username: Optional[str] = None # @Required() updated: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created: datetime.datetime = datetime.datetime(1, 1, 1) ip_address: Optional[str] = None modified_date: Optional[datetime.datetime] = 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 user_id: Optional[str] = None lastname: Optional[str] = None phone: 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 # @Required() company_id: Optional[str] = None subscribed_to_newsletter: bool = False @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RebateCodeType(BaseModel): # @Required() name: Optional[str] = None description: Optional[str] = None modified_date: Optional[datetime.datetime] = None id: int = 0 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 RebateCodeDayOfWeekRelation(BaseModel): # @Ignore() day_of_week: Optional[BokaMeraDayOfWeek] = None # @Required() day_of_week_id: int = 0 # @Required() rebate_code_id: int = 0 # @Required() company_id: Optional[str] = None id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RebateCodeServiceRelation(BaseModel): # @Required() company_id: Optional[str] = None # @Required() service_id: int = 0 # @Required() rebate_code_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RebateCodeBookingPriceRelation(BaseModel): # @Required() company_id: Optional[str] = None # @Required() price_id: int = 0 # @Required() rebate_code_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RebateCodeCustomerRelation(BaseModel): # @Required() company_id: Optional[str] = None # @Required() customer_id: Optional[str] = None # @Required() rebate_code_id: int = 0 id: int = 0 modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DaysOfWeek(BaseModel): # @Required() day_of_week: Optional[str] = None # @Required() day_of_week_translation: Optional[str] = None day_of_week_active: Optional[bool] = None day_of_week_sort_order: Optional[int] = None modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RebateCodeStatus(BaseModel): # @Required() name: Optional[str] = None description: Optional[str] = None modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RebateCode(BaseModel): # @References(typeof(RebateCodeType)) rebate_code_type_id: int = 0 rebate_code_type_info: Optional[RebateCodeType] = None # @References(typeof(RebateCodeStatus)) rebate_code_status_id: int = 0 rebate_code_status_info: Optional[RebateCodeType] = None # @Ignore() services: Optional[List[Service]] = None rebate_code_day_of_week_relation: Optional[List[RebateCodeDayOfWeekRelation]] = None rebate_code_service_relation: Optional[List[RebateCodeServiceRelation]] = None rebate_code_booking_price_relation: Optional[List[RebateCodeBookingPriceRelation]] = None rebate_code_customer_relation: Optional[List[RebateCodeCustomerRelation]] = None # @Ignore() days_of_week: Optional[List[DaysOfWeek]] = None # @Ignore() customers: Optional[List[Customer]] = None # @Ignore() rebate_code_status: Optional[RebateCodeStatus] = None # @Ignore() rebate_code_type: Optional[RebateCodeType] = None # @Ignore() current_number_of_uses_per_customer: int = 0 # @Ignore() is_specific_by_day_of_week: bool = False # @Ignore() active: bool = False company_id: Optional[str] = None # @Required() valid_from: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() valid_to: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() rebate_code_sign: Optional[str] = None # @Required() rebate_code_value: int = 0 # @Required() max_number_of_uses: int = 0 # @Required() max_number_of_uses_per_customer: int = 0 # @Required() number_of_uses_used: int = 0 personal_note: Optional[str] = None # @Required() created_by: Optional[str] = None # @Required() created: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() updated_by: Optional[str] = None # @Required() updated: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() from_time: datetime.timedelta = datetime.timedelta() # @Required() to_time: datetime.timedelta = datetime.timedelta() modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class PriceMapping(BaseModel): # @Required() company_id: Optional[str] = None # @Required() id: Optional[str] = None # @Required() price_id: int = 0 reference_type: Optional[str] = None external_reference: Optional[str] = None # @Required() updated_date: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created_date: datetime.datetime = datetime.datetime(1, 1, 1) modified_date: Optional[datetime.datetime] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ServicePriceDayOfWeekRelation(BaseModel): # @Ignore() day_of_week: Optional[BokaMeraDayOfWeek] = None # @Required() company_id: Optional[str] = None # @Required() service_price_id: int = 0 # @Required() day_of_week_id: int = 0 modified_date: Optional[datetime.datetime] = None id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ServicePrice(BaseModel, IInterval): # @References(typeof(Currency)) currency_id: Optional[str] = None currency_info: Optional[Currency] = None # @Ignore() service: Optional[Service] = None # @Ignore() price_mappings: Optional[List[PriceMapping]] = None # @Ignore() is_time_specific: bool = False # @Ignore() is_days_of_week_specific: bool = False day_of_weeks: Optional[List[ServicePriceDayOfWeekRelation]] = None # @Ignore() price_before_rebate: Optional[float] = None # @Ignore() rebate_codes_applied: Optional[List[RebateCode]] = None # @Ignore() price_text: Optional[str] = None # @Ignore() is_weighted: bool = False # @Ignore() overlapping_prices: Optional[List[ServicePrice]] = None # @Required() company_id: Optional[str] = None id: int = 0 # @Required() service_id: int = 0 price: Optional[float] = None # @Required() updated: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() created: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() from_time: datetime.timedelta = datetime.timedelta() # @Required() to_time: datetime.timedelta = datetime.timedelta() # @Required() vat: Decimal = decimal.Decimal(0) category: Optional[str] = None modified_date: Optional[datetime.datetime] = None # @Required() from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) # @Required() to: datetime.datetime = datetime.datetime(1, 1, 1) # @Required() calculation_type_id: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class GroupBookingSettings: active: bool = False min: int = 0 max: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class MultipleResourceSettings: active: bool = False min: int = 0 max: int = 0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ServiceInfoResponse: id: int = 0 name: Optional[str] = None description: Optional[str] = None image_url: Optional[str] = None length_in_minutes: Optional[int] = None max_number_of_spots_per_booking: int = 0 group_booking: Optional[GroupBookingSettings] = None multiple_resource: Optional[MultipleResourceSettings] = None is_group_booking: bool = False is_payment_enabled: 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 Customer: city: Optional[str] = None country_code: Optional[str] = None identity_number: Optional[str] = None email: Optional[str] = None first_name: Optional[str] = None last_name: Optional[str] = None phone: Optional[str] = None postal_code: Optional[str] = None street: Optional[str] = None reference: Optional[str] = None type: Optional[CustomerType] = None class Currency(IntEnum): SEK = 1 EUR = 2 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ServicePriceResponse: # @ApiMember(Description="The company id") company_id: Optional[str] = None """ The company id """ # @ApiMember(Description="The price id") id: int = 0 """ The price id """ # @ApiMember(Description="The service id") service_id: int = 0 """ The service id """ # @ApiMember(Description="The price") price: float = 0.0 """ The price """ # @ApiMember(Description="The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day") calculation_type_id: int = 0 """ The price calculation type id, 1 = Normal, price is for the service total duration, 2 = Price is per minute, 3 = Price is per hour, 4= Price is per day """ # @ApiMember(Description="The price currency") currency_id: Optional[str] = None """ The price currency """ # @ApiMember(Description="The price sign") price_sign: Optional[str] = None """ The price sign """ # @ApiMember(Description="The price VAT in percent") vat: Decimal = decimal.Decimal(0) """ The price VAT in percent """ # @ApiMember(Description="The price category if price has a category") category: Optional[str] = None """ The price category if price has a category """ # @ApiMember(Description="The price text to display") price_text: Optional[str] = None """ The price text to display """ # @ApiMember(Description="The valid from date for the price.") from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) """ The valid from date for the price. """ # @ApiMember(Description="The valid to date for the price.") to: datetime.datetime = datetime.datetime(1, 1, 1) """ The valid to date for the price. """ # @ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.") days_of_week: Optional[List[DayOfWeekDto]] = None """ If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. """ # @ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.") from_time: Optional[datetime.timedelta] = None """ If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update. """ # @ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.") to_time: Optional[datetime.timedelta] = None """ If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters. """ service: Optional[ServiceInfoResponse] = None # @ApiMember(Description="If the price is only valid for a specific time span") is_time_specific: bool = False """ If the price is only valid for a specific time span """ # @ApiMember(Description="If the price is only valid for specific days of week") is_days_of_week_specific: bool = False """ If the price is only valid for specific days of week """ # @ApiMember(Description="If the price is Weighted") is_weighted: bool = False """ If the price is Weighted """ # @Route("/services/prices", "GET") # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class ServicePricesQuery(QueryDb2[ServicePrice, ServicePriceResponse], IReturn[QueryResponse[ServicePriceResponse]]): # @ApiMember(Description="Company to show services for", ParameterType="query") company_id: Optional[str] = None """ Company to show services for """ # @ApiMember(Description="Service id", ParameterType="query") service_id: Optional[int] = None """ Service id """ # @ApiMember(Description="Only get prices for active services", ParameterType="query") active: Optional[bool] = None """ Only get prices for active services """ # @ApiMember(DataType="int", Description="The max limit of records you want to retrieve, default is 100", ParameterType="query") max_limit: Optional[int] = None """ The max limit of records you want to retrieve, default is 100 """ # @ApiMember(DataType="boolean", Description="If you want to include the service information for the booking", ParameterType="query") include_service_information: bool = False """ If you want to include the service information for the booking """