Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
GET | /timeexceptions/collidingevents | Searches for collisions with existing bookings of the resource | Searches for existing bookings and investigates if a proposed time exception would collide with them, if so, the bookings should be unbooked to be able to create the time exception. A time exception must be either recurring (DaysOfWeek, ExceptionFromTime, ExceptionToTime is set) or non recurring (From and To are set). |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Imports BokaMera.API.ServiceModel.Enums
Namespace Global
Namespace BokaMera.API.ServiceModel.Dtos
Public Partial Class BookedCustomer
Public Overridable Property Id As Guid
Public Overridable Property Firstname As String
Public Overridable Property Lastname As String
Public Overridable Property Email As String
Public Overridable Property Phone As String
Public Overridable Property FacebookUserName As String
Public Overridable Property ImageUrl As String
Public Overridable Property CorporateIdentityNumber As String
Public Overridable Property InvoiceAddress1 As String
Public Overridable Property InvoiceAddress2 As String
Public Overridable Property InvoiceCity As String
Public Overridable Property InvoicePostalCode As String
Public Overridable Property InvoiceCountryCode As String
End Class
Public Partial Class BookingIntervalResponse
Public Overridable Property Id As Integer
Public Overridable Property CompanyId As Guid
Public Overridable Property From As Date
Public Overridable Property To As Date
Public Overridable Property Status As BookingStatusEnum
Public Overridable Property StatusId As Integer
Public Overridable Property StatusName As String
Public Overridable Property Customer As BookedCustomer
Public Overridable Property Service As ServiceInfoResponse
Public Overridable Property CreatedDate As Date
End Class
<ApiResponse(Description:="The request parameters was not valid", StatusCode:=400)>
<ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
<ApiResponse(Description:="You have too low privilegies to call this service", StatusCode:=403)>
<ValidateRequest(Validator:="IsAuthenticated")>
Public Partial Class CollidingBookingQuery
Public Sub New()
ResourceIds = New Integer(){}
DaysOfWeek = New Integer(){}
End Sub
'''<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.")>
Public Overridable Property CompanyId As Nullable(Of Guid)
'''<Summary>
'''Resource ids of the resource that should be matched against booked events
'''</Summary>
<ApiMember(Description:="Resource ids of the resource that should be matched against booked events")>
Public Overridable Property ResourceIds As Integer()
'''<Summary>
'''Time exception starting date
'''</Summary>
<ApiMember(Description:="Time exception starting date")>
Public Overridable Property From As Date
'''<Summary>
'''Time exception ending date
'''</Summary>
<ApiMember(Description:="Time exception ending date")>
Public Overridable Property To As Date
'''<Summary>
'''This value indicates the time of day when the time exception begins. Example: 10:00. If Recurring this will be the startime for each recurring day.
'''</Summary>
<ApiMember(Description:="This value indicates the time of day when the time exception begins. Example: 10:00. If Recurring this will be the startime for each recurring day.")>
Public Overridable Property FromTime As TimeSpan
'''<Summary>
'''This value indicates the time of day when the time exception ends. Example: 12:00. If Recurring this will be the endtime for each recurring day.
'''</Summary>
<ApiMember(Description:="This value indicates the time of day when the time exception ends. Example: 12:00. If Recurring this will be the endtime for each recurring day.")>
Public Overridable Property ToTime As TimeSpan
'''<Summary>
'''A comma separated list of which days this day exception belongs to, 1 = Monday .. 7 = Sunday
'''</Summary>
<ApiMember(Description:="A comma separated list of which days this day exception belongs to, 1 = Monday .. 7 = Sunday")>
Public Overridable Property DaysOfWeek As Integer()
'''<Summary>
'''If you want to include the service information for the booking
'''</Summary>
<ApiMember(DataType:="boolean", Description:="If you want to include the service information for the booking", ParameterType:="query")>
Public Overridable Property IncludeServiceInformation As Boolean
'''<Summary>
'''If you want to include the customer information for the booking
'''</Summary>
<ApiMember(DataType:="boolean", Description:="If you want to include the customer information for the booking", ParameterType:="query")>
Public Overridable Property IncludeCustomerInformation As Boolean
End Class
Public Partial Class CollidingBookingQueryResponse
Public Sub New()
ResourceIds = New Integer(){}
Bookings = New List(Of BookingIntervalResponse)
End Sub
'''<Summary>
'''Resource id of the resource that owns this exception
'''</Summary>
<ApiMember(Description:="Resource id of the resource that owns this exception")>
Public Overridable Property ResourceIds As Integer()
'''<Summary>
'''A list of bookings that would collide with the time exception
'''</Summary>
<ApiMember(Description:="A list of bookings that would collide with the time exception")>
Public Overridable Property Bookings As List(Of BookingIntervalResponse)
Public Overridable Property ResponseStatus As ResponseStatus
End Class
Public Partial Class GroupBookingSettings
Public Overridable Property Active As Boolean
Public Overridable Property Min As Integer
Public Overridable Property Max As Integer
End Class
Public Partial Class MultipleResourceSettings
Public Overridable Property Active As Boolean
Public Overridable Property Min As Integer
Public Overridable Property Max As Integer
End Class
Public Partial Class ServiceInfoResponse
Public Overridable Property Id As Integer
Public Overridable Property Name As String
Public Overridable Property Description As String
Public Overridable Property ImageUrl As Uri
Public Overridable Property LengthInMinutes As Nullable(Of Integer)
Public Overridable Property MaxNumberOfSpotsPerBooking As Integer
Public Overridable Property MinNumberOfSpotsPerBooking As Integer
Public Overridable Property GroupBooking As GroupBookingSettings
Public Overridable Property MultipleResource As MultipleResourceSettings
Public Overridable Property IsGroupBooking As Boolean
Public Overridable Property IsPaymentEnabled As Boolean
End Class
End Namespace
Namespace BokaMera.API.ServiceModel.Enums
Public Enum BookingStatusEnum
Booked = 1
Unbooked = 2
Reserved = 3
Canceled = 4
AwaitingPayment = 5
AwaitingPaymentNoTimeLimit = 6
Payed = 7
AwaitingPaymentRequestFromAdmin = 8
AwaitingPaymentFromProvider = 9
Invoiced = 10
End Enum
End Namespace
End Namespace
VB.NET CollidingBookingQuery 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.
GET /timeexceptions/collidingevents HTTP/1.1 Host: api.bokamera.se Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"ResourceIds":[0],"Bookings":[{"Id":0,"Status":"Booked","StatusId":0,"StatusName":"String","Customer":{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","FacebookUserName":"String","ImageUrl":"String","CorporateIdentityNumber":"String","InvoiceAddress1":"String","InvoiceAddress2":"String","InvoiceCity":"String","InvoicePostalCode":"String","InvoiceCountryCode":"String"},"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}}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}