| POST | /procurement/batch |
|---|
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 ProcurementBatch:
id: int = 0
# @Required()
# @StringLength(500)
title: Optional[str] = None
deadline: datetime.datetime = datetime.datetime(1, 1, 1)
description: Optional[str] = None
status: int = 0
created_at: Optional[datetime.datetime] = None
created_by: Optional[int] = None
closed_at: Optional[datetime.datetime] = None
closed_by: Optional[int] = None
is_deleted: Optional[bool] = None
deleted_at: Optional[datetime.datetime] = None
deleted_by: Optional[int] = None
# @Ignore()
created_by_name: Optional[str] = None
# @Ignore()
item_count: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateProcurementBatchRequest:
title: Optional[str] = None
deadline: datetime.datetime = datetime.datetime(1, 1, 1)
description: Optional[str] = None
Python CreateProcurementBatchRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /procurement/batch HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"title":"String","deadline":"0001-01-01T00:00:00.0000000+07:06","description":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"id":0,"title":"String","deadline":"0001-01-01T00:00:00.0000000+07:06","description":"String","status":0,"createdAt":"0001-01-01T00:00:00.0000000+07:06","createdBy":0,"closedAt":"0001-01-01T00:00:00.0000000+07:06","closedBy":0,"isDeleted":false,"deletedAt":"0001-01-01T00:00:00.0000000+07:06","deletedBy":0,"createdByName":"String","itemCount":0}