tvpl.api

<back to all web services

CreateProcurementItemRequest

Requires Authentication
The following routes are available for this service:
POST/procurement/item
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class CreateProcurementItemRequest
    {
        public Integer batchId = null;
        public Integer equipmentId = null;
        public String productName = null;
        public String technicalSpec = null;
        public String unit = null;
        public Integer quantity = null;
        public String purpose = null;
        public String note = null;
        
        public Integer getBatchId() { return batchId; }
        public CreateProcurementItemRequest setBatchId(Integer value) { this.batchId = value; return this; }
        public Integer getEquipmentId() { return equipmentId; }
        public CreateProcurementItemRequest setEquipmentId(Integer value) { this.equipmentId = value; return this; }
        public String getProductName() { return productName; }
        public CreateProcurementItemRequest setProductName(String value) { this.productName = value; return this; }
        public String getTechnicalSpec() { return technicalSpec; }
        public CreateProcurementItemRequest setTechnicalSpec(String value) { this.technicalSpec = value; return this; }
        public String getUnit() { return unit; }
        public CreateProcurementItemRequest setUnit(String value) { this.unit = value; return this; }
        public Integer getQuantity() { return quantity; }
        public CreateProcurementItemRequest setQuantity(Integer value) { this.quantity = value; return this; }
        public String getPurpose() { return purpose; }
        public CreateProcurementItemRequest setPurpose(String value) { this.purpose = value; return this; }
        public String getNote() { return note; }
        public CreateProcurementItemRequest setNote(String value) { this.note = value; return this; }
    }

    public static class ProcurementItem
    {
        public Integer id = null;
        public Integer batchId = null;
        public Integer departmentId = null;
        public Integer equipmentId = null;
        @Required()
        @StringLength(500)
        public String productName = null;

        public String technicalSpec = null;
        @StringLength(50)
        public String unit = null;

        public Integer quantity = null;
        public String purpose = null;
        public String note = null;
        public Integer approvalStatus = null;
        public String approvalNote = null;
        public Date approvedAt = null;
        public Integer approvedBy = null;
        public Date createdAt = null;
        public Integer createdBy = null;
        public Date updatedAt = null;
        public Integer updatedBy = null;
        public Boolean isDeleted = null;
        public Date deletedAt = null;
        public Integer deletedBy = null;
        @Ignore()
        public String departmentName = null;

        @Ignore()
        public String createdByName = null;

        @Ignore()
        public String approvedByName = null;
        
        public Integer getId() { return id; }
        public ProcurementItem setId(Integer value) { this.id = value; return this; }
        public Integer getBatchId() { return batchId; }
        public ProcurementItem setBatchId(Integer value) { this.batchId = value; return this; }
        public Integer getDepartmentId() { return departmentId; }
        public ProcurementItem setDepartmentId(Integer value) { this.departmentId = value; return this; }
        public Integer getEquipmentId() { return equipmentId; }
        public ProcurementItem setEquipmentId(Integer value) { this.equipmentId = value; return this; }
        public String getProductName() { return productName; }
        public ProcurementItem setProductName(String value) { this.productName = value; return this; }
        public String getTechnicalSpec() { return technicalSpec; }
        public ProcurementItem setTechnicalSpec(String value) { this.technicalSpec = value; return this; }
        public String getUnit() { return unit; }
        public ProcurementItem setUnit(String value) { this.unit = value; return this; }
        public Integer getQuantity() { return quantity; }
        public ProcurementItem setQuantity(Integer value) { this.quantity = value; return this; }
        public String getPurpose() { return purpose; }
        public ProcurementItem setPurpose(String value) { this.purpose = value; return this; }
        public String getNote() { return note; }
        public ProcurementItem setNote(String value) { this.note = value; return this; }
        public Integer getApprovalStatus() { return approvalStatus; }
        public ProcurementItem setApprovalStatus(Integer value) { this.approvalStatus = value; return this; }
        public String getApprovalNote() { return approvalNote; }
        public ProcurementItem setApprovalNote(String value) { this.approvalNote = value; return this; }
        public Date getApprovedAt() { return approvedAt; }
        public ProcurementItem setApprovedAt(Date value) { this.approvedAt = value; return this; }
        public Integer getApprovedBy() { return approvedBy; }
        public ProcurementItem setApprovedBy(Integer value) { this.approvedBy = value; return this; }
        public Date getCreatedAt() { return createdAt; }
        public ProcurementItem setCreatedAt(Date value) { this.createdAt = value; return this; }
        public Integer getCreatedBy() { return createdBy; }
        public ProcurementItem setCreatedBy(Integer value) { this.createdBy = value; return this; }
        public Date getUpdatedAt() { return updatedAt; }
        public ProcurementItem setUpdatedAt(Date value) { this.updatedAt = value; return this; }
        public Integer getUpdatedBy() { return updatedBy; }
        public ProcurementItem setUpdatedBy(Integer value) { this.updatedBy = value; return this; }
        public Boolean getIsDeleted() { return isDeleted; }
        public ProcurementItem setIsDeleted(Boolean value) { this.isDeleted = value; return this; }
        public Date getDeletedAt() { return deletedAt; }
        public ProcurementItem setDeletedAt(Date value) { this.deletedAt = value; return this; }
        public Integer getDeletedBy() { return deletedBy; }
        public ProcurementItem setDeletedBy(Integer value) { this.deletedBy = value; return this; }
        public String getDepartmentName() { return departmentName; }
        public ProcurementItem setDepartmentName(String value) { this.departmentName = value; return this; }
        public String getCreatedByName() { return createdByName; }
        public ProcurementItem setCreatedByName(String value) { this.createdByName = value; return this; }
        public String getApprovedByName() { return approvedByName; }
        public ProcurementItem setApprovedByName(String value) { this.approvedByName = value; return this; }
    }

}

Java CreateProcurementItemRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /procurement/item HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CreateProcurementItemRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
  <BatchId>0</BatchId>
  <EquipmentId>0</EquipmentId>
  <Note>String</Note>
  <ProductName>String</ProductName>
  <Purpose>String</Purpose>
  <Quantity>0</Quantity>
  <TechnicalSpec>String</TechnicalSpec>
  <Unit>String</Unit>
</CreateProcurementItemRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ProcurementItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
  <ApprovalNote>String</ApprovalNote>
  <ApprovalStatus>0</ApprovalStatus>
  <ApprovedAt>0001-01-01T00:00:00</ApprovedAt>
  <ApprovedBy>0</ApprovedBy>
  <ApprovedByName>String</ApprovedByName>
  <BatchId>0</BatchId>
  <CreatedAt>0001-01-01T00:00:00</CreatedAt>
  <CreatedBy>0</CreatedBy>
  <CreatedByName>String</CreatedByName>
  <DeletedAt>0001-01-01T00:00:00</DeletedAt>
  <DeletedBy>0</DeletedBy>
  <DepartmentId>0</DepartmentId>
  <DepartmentName>String</DepartmentName>
  <EquipmentId>0</EquipmentId>
  <Id>0</Id>
  <IsDeleted>false</IsDeleted>
  <Note>String</Note>
  <ProductName>String</ProductName>
  <Purpose>String</Purpose>
  <Quantity>0</Quantity>
  <TechnicalSpec>String</TechnicalSpec>
  <Unit>String</Unit>
  <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
  <UpdatedBy>0</UpdatedBy>
</ProcurementItem>