| PUT | /services/{Id}/calculateprice | Calculate price on service | Calculate an price on a service. |
|---|
namespace BokaMera.API.ServiceModel.Dtos
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type RebateCodeTypeResponse() =
member val Id:Int32 = new Int32() with get,set
member val Name:String = null with get,set
member val Description:String = null with get,set
[<AllowNullLiteral>]
type AppliedRebateCodesResponse() =
member val RebateCodeSign:String = null with get,set
member val RebateCodeValue:Int32 = new Int32() with get,set
member val RebateCodeType:RebateCodeTypeResponse = null with get,set
member val RebateCodeId:Int32 = new Int32() with get,set
member val RebateAmount:Double = new Double() with get,set
[<AllowNullLiteral>]
type TotalPricePriceDetail() =
member val Quantity:Int32 = new Int32() with get,set
member val Price:Double = new Double() with get,set
member val VatAmount:Double = new Double() with get,set
member val Description:String = null with get,set
[<AllowNullLiteral>]
type TotalPriceInformationResponse() =
member val PriceSign:String = null with get,set
member val CurrencyId:String = null with get,set
member val TotalPrice:Double = new Double() with get,set
member val TotalVatAmount:Double = new Double() with get,set
member val TotalPriceBeforeRebate:Double = new Double() with get,set
member val PriceDifference:Double = new Double() with get,set
member val AppliedCodes:ResizeArray<AppliedRebateCodesResponse> = null with get,set
member val PriceDetails:ResizeArray<TotalPricePriceDetail> = null with get,set
[<AllowNullLiteral>]
type PriceInterval() =
///<summary>
///The start date and time for the price to be calculated. Normally the booking start datetime.
///</summary>
[<ApiMember(Description="The start date and time for the price to be calculated. Normally the booking start datetime.", IsRequired=true)>]
member val From:DateTime = new DateTime() with get,set
///<summary>
///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.
///</summary>
[<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.")>]
member val To:Nullable<DateTime> = new Nullable<DateTime>() with get,set
[<AllowNullLiteral>]
type ArticleToCreateBase() =
member val ArticleId:Int32 = new Int32() with get,set
member val Quantity:Int32 = new Int32() with get,set
[<AllowNullLiteral>]
type QuantityToBook() =
///<summary>
///If service has a price, enter the price id for that price. If no price exists for the service set 0 as PriceId. If you put 0 and a price exists, it will use that price (only works if just one price exists for the current selected date to book)
///</summary>
[<ApiMember(Description="If service has a price, enter the price id for that price. If no price exists for the service set 0 as PriceId. If you put 0 and a price exists, it will use that price (only works if just one price exists for the current selected date to book)", IsRequired=true)>]
member val PriceId:Int32 = new Int32() with get,set
///<summary>
///Set the number of spots or resources you want to book on the specific price category
///</summary>
[<ApiMember(Description="Set the number of spots or resources you want to book on the specific price category", IsRequired=true)>]
member val Quantity:Int32 = new Int32() with get,set
///<summary>
///If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.
///</summary>
[<ApiMember(Description="If the quantity you add should occupy a spot. Default is true. If no it will only be a row that includes price information.")>]
member val OccupiesSpot:Boolean = new Boolean() with get,set
[<AllowNullLiteral>]
type CalculateTotalPriceOnService() =
///<summary>
///The company id, if empty will use the company id for the user you are logged in with.
///</summary>
[<ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")>]
member val CompanyId:Nullable<Guid> = new Nullable<Guid>() with get,set
///<summary>
///Id of the service
///</summary>
[<ApiMember(Description="Id of the service", IsRequired=true, ParameterType="path")>]
member val Id:Int32 = new Int32() with get,set
///<summary>
///Optional booking id. If provided, the response will also contain the price difference compared to the existing booking price.
///</summary>
[<ApiMember(Description="Optional booking id. If provided, the response will also contain the price difference compared to the existing booking price.")>]
member val BookingId:Nullable<Int32> = new Nullable<Int32>() with get,set
///<summary>
///The price interval to be used for calculations
///</summary>
[<ApiMember(Description="The price interval to be used for calculations", IsRequired=true)>]
member val Interval:PriceInterval = null with get,set
///<summary>
///Rebate codes applied to booking
///</summary>
[<ApiMember(Description="Rebate codes applied to booking")>]
member val RebateCodeIds:ResizeArray<Int32> = null with get,set
///<summary>
///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.
///</summary>
[<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.")>]
member val ArticleIds:ResizeArray<Int32> = null with get,set
///<summary>
///Articles (with quantity) that should be included in the price calculation. The articles must be of type ServiceAddonArticle and connected to the service.
///</summary>
[<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.")>]
member val Articles:ArticleToCreateBase[] = null with get,set
///<summary>
///If you have selected to include the prices, here you can include the quantities to book to get the correct total price.
///</summary>
[<ApiMember(Description="If you have selected to include the prices, here you can include the quantities to book to get the correct total price.")>]
member val Quantities:QuantityToBook[] = null with get,set
///<summary>
///
///</summary>
[<ApiMember(Description="")>]
member val CustomerEmail:String = null with get,set
F# CalculateTotalPriceOnService DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /services/{Id}/calculateprice HTTP/1.1
Host: testapi.bokamera.se
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","Id":0,"BookingId":0,"Interval":{"To":"0001-01-01T00:00:00"},"RebateCodeIds":[0],"ArticleIds":[0],"Articles":[{"ArticleId":0,"Quantity":0}],"Quantities":[{"PriceId":0,"Quantity":0,"OccupiesSpot":false}],"CustomerEmail":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"PriceSign":"String","CurrencyId":"String","TotalPrice":0,"TotalVatAmount":0,"TotalPriceBeforeRebate":0,"PriceDifference":0,"AppliedCodes":[{"RebateCodeSign":"String","RebateCodeValue":0,"RebateCodeType":{"Id":0,"Name":"String","Description":"String"},"RebateCodeId":0,"RebateAmount":0}],"PriceDetails":[{"Quantity":0,"Price":0,"VatAmount":0,"Description":"String"}]}