tvpl.api

<back to all web services

GetAdvancedWorkflowInfoRequest

Requires Authentication
The following routes are available for this service:
GET/workflow/{WorkflowId}/advanced-info
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 Provider:
    id: int = 0
    name: Optional[str] = None
    tax_code: Optional[str] = None
    address: Optional[str] = None
    email: Optional[str] = None
    phone: Optional[str] = None
    additional_info: Optional[str] = None
    provider_type: int = 0
    created_at: Optional[datetime.datetime] = None
    created_by: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Contract:
    id: int = 0
    # @Required()
    workflow_id: int = 0

    # @StringLength(100)
    contract_no: Optional[str] = None

    # @StringLength(100)
    contract_date: Optional[str] = None

    service_name: Optional[str] = None
    # @StringLength(100)
    contract_type: Optional[str] = None

    objective: Optional[str] = None
    location: Optional[str] = None
    created_at: datetime.datetime = datetime.datetime(1, 1, 1)
    # @Required()
    created_by: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Estimate:
    id: int = 0
    # @Required()
    workflow_id: int = 0

    value_before_tax: Optional[int] = None
    tax_amount: Optional[int] = None
    total_amount: Optional[int] = None
    created_at: datetime.datetime = datetime.datetime(1, 1, 1)
    # @Required()
    created_by: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PurchaseHistory:
    id: int = 0
    # @Required()
    workflow_id: int = 0

    sequence_no: Optional[int] = None
    detail: Optional[str] = None
    # @StringLength(150)
    unit: Optional[str] = None

    quantity: Optional[int] = None
    unit_price: Optional[int] = None
    amount: Optional[int] = None
    note: Optional[str] = None
    created_at: datetime.datetime = datetime.datetime(1, 1, 1)
    # @Required()
    created_by: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AdvancedWorkflowInfoData:
    provider: Optional[Provider] = None
    contract: Optional[Contract] = None
    estimate: Optional[Estimate] = None
    purchase_history: Optional[List[PurchaseHistory]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AdvancedWorkflowInfoResponse:
    code: int = 0
    message: Optional[str] = None
    data: Optional[AdvancedWorkflowInfoData] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAdvancedWorkflowInfoRequest:
    workflow_id: int = 0

Python GetAdvancedWorkflowInfoRequest DTOs

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

HTTP + JSV

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

GET /workflow/{WorkflowId}/advanced-info HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	code: 0,
	message: String,
	data: 
	{
		provider: 
		{
			id: 0,
			name: String,
			taxCode: String,
			address: String,
			email: String,
			phone: String,
			additionalInfo: String,
			providerType: 0,
			createdAt: "0001-01-01T00:00:00.0000000+07:06",
			createdBy: 0
		},
		contract: 
		{
			id: 0,
			workflowId: 0,
			contractNo: String,
			contractDate: String,
			serviceName: String,
			contractType: String,
			objective: String,
			location: String,
			createdBy: 0
		},
		estimate: 
		{
			id: 0,
			workflowId: 0,
			valueBeforeTax: 0,
			taxAmount: 0,
			totalAmount: 0,
			createdBy: 0
		},
		purchaseHistory: 
		[
			{
				id: 0,
				workflowId: 0,
				sequenceNo: 0,
				detail: String,
				unit: String,
				quantity: 0,
				unitPrice: 0,
				amount: 0,
				note: String,
				createdBy: 0
			}
		]
	}
}