| Required permission: | manage_equipment |
| POST | /equipment/{Id}/approve |
|---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using tvpl.api.ServiceModel;
using tvpl.data.Models;
namespace tvpl.api.ServiceModel
{
public partial class ApproveEquipmentRequest
{
public virtual int Id { get; set; }
public virtual bool Approve { get; set; }
}
}
namespace tvpl.data.Models
{
public partial class Equipment
{
public virtual int Id { get; set; }
[Required]
[StringLength(500)]
public virtual string Name { get; set; }
[StringLength(1000)]
public virtual string ImageUrl { get; set; }
public virtual string Description { get; set; }
[StringLength(50)]
public virtual string Unit { get; set; }
public virtual int? MaterialTypeId { get; set; }
public virtual int Status { get; set; }
public virtual bool? IsDeleted { get; set; }
public virtual DateTime? ApprovedAt { get; set; }
public virtual int? ApprovedBy { get; set; }
public virtual DateTime? CreatedAt { get; set; }
public virtual int? CreatedBy { get; set; }
public virtual DateTime? UpdatedAt { get; set; }
public virtual int? UpdatedBy { get; set; }
[Ignore]
public virtual string MaterialTypeName { get; set; }
[Ignore]
public virtual string CreatedByName { get; set; }
[Ignore]
public virtual string ApprovedByName { get; set; }
}
}
C# ApproveEquipmentRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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/csv
Content-Type: text/csv
Content-Length: length
{"id":0,"approve":false}
HTTP/1.1 200 OK
Content-Type: text/csv
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"}