BokaMera.API.Host

<back to all web services

TestDateSchedule

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/schedules/date/testTest date scheduleTest date schedule, only administrators are allowed to test schedules.
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 ExceptionText() = 
        member val Reason:String = null with get,set
        member val ReasonPublic:String = null with get,set

    [<AllowNullLiteral>]
    type AvailableTimesSum() = 
        member val From:DateTime = new DateTime() with get,set
        member val To:DateTime = new DateTime() with get,set
        member val Free:Int32 = new Int32() with get,set
        member val FreeSpots:Int32 = new Int32() with get,set
        member val ExceptionTexts:IEnumerable<ExceptionText> = null with get,set

    [<AllowNullLiteral>]
    type AvailableTimesResponse() = 
        member val CompanyId:Guid = new Guid() with get,set
        member val ServiceId:Int32 = new Int32() with get,set
        member val TimesFreeTextSingle:String = null with get,set
        member val TimesFreeTextMultiple:String = null with get,set
        member val Times:ResizeArray<AvailableTimesSum> = new ResizeArray<AvailableTimesSum>() with get,set

    [<AllowNullLiteral>]
    type AddDateScheduleDate() = 
        ///<summary>
        ///The from date for the timeslot
        ///</summary>
        [<ApiMember(Description="The from date for the timeslot", IsRequired=true)>]
        member val From:DateTime = new DateTime() with get,set

        ///<summary>
        ///The to date for the timeslot
        ///</summary>
        [<ApiMember(Description="The to date for the timeslot", IsRequired=true)>]
        member val To:DateTime = new DateTime() with get,set

    [<ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)>]
    [<ValidateRequest(Validator="IsAuthenticated")>]
    [<AllowNullLiteral>]
    type TestDateSchedule() = 
        ///<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>
        ///The dates for the schedule. This is the actual timeslots.
        ///</summary>
        [<ApiMember(Description="The dates for the schedule. This is the actual timeslots.", IsRequired=true)>]
        member val ScheduleDates:ResizeArray<AddDateScheduleDate> = new ResizeArray<AddDateScheduleDate>() with get,set

        ///<summary>
        ///From what datetime to show available times
        ///</summary>
        [<ApiMember(DataType="dateTime", Description="From what datetime to show available times", IsRequired=true, ParameterType="query")>]
        member val From:DateTime = new DateTime() with get,set

        ///<summary>
        ///To what datetime to show available times
        ///</summary>
        [<ApiMember(DataType="dateTime", Description="To what datetime to show available times", IsRequired=true, ParameterType="query")>]
        member val To:DateTime = new DateTime() with get,set

        ///<summary>
        ///The Service Duration
        ///</summary>
        [<ApiMember(Description="The Service Duration")>]
        member val ServiceId:Nullable<Int32> = new Nullable<Int32>() with get,set

F# TestDateSchedule DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /schedules/date/test HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	ScheduleDates: 
	[
		{
			
		}
	],
	ServiceId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ServiceId: 0,
	TimesFreeTextSingle: String,
	TimesFreeTextMultiple: String,
	Times: 
	[
		{
			Free: 0,
			FreeSpots: 0
		}
	]
}