""" Options: Date: 2024-11-23 08:57:30 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: CalculateTotalPriceOnService.* #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 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class PriceInterval: # @ApiMember(Description="The start date and time for the price to be calculated. Normally the booking start datetime.", IsRequired=true) from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1)) """ The start date and time for the price to be calculated. Normally the booking start datetime. """ # @ApiMember(Description="The end date and time for the price to be calculated.Normally the booking end datetime. If nothing entered it will use the service length.") to: Optional[datetime.datetime] = None """ The end date and time for the price to be calculated.Normally the booking end datetime. If nothing entered it will use the service length. """ @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class RebateCodeTypeResponse: id: int = 0 name: Optional[str] = None description: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class AppliedRebateCodesResponse: rebate_code_sign: Optional[str] = None rebate_code_value: int = 0 rebate_code_type: Optional[RebateCodeTypeResponse] = None rebate_code_id: int = 0 rebate_amount: float = 0.0 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class TotalPricePriceDetail: quantity: int = 0 price: float = 0.0 vat_amount: float = 0.0 description: Optional[str] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class TotalPriceInformationResponse: price_sign: Optional[str] = None currency_id: Optional[str] = None total_price: float = 0.0 total_vat_amount: float = 0.0 total_price_before_rebate: float = 0.0 applied_codes: Optional[List[AppliedRebateCodesResponse]] = None price_details: Optional[List[TotalPricePriceDetail]] = None # @Route("/services/{Id}/calculateprice", "PUT") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class CalculateTotalPriceOnService(IReturn[TotalPriceInformationResponse], ICompany): # @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="Id of the service", IsRequired=true, ParameterType="path") id: int = 0 """ Id of the service """ # @ApiMember(Description="The price interval to be used for calculations", IsRequired=true) interval: Optional[PriceInterval] = None """ The price interval to be used for calculations """ # @ApiMember(Description="Rebate codes applied to booking") rebate_code_ids: Optional[List[int]] = None """ Rebate codes applied to booking """ # @ApiMember(Description="If you have selected to include the prices, here you can include the quantities to book to get the correct total price.") quantities: Optional[List[QuantityToBook]] = None """ If you have selected to include the prices, here you can include the quantities to book to get the correct total price. """ # @ApiMember(Description="") customer_email: Optional[str] = None """ """