tvpl.api

<back to all web services

ApproveEquipmentRequest

Requires Authentication
Required permission:manage_equipment
The following routes are available for this service:
POST/equipment/{Id}/approve
namespace tvpl.api.ServiceModel

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type Equipment() = 
        member val Id:Int32 = new Int32() with get,set
        [<Required>]
        [<StringLength(500)>]
        member val Name:String = null with get,set

        [<StringLength(1000)>]
        member val ImageUrl:String = null with get,set

        member val Description:String = null with get,set
        [<StringLength(50)>]
        member val Unit:String = null with get,set

        member val MaterialTypeId:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val Status:Int32 = new Int32() with get,set
        member val IsDeleted:Nullable<Boolean> = new Nullable<Boolean>() with get,set
        member val ApprovedAt:Nullable<DateTime> = new Nullable<DateTime>() with get,set
        member val ApprovedBy:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val CreatedAt:Nullable<DateTime> = new Nullable<DateTime>() with get,set
        member val CreatedBy:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val UpdatedAt:Nullable<DateTime> = new Nullable<DateTime>() with get,set
        member val UpdatedBy:Nullable<Int32> = new Nullable<Int32>() with get,set
        [<Ignore>]
        member val MaterialTypeName:String = null with get,set

        [<Ignore>]
        member val CreatedByName:String = null with get,set

        [<Ignore>]
        member val ApprovedByName:String = null with get,set

    [<AllowNullLiteral>]
    type ApproveEquipmentRequest() = 
        member val Id:Int32 = new Int32() with get,set
        member val Approve:Boolean = new Boolean() with get,set

F# ApproveEquipmentRequest 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 /equipment/{Id}/approve HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	approve: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	name: String,
	imageUrl: String,
	description: String,
	unit: String,
	materialTypeId: 0,
	status: 0,
	isDeleted: False,
	approvedAt: "0001-01-01T00:00:00.0000000+07:06",
	approvedBy: 0,
	createdAt: "0001-01-01T00:00:00.0000000+07:06",
	createdBy: 0,
	updatedAt: "0001-01-01T00:00:00.0000000+07:06",
	updatedBy: 0,
	materialTypeName: String,
	createdByName: String,
	approvedByName: String
}