""" Options: Date: 2024-11-21 11:27:57 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: DeleteServicePrice.* #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 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 min_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 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 """ # @Route("/services/prices/{Id}", "DELETE") # @ValidateRequest(Validator="IsAuthenticated") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class DeleteServicePrice(IReturn[ServicePriceResponse]): # @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.") company_id: Optional[str] = None """ The company id, if empty will use the company id for the user you are logged in with. """ # @ApiMember(Description="The price id") id: int = 0 """ The price id """