/* Options: Date: 2024-11-21 12:00:06 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: 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; /** * 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; 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; RebateCodeTypeResponse? RebateCodeType; int? RebateCodeId; double? RebateAmount; 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; double? Price; double? VatAmount; String? Description; TotalPricePriceDetail({this.Quantity,this.Price,this.VatAmount,this.Description}); 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']; return this; } Map toJson() => { 'Quantity': Quantity, 'Price': Price, 'VatAmount': VatAmount, 'Description': Description }; getTypeName() => "TotalPricePriceDetail"; TypeContext? context = _ctx; } class TotalPriceInformationResponse implements IConvertible { String? PriceSign; String? CurrencyId; double? TotalPrice; double? TotalVatAmount; double? TotalPriceBeforeRebate; List? AppliedCodes; List? PriceDetails; TotalPriceInformationResponse({this.PriceSign,this.CurrencyId,this.TotalPrice,this.TotalVatAmount,this.TotalPriceBeforeRebate,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']); 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, '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; /** * 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; /** * 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.Interval,this.RebateCodeIds,this.Quantities,this.CustomerEmail}); CalculateTotalPriceOnService.fromJson(Map json) { fromMap(json); } fromMap(Map json) { CompanyId = json['CompanyId']; Id = json['Id']; Interval = JsonConverters.fromJson(json['Interval'],'PriceInterval',context!); RebateCodeIds = JsonConverters.fromJson(json['RebateCodeIds'],'List',context!); Quantities = JsonConverters.fromJson(json['Quantities'],'List',context!); CustomerEmail = json['CustomerEmail']; return this; } Map toJson() => { 'CompanyId': CompanyId, 'Id': Id, 'Interval': JsonConverters.toJson(Interval,'PriceInterval',context!), 'RebateCodeIds': JsonConverters.toJson(RebateCodeIds,'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:() => []), 'QuantityToBook': TypeInfo(TypeOf.Class, create:() => QuantityToBook()), });