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). |
---|
"use strict";
/** @typedef {number} */
export var BookingStatusEnum;
(function (BookingStatusEnum) {
BookingStatusEnum[BookingStatusEnum["Booked"] = 1] = "Booked"
BookingStatusEnum[BookingStatusEnum["Unbooked"] = 2] = "Unbooked"
BookingStatusEnum[BookingStatusEnum["Reserved"] = 3] = "Reserved"
BookingStatusEnum[BookingStatusEnum["Canceled"] = 4] = "Canceled"
BookingStatusEnum[BookingStatusEnum["AwaitingPayment"] = 5] = "AwaitingPayment"
BookingStatusEnum[BookingStatusEnum["AwaitingPaymentNoTimeLimit"] = 6] = "AwaitingPaymentNoTimeLimit"
BookingStatusEnum[BookingStatusEnum["Payed"] = 7] = "Payed"
BookingStatusEnum[BookingStatusEnum["AwaitingPaymentRequestFromAdmin"] = 8] = "AwaitingPaymentRequestFromAdmin"
BookingStatusEnum[BookingStatusEnum["AwaitingPaymentFromProvider"] = 9] = "AwaitingPaymentFromProvider"
BookingStatusEnum[BookingStatusEnum["Invoiced"] = 10] = "Invoiced"
})(BookingStatusEnum || (BookingStatusEnum = {}));
export class BookedCustomer {
/** @param {{Id?:string,Firstname?:string,Lastname?:string,Email?:string,Phone?:string,FacebookUserName?:string,ImageUrl?:string,CorporateIdentityNumber?:string,InvoiceAddress1?:string,InvoiceAddress2?:string,InvoiceCity?:string,InvoicePostalCode?:string,InvoiceCountryCode?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
Firstname;
/** @type {string} */
Lastname;
/** @type {string} */
Email;
/** @type {string} */
Phone;
/** @type {string} */
FacebookUserName;
/** @type {string} */
ImageUrl;
/** @type {string} */
CorporateIdentityNumber;
/** @type {string} */
InvoiceAddress1;
/** @type {string} */
InvoiceAddress2;
/** @type {string} */
InvoiceCity;
/** @type {string} */
InvoicePostalCode;
/** @type {string} */
InvoiceCountryCode;
}
export class GroupBookingSettings {
/** @param {{Active?:boolean,Min?:number,Max?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {boolean} */
Active;
/** @type {number} */
Min;
/** @type {number} */
Max;
}
export class MultipleResourceSettings {
/** @param {{Active?:boolean,Min?:number,Max?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {boolean} */
Active;
/** @type {number} */
Min;
/** @type {number} */
Max;
}
export class ServiceInfoResponse {
/** @param {{Id?:number,Name?:string,Description?:string,ImageUrl?:string,LengthInMinutes?:number,MaxNumberOfSpotsPerBooking?:number,MinNumberOfSpotsPerBooking?:number,GroupBooking?:GroupBookingSettings,MultipleResource?:MultipleResourceSettings,IsGroupBooking?:boolean,IsPaymentEnabled?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
Name;
/** @type {string} */
Description;
/** @type {string} */
ImageUrl;
/** @type {?number} */
LengthInMinutes;
/** @type {number} */
MaxNumberOfSpotsPerBooking;
/** @type {number} */
MinNumberOfSpotsPerBooking;
/** @type {GroupBookingSettings} */
GroupBooking;
/** @type {MultipleResourceSettings} */
MultipleResource;
/** @type {boolean} */
IsGroupBooking;
/** @type {boolean} */
IsPaymentEnabled;
}
export class BookingIntervalResponse {
/** @param {{Id?:number,CompanyId?:string,From?:string,To?:string,Status?:BookingStatusEnum,StatusId?:number,StatusName?:string,Customer?:BookedCustomer,Service?:ServiceInfoResponse,CreatedDate?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
CompanyId;
/** @type {string} */
From;
/** @type {string} */
To;
/** @type {BookingStatusEnum} */
Status;
/** @type {number} */
StatusId;
/** @type {string} */
StatusName;
/** @type {BookedCustomer} */
Customer;
/** @type {ServiceInfoResponse} */
Service;
/** @type {string} */
CreatedDate;
}
export class CollidingBookingQueryResponse {
/** @param {{ResourceIds?:number[],Bookings?:BookingIntervalResponse[],ResponseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number[]}
* @description Resource id of the resource that owns this exception */
ResourceIds;
/**
* @type {BookingIntervalResponse[]}
* @description A list of bookings that would collide with the time exception */
Bookings;
/** @type {ResponseStatus} */
ResponseStatus;
}
export class CollidingBookingQuery {
/** @param {{CompanyId?:string,ResourceIds?:number[],From?:string,To?:string,FromTime?:string,ToTime?:string,DaysOfWeek?:number[],IncludeServiceInformation?:boolean,IncludeCustomerInformation?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {?string}
* @description The company id, if empty will use the company id for the user you are logged in with. */
CompanyId;
/**
* @type {number[]}
* @description Resource ids of the resource that should be matched against booked events */
ResourceIds;
/**
* @type {string}
* @description Time exception starting date */
From;
/**
* @type {string}
* @description Time exception ending date */
To;
/**
* @type {string}
* @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. */
FromTime;
/**
* @type {string}
* @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. */
ToTime;
/**
* @type {number[]}
* @description A comma separated list of which days this day exception belongs to, 1 = Monday .. 7 = Sunday */
DaysOfWeek;
/**
* @type {boolean}
* @description If you want to include the service information for the booking */
IncludeServiceInformation;
/**
* @type {boolean}
* @description If you want to include the customer information for the booking */
IncludeCustomerInformation;
}
JavaScript CollidingBookingQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CollidingBookingQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Bookings> <BookingIntervalResponse> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <CreatedDate>0001-01-01T00:00:00</CreatedDate> <Customer> <CorporateIdentityNumber>String</CorporateIdentityNumber> <Email>String</Email> <FacebookUserName>String</FacebookUserName> <Firstname>String</Firstname> <Id>00000000-0000-0000-0000-000000000000</Id> <ImageUrl>String</ImageUrl> <InvoiceAddress1>String</InvoiceAddress1> <InvoiceAddress2>String</InvoiceAddress2> <InvoiceCity>String</InvoiceCity> <InvoiceCountryCode>String</InvoiceCountryCode> <InvoicePostalCode>String</InvoicePostalCode> <Lastname>String</Lastname> <Phone>String</Phone> </Customer> <From>0001-01-01T00:00:00</From> <Id>0</Id> <Service> <Description>String</Description> <GroupBooking> <Active>false</Active> <Max>0</Max> <Min>0</Min> </GroupBooking> <Id>0</Id> <ImageUrl i:nil="true" /> <IsGroupBooking>false</IsGroupBooking> <IsPaymentEnabled>false</IsPaymentEnabled> <LengthInMinutes>0</LengthInMinutes> <MaxNumberOfSpotsPerBooking>0</MaxNumberOfSpotsPerBooking> <MinNumberOfSpotsPerBooking>0</MinNumberOfSpotsPerBooking> <MultipleResource> <Active>false</Active> <Max>0</Max> <Min>0</Min> </MultipleResource> <Name>String</Name> </Service> <Status>Booked</Status> <StatusId>0</StatusId> <StatusName>String</StatusName> <To>0001-01-01T00:00:00</To> </BookingIntervalResponse> </Bookings> <ResourceIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:int>0</d2p1:int> </ResourceIds> <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types"> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:Message>String</d2p1:Message> <d2p1:StackTrace>String</d2p1:StackTrace> <d2p1:Errors> <d2p1:ResponseError> <d2p1:ErrorCode>String</d2p1:ErrorCode> <d2p1:FieldName>String</d2p1:FieldName> <d2p1:Message>String</d2p1:Message> <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </d2p1:Meta> </d2p1:ResponseError> </d2p1:Errors> <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </d2p1:Meta> </ResponseStatus> </CollidingBookingQueryResponse>