tvpl.api

<back to all web services

GetTemplateByDocumentIdRequest

Requires Authentication
The following routes are available for this service:
GET/document-template/bydocument
import 'package:servicestack/servicestack.dart';

class BasicDocument implements IConvertible
{
    // @required()
    String? title;

    // @StringLength(4000)
    String? description;

    // @StringLength(500)
    String? owner;

    int? documentPolicyId;
    int? updateDocumentId;
    DateTime? effectBeginDate;
    DateTime? effectEndDate;
    int? issuingAgencyId;
    int? documentTypeId;
    int? documentGroupId;
    int? subjectId;
    // @StringLength(500)
    String? signBy;

    DateTime? signDate;
    int? statusId;
    bool? isInternal;
    String? documentNumber;
    String? documentCode;
    bool? isUrgent;
    int? scopeType;
    bool? isActive;

    BasicDocument({this.title,this.description,this.owner,this.documentPolicyId,this.updateDocumentId,this.effectBeginDate,this.effectEndDate,this.issuingAgencyId,this.documentTypeId,this.documentGroupId,this.subjectId,this.signBy,this.signDate,this.statusId,this.isInternal,this.documentNumber,this.documentCode,this.isUrgent,this.scopeType,this.isActive});
    BasicDocument.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        title = json['title'];
        description = json['description'];
        owner = json['owner'];
        documentPolicyId = json['documentPolicyId'];
        updateDocumentId = json['updateDocumentId'];
        effectBeginDate = JsonConverters.fromJson(json['effectBeginDate'],'DateTime',context!);
        effectEndDate = JsonConverters.fromJson(json['effectEndDate'],'DateTime',context!);
        issuingAgencyId = json['issuingAgencyId'];
        documentTypeId = json['documentTypeId'];
        documentGroupId = json['documentGroupId'];
        subjectId = json['subjectId'];
        signBy = json['signBy'];
        signDate = JsonConverters.fromJson(json['signDate'],'DateTime',context!);
        statusId = json['statusId'];
        isInternal = json['isInternal'];
        documentNumber = json['documentNumber'];
        documentCode = json['documentCode'];
        isUrgent = json['isUrgent'];
        scopeType = json['scopeType'];
        isActive = json['isActive'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'title': title,
        'description': description,
        'owner': owner,
        'documentPolicyId': documentPolicyId,
        'updateDocumentId': updateDocumentId,
        'effectBeginDate': JsonConverters.toJson(effectBeginDate,'DateTime',context!),
        'effectEndDate': JsonConverters.toJson(effectEndDate,'DateTime',context!),
        'issuingAgencyId': issuingAgencyId,
        'documentTypeId': documentTypeId,
        'documentGroupId': documentGroupId,
        'subjectId': subjectId,
        'signBy': signBy,
        'signDate': JsonConverters.toJson(signDate,'DateTime',context!),
        'statusId': statusId,
        'isInternal': isInternal,
        'documentNumber': documentNumber,
        'documentCode': documentCode,
        'isUrgent': isUrgent,
        'scopeType': scopeType,
        'isActive': isActive
    };

    getTypeName() => "BasicDocument";
    TypeContext? context = _ctx;
}

class Document extends BasicDocument implements IConvertible
{
    int? id;
    // @StringLength(500)
    String? reasonReturn;

    int? accountId;
    DateTime? deletedAt;
    // @StringLength(500)
    String? deletedBy;

    // @StringLength(500)
    String? updatedBy;

    DateTime? createdAt;
    // @StringLength(500)
    String? createdBy;

    bool? isParty;
    bool? isRevisionRequested;
    DateTime? lastUpdatedAt;
    bool? isPrivate;
    int? departmentId;
    DateTime? publicationDate;
    int? processStatusId;
    String? fullTextSearchContent;

    Document({this.id,this.reasonReturn,this.accountId,this.deletedAt,this.deletedBy,this.updatedBy,this.createdAt,this.createdBy,this.isParty,this.isRevisionRequested,this.lastUpdatedAt,this.isPrivate,this.departmentId,this.publicationDate,this.processStatusId,this.fullTextSearchContent});
    Document.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        reasonReturn = json['reasonReturn'];
        accountId = json['accountId'];
        deletedAt = JsonConverters.fromJson(json['deletedAt'],'DateTime',context!);
        deletedBy = json['deletedBy'];
        updatedBy = json['updatedBy'];
        createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
        createdBy = json['createdBy'];
        isParty = json['isParty'];
        isRevisionRequested = json['isRevisionRequested'];
        lastUpdatedAt = JsonConverters.fromJson(json['lastUpdatedAt'],'DateTime',context!);
        isPrivate = json['isPrivate'];
        departmentId = json['departmentId'];
        publicationDate = JsonConverters.fromJson(json['publicationDate'],'DateTime',context!);
        processStatusId = json['processStatusId'];
        fullTextSearchContent = json['fullTextSearchContent'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'reasonReturn': reasonReturn,
        'accountId': accountId,
        'deletedAt': JsonConverters.toJson(deletedAt,'DateTime',context!),
        'deletedBy': deletedBy,
        'updatedBy': updatedBy,
        'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
        'createdBy': createdBy,
        'isParty': isParty,
        'isRevisionRequested': isRevisionRequested,
        'lastUpdatedAt': JsonConverters.toJson(lastUpdatedAt,'DateTime',context!),
        'isPrivate': isPrivate,
        'departmentId': departmentId,
        'publicationDate': JsonConverters.toJson(publicationDate,'DateTime',context!),
        'processStatusId': processStatusId,
        'fullTextSearchContent': fullTextSearchContent
    });

    getTypeName() => "Document";
    TypeContext? context = _ctx;
}

class DocumentTemplate implements IConvertible
{
    int? id;
    // @required()
    String? title;

    String? description;
    bool? isActive;
    // @ignore()
    List<int>? documentIds;

    // @ignore()
    List<Document>? documents;

    DocumentTemplate({this.id,this.title,this.description,this.isActive,this.documentIds,this.documents});
    DocumentTemplate.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        title = json['title'];
        description = json['description'];
        isActive = json['isActive'];
        documentIds = JsonConverters.fromJson(json['documentIds'],'List<int>',context!);
        documents = JsonConverters.fromJson(json['documents'],'List<Document>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'title': title,
        'description': description,
        'isActive': isActive,
        'documentIds': JsonConverters.toJson(documentIds,'List<int>',context!),
        'documents': JsonConverters.toJson(documents,'List<Document>',context!)
    };

    getTypeName() => "DocumentTemplate";
    TypeContext? context = _ctx;
}

class DocumentElement implements IConvertible
{
    int? id;
    int? templateId;
    // @required()
    String? elementKey;

    // @required()
    String? tag;

    int? parentId;
    // @required()
    String? title;

    String? description;
    // @required()
    String? dataType;

    String? templateType;
    int? orderIndex;
    bool? isRequired;

    DocumentElement({this.id,this.templateId,this.elementKey,this.tag,this.parentId,this.title,this.description,this.dataType,this.templateType,this.orderIndex,this.isRequired});
    DocumentElement.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        templateId = json['templateId'];
        elementKey = json['elementKey'];
        tag = json['tag'];
        parentId = json['parentId'];
        title = json['title'];
        description = json['description'];
        dataType = json['dataType'];
        templateType = json['templateType'];
        orderIndex = json['orderIndex'];
        isRequired = json['isRequired'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'templateId': templateId,
        'elementKey': elementKey,
        'tag': tag,
        'parentId': parentId,
        'title': title,
        'description': description,
        'dataType': dataType,
        'templateType': templateType,
        'orderIndex': orderIndex,
        'isRequired': isRequired
    };

    getTypeName() => "DocumentElement";
    TypeContext? context = _ctx;
}

class DocumentElementDto extends DocumentElement implements IConvertible
{
    List<DocumentElementDto>? children;

    DocumentElementDto({this.children});
    DocumentElementDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        children = JsonConverters.fromJson(json['children'],'List<DocumentElementDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'children': JsonConverters.toJson(children,'List<DocumentElementDto>',context!)
    });

    getTypeName() => "DocumentElementDto";
    TypeContext? context = _ctx;
}

class DocumentTemplateDto extends DocumentTemplate implements IConvertible
{
    List<DocumentElementDto>? elements;

    DocumentTemplateDto({this.elements});
    DocumentTemplateDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        elements = JsonConverters.fromJson(json['elements'],'List<DocumentElementDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'elements': JsonConverters.toJson(elements,'List<DocumentElementDto>',context!)
    });

    getTypeName() => "DocumentTemplateDto";
    TypeContext? context = _ctx;
}

class DocumentTemplateResponse implements IConvertible
{
    DocumentTemplateDto? template;
    int? insertedId;
    int? code;
    String? message;

    DocumentTemplateResponse({this.template,this.insertedId,this.code,this.message});
    DocumentTemplateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        template = JsonConverters.fromJson(json['template'],'DocumentTemplateDto',context!);
        insertedId = json['insertedId'];
        code = json['code'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'template': JsonConverters.toJson(template,'DocumentTemplateDto',context!),
        'insertedId': insertedId,
        'code': code,
        'message': message
    };

    getTypeName() => "DocumentTemplateResponse";
    TypeContext? context = _ctx;
}

class GetTemplateByDocumentIdRequest implements IConvertible
{
    int? documentId;

    GetTemplateByDocumentIdRequest({this.documentId});
    GetTemplateByDocumentIdRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        documentId = json['documentId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'documentId': documentId
    };

    getTypeName() => "GetTemplateByDocumentIdRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'BasicDocument': TypeInfo(TypeOf.Class, create:() => BasicDocument()),
    'Document': TypeInfo(TypeOf.Class, create:() => Document()),
    'DocumentTemplate': TypeInfo(TypeOf.Class, create:() => DocumentTemplate()),
    'List<Document>': TypeInfo(TypeOf.Class, create:() => <Document>[]),
    'DocumentElement': TypeInfo(TypeOf.Class, create:() => DocumentElement()),
    'DocumentElementDto': TypeInfo(TypeOf.Class, create:() => DocumentElementDto()),
    'List<DocumentElementDto>': TypeInfo(TypeOf.Class, create:() => <DocumentElementDto>[]),
    'DocumentTemplateDto': TypeInfo(TypeOf.Class, create:() => DocumentTemplateDto()),
    'DocumentTemplateResponse': TypeInfo(TypeOf.Class, create:() => DocumentTemplateResponse()),
    'GetTemplateByDocumentIdRequest': TypeInfo(TypeOf.Class, create:() => GetTemplateByDocumentIdRequest()),
});

Dart GetTemplateByDocumentIdRequest 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.

GET /document-template/bydocument HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DocumentTemplateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
  <Code>0</Code>
  <InsertedId>0</InsertedId>
  <Message>String</Message>
  <Template>
    <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
    <CreatedBy xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</CreatedBy>
    <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
    <DocumentIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
      <d3p1:int>0</d3p1:int>
    </DocumentIds>
    <Documents xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
      <Document>
        <Description>String</Description>
        <DocumentCode>String</DocumentCode>
        <DocumentGroupId>0</DocumentGroupId>
        <DocumentNumber>String</DocumentNumber>
        <DocumentPolicyId>0</DocumentPolicyId>
        <DocumentTypeId>0</DocumentTypeId>
        <EffectBeginDate>0001-01-01T00:00:00</EffectBeginDate>
        <EffectEndDate>0001-01-01T00:00:00</EffectEndDate>
        <IsActive>false</IsActive>
        <IsInternal>false</IsInternal>
        <IsUrgent>false</IsUrgent>
        <IssuingAgencyId>0</IssuingAgencyId>
        <Owner>String</Owner>
        <ScopeType>0</ScopeType>
        <SignBy>String</SignBy>
        <SignDate>0001-01-01T00:00:00</SignDate>
        <StatusId>0</StatusId>
        <SubjectId>0</SubjectId>
        <Title>String</Title>
        <UpdateDocumentId>0</UpdateDocumentId>
        <AccountId>0</AccountId>
        <CreatedAt>0001-01-01T00:00:00</CreatedAt>
        <CreatedBy>String</CreatedBy>
        <DeletedAt>0001-01-01T00:00:00</DeletedAt>
        <DeletedBy>String</DeletedBy>
        <DepartmentId>0</DepartmentId>
        <FullTextSearchContent>String</FullTextSearchContent>
        <Id>0</Id>
        <IsParty>false</IsParty>
        <IsPrivate>false</IsPrivate>
        <IsRevisionRequested>false</IsRevisionRequested>
        <LastUpdatedAt>0001-01-01T00:00:00</LastUpdatedAt>
        <ProcessStatusId>0</ProcessStatusId>
        <PublicationDate>0001-01-01T00:00:00</PublicationDate>
        <ReasonReturn>String</ReasonReturn>
        <UpdatedBy>String</UpdatedBy>
      </Document>
    </Documents>
    <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
    <IsActive xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsActive>
    <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
    <Elements>
      <DocumentElementDto>
        <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
        <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
        <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
        <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
        <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
        <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
        <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
        <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
        <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
        <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
        <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
        <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
        <Children>
          <DocumentElementDto>
            <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
            <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
            <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
            <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
            <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
            <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
            <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
            <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
            <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
            <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
            <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
            <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
            <Children>
              <DocumentElementDto>
                <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
                <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
                <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
                <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
                <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
                <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
                <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
                <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
                <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
                <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
                <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
                <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
                <Children i:nil="true" />
              </DocumentElementDto>
            </Children>
          </DocumentElementDto>
        </Children>
      </DocumentElementDto>
    </Elements>
  </Template>
</DocumentTemplateResponse>