| Required role: | super-admin |
| POST | /document-number-format |
|---|
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 DocumentNumberFormat:
id: int = 0
# @Required()
# @StringLength(50)
type_key: Optional[str] = None
# @Required()
# @StringLength(255)
name: Optional[str] = None
# @Required()
# @StringLength(255)
format_template: Optional[str] = None
padding: int = 0
reset_period: int = 0
# @StringLength(500)
label_keys: Optional[str] = None
is_active: bool = False
is_deleted: Optional[bool] = None
deleted_at: Optional[datetime.datetime] = None
deleted_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
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateDocumentNumberFormatRequest:
type_key: Optional[str] = None
name: Optional[str] = None
format_template: Optional[str] = None
padding: int = 0
reset_period: int = 0
label_keys: Optional[str] = None
is_active: bool = False
Python CreateDocumentNumberFormatRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /document-number-format HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
typeKey: String,
name: String,
formatTemplate: String,
padding: 0,
resetPeriod: 0,
labelKeys: String,
isActive: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: 0,
typeKey: String,
name: String,
formatTemplate: String,
padding: 0,
resetPeriod: 0,
labelKeys: String,
isActive: False,
isDeleted: False,
deletedAt: "0001-01-01T00:00:00.0000000+07:06",
deletedBy: 0,
createdAt: "0001-01-01T00:00:00.0000000+07:06",
createdBy: 0,
updatedAt: "0001-01-01T00:00:00.0000000+07:06",
updatedBy: 0
}