tvpl.api

<back to all web services

ApproveProcurementItemRequest

Requires Authentication
The following routes are available for this service:
POST/procurement/item/{Id}/approve
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProcurementItem:
    id: int = 0
    batch_id: int = 0
    department_id: Optional[int] = None
    equipment_id: Optional[int] = None
    # @Required()
    # @StringLength(500)
    product_name: Optional[str] = None

    technical_spec: Optional[str] = None
    # @StringLength(50)
    unit: Optional[str] = None

    quantity: int = 0
    purpose: Optional[str] = None
    note: Optional[str] = None
    approval_status: int = 0
    approval_note: Optional[str] = None
    approved_at: Optional[datetime.datetime] = None
    approved_by: Optional[int] = None
    created_at: Optional[datetime.datetime] = None
    created_by: Optional[int] = None
    updated_at: Optional[datetime.datetime] = None
    updated_by: Optional[int] = None
    is_deleted: Optional[bool] = None
    deleted_at: Optional[datetime.datetime] = None
    deleted_by: Optional[int] = None
    # @Ignore()
    department_name: Optional[str] = None

    # @Ignore()
    created_by_name: Optional[str] = None

    # @Ignore()
    approved_by_name: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApproveProcurementItemRequest:
    id: int = 0
    approve: bool = False
    note: Optional[str] = None

Python ApproveProcurementItemRequest DTOs

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

HTTP + CSV

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

POST /procurement/item/{Id}/approve HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"id":0,"approve":false,"note":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"id":0,"batchId":0,"departmentId":0,"equipmentId":0,"productName":"String","technicalSpec":"String","unit":"String","quantity":0,"purpose":"String","note":"String","approvalStatus":0,"approvalNote":"String","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,"isDeleted":false,"deletedAt":"0001-01-01T00:00:00.0000000+07:06","deletedBy":0,"departmentName":"String","createdByName":"String","approvedByName":"String"}