/* Options: Date: 2026-07-13 14:22:17 Version: 10.05 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: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; abstract class ICompany { String? CompanyId; } class PriceInterval implements IConvertible { /** * The start date and time for the price to be calculated. Normally the booking start datetime. */ // @ApiMember(Description="The start date and time for the price to be calculated. Normally the booking start datetime.", IsRequired=true) DateTime From = DateTime(0); /** * 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. */ // @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.") DateTime? To; PriceInterval({this.From,this.To}); PriceInterval.fromJson(Map json) { fromMap(json); } fromMap(Map json) { From = JsonConverters.fromJson(json['From'],'DateTime',context!); To = JsonConverters.fromJson(json['To'],'DateTime',context!); return this; } Map toJson() => { 'From': JsonConverters.toJson(From,'DateTime',context!), 'To': JsonConverters.toJson(To,'DateTime',context!) }; getTypeName() => "PriceInterval"; TypeContext? context = _ctx; } class RebateCodeTypeResponse implements IConvertible { int Id = 0; String Name = ""; String Description = ""; RebateCodeTypeResponse({this.Id,this.Name,this.Description}); RebateCodeTypeResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Name = json['Name']; Description = json['Description']; return this; } Map toJson() => { 'Id': Id, 'Name': Name, 'Description': Description }; getTypeName() => "RebateCodeTypeResponse"; TypeContext? context = _ctx; } class AppliedRebateCodesResponse implements IConvertible { String RebateCodeSign = ""; int RebateCodeValue = 0; RebateCodeTypeResponse RebateCodeType; int RebateCodeId = 0; double RebateAmount = 0; AppliedRebateCodesResponse({this.RebateCodeSign,this.RebateCodeValue,this.RebateCodeType,this.RebateCodeId,this.RebateAmount}); AppliedRebateCodesResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { RebateCodeSign = json['RebateCodeSign']; RebateCodeValue = json['RebateCodeValue']; RebateCodeType = JsonConverters.fromJson(json['RebateCodeType'],'RebateCodeTypeResponse',context!); RebateCodeId = json['RebateCodeId']; RebateAmount = JsonConverters.toDouble(json['RebateAmount']); return this; } Map toJson() => { 'RebateCodeSign': RebateCodeSign, 'RebateCodeValue': RebateCodeValue, 'RebateCodeType': JsonConverters.toJson(RebateCodeType,'RebateCodeTypeResponse',context!), 'RebateCodeId': RebateCodeId, 'RebateAmount': RebateAmount }; getTypeName() => "AppliedRebateCodesResponse"; TypeContext? context = _ctx; } class TotalPricePriceDetail implements IConvertible { int Quantity = 0; double Price = 0; double VatAmount = 0; String Description = ""; int ArticleId = 0; int MaxQuantity = 0; TotalPricePriceDetail({this.Quantity,this.Price,this.VatAmount,this.Description,this.ArticleId,this.MaxQuantity}); TotalPricePriceDetail.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Quantity = json['Quantity']; Price = JsonConverters.toDouble(json['Price']); VatAmount = JsonConverters.toDouble(json['VatAmount']); Description = json['Description']; ArticleId = json['ArticleId']; MaxQuantity = json['MaxQuantity']; return this; } Map toJson() => { 'Quantity': Quantity, 'Price': Price, 'VatAmount': VatAmount, 'Description': Description, 'ArticleId': ArticleId, 'MaxQuantity': MaxQuantity }; getTypeName() => "TotalPricePriceDetail"; TypeContext? context = _ctx; } class TotalPriceInformationResponse implements IConvertible { String PriceSign = ""; String CurrencyId = ""; double TotalPrice = 0; double TotalVatAmount = 0; double TotalPriceBeforeRebate = 0; double PriceDifference = 0; List AppliedCodes = []; List PriceDetails = []; TotalPriceInformationResponse({this.PriceSign,this.CurrencyId,this.TotalPrice,this.TotalVatAmount,this.TotalPriceBeforeRebate,this.PriceDifference,this.AppliedCodes,this.PriceDetails}); TotalPriceInformationResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { PriceSign = json['PriceSign']; CurrencyId = json['CurrencyId']; TotalPrice = JsonConverters.toDouble(json['TotalPrice']); TotalVatAmount = JsonConverters.toDouble(json['TotalVatAmount']); TotalPriceBeforeRebate = JsonConverters.toDouble(json['TotalPriceBeforeRebate']); PriceDifference = JsonConverters.toDouble(json['PriceDifference']); AppliedCodes = JsonConverters.fromJson(json['AppliedCodes'],'List',context!); PriceDetails = JsonConverters.fromJson(json['PriceDetails'],'List',context!); return this; } Map toJson() => { 'PriceSign': PriceSign, 'CurrencyId': CurrencyId, 'TotalPrice': TotalPrice, 'TotalVatAmount': TotalVatAmount, 'TotalPriceBeforeRebate': TotalPriceBeforeRebate, 'PriceDifference': PriceDifference, 'AppliedCodes': JsonConverters.toJson(AppliedCodes,'List',context!), 'PriceDetails': JsonConverters.toJson(PriceDetails,'List',context!) }; getTypeName() => "TotalPriceInformationResponse"; TypeContext? context = _ctx; } // @Route("/services/{Id}/calculateprice", "PUT") class CalculateTotalPriceOnService implements IReturn, ICompany, IConvertible, IPut { /** * The company id, if empty will use the company id for the user you are logged in with. */ // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.") String? CompanyId; /** * Id of the service */ // @ApiMember(Description="Id of the service", IsRequired=true, ParameterType="path") int Id = 0; /** * Optional booking id. If provided, the response will also contain the price difference compared to the existing booking price. */ // @ApiMember(Description="Optional booking id. If provided, the response will also contain the price difference compared to the existing booking price.") int? BookingId; /** * The price interval to be used for calculations */ // @ApiMember(Description="The price interval to be used for calculations", IsRequired=true) PriceInterval Interval; /** * Rebate codes applied to booking */ // @ApiMember(Description="Rebate codes applied to booking") List RebateCodeIds = []; /** * DEPRECATED — use Articles instead. Article ids that should be included in the price calculation. The articles must be of type ServiceAddonArticle and connected to the service. Duplicate ids are counted as quantity. */ // @ApiMember(Description="DEPRECATED — use Articles instead. Article ids that should be included in the price calculation. The articles must be of type ServiceAddonArticle and connected to the service. Duplicate ids are counted as quantity.") List ArticleIds = []; /** * Articles (with quantity) that should be included in the price calculation. The articles must be of type ServiceAddonArticle and connected to the service. */ // @ApiMember(Description="Articles (with quantity) that should be included in the price calculation. The articles must be of type ServiceAddonArticle and connected to the service.") List Articles = []; /** * If you have selected to include the prices, here you can include the quantities to book to get the correct total price. */ // @ApiMember(Description="If you have selected to include the prices, here you can include the quantities to book to get the correct total price.") List Quantities = []; /** * */ // @ApiMember(Description="") String CustomerEmail = ""; CalculateTotalPriceOnService({this.CompanyId,this.Id,this.BookingId,this.Interval,this.RebateCodeIds,this.ArticleIds,this.Articles,this.Quantities,this.CustomerEmail}); CalculateTotalPriceOnService.fromJson(Map json) { fromMap(json); } fromMap(Map json) { CompanyId = json['CompanyId']; Id = json['Id']; BookingId = json['BookingId']; Interval = JsonConverters.fromJson(json['Interval'],'PriceInterval',context!); RebateCodeIds = JsonConverters.fromJson(json['RebateCodeIds'],'List',context!); ArticleIds = JsonConverters.fromJson(json['ArticleIds'],'List',context!); Articles = JsonConverters.fromJson(json['Articles'],'List',context!); Quantities = JsonConverters.fromJson(json['Quantities'],'List',context!); CustomerEmail = json['CustomerEmail']; return this; } Map toJson() => { 'CompanyId': CompanyId, 'Id': Id, 'BookingId': BookingId, 'Interval': JsonConverters.toJson(Interval,'PriceInterval',context!), 'RebateCodeIds': JsonConverters.toJson(RebateCodeIds,'List',context!), 'ArticleIds': JsonConverters.toJson(ArticleIds,'List',context!), 'Articles': JsonConverters.toJson(Articles,'List',context!), 'Quantities': JsonConverters.toJson(Quantities,'List',context!), 'CustomerEmail': CustomerEmail }; createResponse() => TotalPriceInformationResponse(); getResponseTypeName() => "TotalPriceInformationResponse"; getTypeName() => "CalculateTotalPriceOnService"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: { 'ICompany': TypeInfo(TypeOf.Interface), 'PriceInterval': TypeInfo(TypeOf.Class, create:() => PriceInterval()), 'RebateCodeTypeResponse': TypeInfo(TypeOf.Class, create:() => RebateCodeTypeResponse()), 'AppliedRebateCodesResponse': TypeInfo(TypeOf.Class, create:() => AppliedRebateCodesResponse()), 'TotalPricePriceDetail': TypeInfo(TypeOf.Class, create:() => TotalPricePriceDetail()), 'TotalPriceInformationResponse': TypeInfo(TypeOf.Class, create:() => TotalPriceInformationResponse()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'List': TypeInfo(TypeOf.Class, create:() => []), 'CalculateTotalPriceOnService': TypeInfo(TypeOf.Class, create:() => CalculateTotalPriceOnService()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'ArticleToCreateBase': TypeInfo(TypeOf.Class, create:() => ArticleToCreateBase()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'QuantityToBook': TypeInfo(TypeOf.Class, create:() => QuantityToBook()), });