POST | /bookinglog | Add a new event to booking log | Add a new event to the booking of the company of the currently logged in user, only administrators are allowed to add items to event log. |
---|
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 BookingLogEventTypeResponse() =
///<summary>
///The event type id
///</summary>
[<ApiMember(Description="The event type id")>]
member val Id:Int32 = new Int32() with get,set
///<summary>
///The event type name
///</summary>
[<ApiMember(Description="The event type name")>]
member val Name:String = null with get,set
///<summary>
///The event type description
///</summary>
[<ApiMember(Description="The event type description")>]
member val Description:String = null with get,set
[<AllowNullLiteral>]
type BookingLogQueryResponse() =
///<summary>
///The booking log id
///</summary>
[<ApiMember(Description="The booking log id")>]
member val Id:Int32 = new Int32() with get,set
///<summary>
///The booking id
///</summary>
[<ApiMember(Description="The booking id")>]
member val BookingId:Int32 = new Int32() with get,set
///<summary>
///The type of event
///</summary>
[<ApiMember(Description="The type of event")>]
member val EventTypeId:Int32 = new Int32() with get,set
///<summary>
///The type of event
///</summary>
[<ApiMember(Description="The type of event")>]
member val EventType:BookingLogEventTypeResponse = null with get,set
///<summary>
///Comments that could be added to the event log item
///</summary>
[<ApiMember(Description="Comments that could be added to the event log item")>]
member val Comments:String = null with get,set
///<summary>
///The user created the event
///</summary>
[<ApiMember(Description="The user created the event")>]
member val UserName:String = null with get,set
///<summary>
///Then date when the event occured
///</summary>
[<ApiMember(Description="Then date when the event occured")>]
member val Created:DateTime = new DateTime() with get,set
[<ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)>]
[<ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)>]
[<AllowNullLiteral>]
type CreateBookingLogItem() =
///<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 booking id
///</summary>
[<ApiMember(Description="The booking id", IsRequired=true)>]
member val BookingId:Int32 = new Int32() with get,set
///<summary>
///The type of event
///</summary>
[<ApiMember(Description="The type of event", IsRequired=true)>]
member val EventTypeId:Int32 = new Int32() with get,set
///<summary>
///Comments that could be added to the event log item
///</summary>
[<ApiMember(Description="Comments that could be added to the event log item", IsRequired=true)>]
member val Comments:String = null with get,set
///<summary>
///Then date when the event occured, leave blank if current datetime
///</summary>
[<ApiMember(Description="Then date when the event occured, leave blank if current datetime", IsRequired=true)>]
member val Created:Nullable<DateTime> = new Nullable<DateTime>() with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /bookinglog HTTP/1.1
Host: api.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CompanyId: 00000000-0000-0000-0000-000000000000,
BookingId: 0,
EventTypeId: 0,
Comments: String,
Created: "0001-01-01T00:00:00"
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Id: 0, BookingId: 0, EventTypeId: 0, EventType: { Id: 0, Name: String, Description: String }, Comments: String, UserName: String }