Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /services/prices/{Id} | Update a price | Update a price on a service |
---|
namespace BokaMera.API.ServiceModel.Dtos
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type DayOfWeekDto() =
member val DayOfWeekId:Int32 = new Int32() with get,set
member val DotNetDayOfWeekId:Int32 = new Int32() with get,set
member val DayOfWeek:String = null with get,set
[<AllowNullLiteral>]
type GroupBookingSettings() =
member val Active:Boolean = new Boolean() with get,set
member val Min:Int32 = new Int32() with get,set
member val Max:Int32 = new Int32() with get,set
[<AllowNullLiteral>]
type MultipleResourceSettings() =
member val Active:Boolean = new Boolean() with get,set
member val Min:Int32 = new Int32() with get,set
member val Max:Int32 = new Int32() with get,set
[<AllowNullLiteral>]
type ServiceInfoResponse() =
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
member val ImageUrl:Uri = null with get,set
member val LengthInMinutes:Nullable<Int32> = new Nullable<Int32>() with get,set
member val MaxNumberOfSpotsPerBooking:Int32 = new Int32() with get,set
member val MinNumberOfSpotsPerBooking:Int32 = new Int32() with get,set
member val GroupBooking:GroupBookingSettings = null with get,set
member val MultipleResource:MultipleResourceSettings = null with get,set
member val IsGroupBooking:Boolean = new Boolean() with get,set
member val IsPaymentEnabled:Boolean = new Boolean() with get,set
[<AllowNullLiteral>]
type ServicePriceResponse() =
///<summary>
///The company id
///</summary>
[<ApiMember(Description="The company id")>]
member val CompanyId:Guid = new Guid() with get,set
///<summary>
///The price id
///</summary>
[<ApiMember(Description="The price id")>]
member val Id:Int32 = new Int32() with get,set
///<summary>
///The service id
///</summary>
[<ApiMember(Description="The service id")>]
member val ServiceId:Int32 = new Int32() with get,set
///<summary>
///The price
///</summary>
[<ApiMember(Description="The price")>]
member val Price:Double = new Double() with get,set
///<summary>
///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
///</summary>
[<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")>]
member val CalculationTypeId:Int32 = new Int32() with get,set
///<summary>
///The price currency
///</summary>
[<ApiMember(Description="The price currency")>]
member val CurrencyId:String = null with get,set
///<summary>
///The price sign
///</summary>
[<ApiMember(Description="The price sign")>]
member val PriceSign:String = null with get,set
///<summary>
///The price VAT in percent
///</summary>
[<ApiMember(Description="The price VAT in percent")>]
member val VAT:Decimal = new Decimal() with get,set
///<summary>
///The price category if price has a category
///</summary>
[<ApiMember(Description="The price category if price has a category")>]
member val Category:String = null with get,set
///<summary>
///The price text to display
///</summary>
[<ApiMember(Description="The price text to display")>]
member val PriceText:String = null with get,set
///<summary>
///The valid from date for the price.
///</summary>
[<ApiMember(Description="The valid from date for the price.")>]
member val From:DateTime = new DateTime() with get,set
///<summary>
///The valid to date for the price.
///</summary>
[<ApiMember(Description="The valid to date for the price.")>]
member val To:DateTime = new DateTime() with get,set
///<summary>
///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.
///</summary>
[<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.")>]
member val DaysOfWeek:ResizeArray<DayOfWeekDto> = new ResizeArray<DayOfWeekDto>() with get,set
///<summary>
///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.
///</summary>
[<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.")>]
member val FromTime:Nullable<TimeSpan> = new Nullable<TimeSpan>() with get,set
///<summary>
///If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
///</summary>
[<ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")>]
member val ToTime:Nullable<TimeSpan> = new Nullable<TimeSpan>() with get,set
member val Service:ServiceInfoResponse = null with get,set
///<summary>
///If the price is only valid for a specific time span
///</summary>
[<ApiMember(Description="If the price is only valid for a specific time span")>]
member val IsTimeSpecific:Boolean = new Boolean() with get,set
///<summary>
///If the price is only valid for specific days of week
///</summary>
[<ApiMember(Description="If the price is only valid for specific days of week")>]
member val IsDaysOfWeekSpecific:Boolean = new Boolean() with get,set
///<summary>
///If the price is Weighted
///</summary>
[<ApiMember(Description="If the price is Weighted")>]
member val IsWeighted:Boolean = new Boolean() with get,set
[<ValidateRequest(Validator="IsAuthenticated")>]
[<AllowNullLiteral>]
type UpdateServicePrice() =
///<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 price
///</summary>
[<ApiMember(Description="Id of the price", IsRequired=true, ParameterType="path")>]
member val Id:Int32 = new Int32() with get,set
///<summary>
///The price
///</summary>
[<ApiMember(Description="The price")>]
member val Price:Double = new Double() with get,set
///<summary>
///The price currency
///</summary>
[<ApiMember(Description="The price currency")>]
member val CurrencyId:String = null with get,set
///<summary>
///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
///</summary>
[<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")>]
member val CalculationTypeId:Int32 = new Int32() with get,set
///<summary>
///The price VAT in percent
///</summary>
[<ApiMember(Description="The price VAT in percent")>]
member val VAT:Decimal = new Decimal() with get,set
///<summary>
///The price category if price has a category
///</summary>
[<ApiMember(Description="The price category if price has a category")>]
member val Category:String = null with get,set
///<summary>
///The valid from date for the price.
///</summary>
[<ApiMember(Description="The valid from date for the price.")>]
member val From:DateTime = new DateTime() with get,set
///<summary>
///The valid to date for the price.
///</summary>
[<ApiMember(Description="The valid to date for the price.")>]
member val To:DateTime = new DateTime() with get,set
///<summary>
///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.
///</summary>
[<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.")>]
member val DaysOfWeek:Int32[] = [||] with get,set
///<summary>
///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.
///</summary>
[<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.")>]
member val FromTime:Nullable<TimeSpan> = new Nullable<TimeSpan>() with get,set
///<summary>
///If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
///</summary>
[<ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")>]
member val ToTime:Nullable<TimeSpan> = new Nullable<TimeSpan>() with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /services/prices/{Id} HTTP/1.1
Host: testapi.bokamera.se
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","Id":0,"Price":0,"CurrencyId":"String","CalculationTypeId":0,"VAT":0,"Category":"String","DaysOfWeek":[0],"FromTime":"00:00:00","ToTime":"00:00:00"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Id":0,"ServiceId":0,"Price":0,"CalculationTypeId":0,"CurrencyId":"String","PriceSign":"String","VAT":0,"Category":"String","PriceText":"String","DaysOfWeek":[{"DayOfWeekId":0,"DotNetDayOfWeekId":0,"DayOfWeek":"String"}],"FromTime":"00:00:00","ToTime":"00:00:00","Service":{"Id":0,"Name":"String","Description":"String","LengthInMinutes":0,"MaxNumberOfSpotsPerBooking":0,"MinNumberOfSpotsPerBooking":0,"GroupBooking":{"Active":false,"Min":0,"Max":0},"MultipleResource":{"Active":false,"Min":0,"Max":0},"IsGroupBooking":false,"IsPaymentEnabled":false},"IsTimeSpecific":false,"IsDaysOfWeekSpecific":false,"IsWeighted":false}