tvpl.api

<back to all web services

StatDocByTypeRequest

Requires Authentication
The following routes are available for this service:
POST/document/stat-search-by-type
import 'package:servicestack/servicestack.dart';

enum DocumentSearchStage
{
    All,
    AllProcessing,
    Draft,
    PendingApproval,
    IsRevisionRequested,
    PendingCompilation,
    PendingReport,
    Published,
    Active,
    InActive,
}

class SimpleSearchFilter implements IConvertible
{
    String? title;
    int? groupId;
    int? subjectId;
    bool? isUrgent;
    DocumentSearchStage? documentSearchStage;
    bool? isInternal;
    DateTime? fromDate;
    DateTime? toDate;
    int? typeId;
    int? statusId;
    int? issuingAgencyId;
    bool? isParty;

    SimpleSearchFilter({this.title,this.groupId,this.subjectId,this.isUrgent,this.documentSearchStage,this.isInternal,this.fromDate,this.toDate,this.typeId,this.statusId,this.issuingAgencyId,this.isParty});
    SimpleSearchFilter.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        title = json['title'];
        groupId = json['groupId'];
        subjectId = json['subjectId'];
        isUrgent = json['isUrgent'];
        documentSearchStage = JsonConverters.fromJson(json['documentSearchStage'],'DocumentSearchStage',context!);
        isInternal = json['isInternal'];
        fromDate = JsonConverters.fromJson(json['fromDate'],'DateTime',context!);
        toDate = JsonConverters.fromJson(json['toDate'],'DateTime',context!);
        typeId = json['typeId'];
        statusId = json['statusId'];
        issuingAgencyId = json['issuingAgencyId'];
        isParty = json['isParty'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'title': title,
        'groupId': groupId,
        'subjectId': subjectId,
        'isUrgent': isUrgent,
        'documentSearchStage': JsonConverters.toJson(documentSearchStage,'DocumentSearchStage',context!),
        'isInternal': isInternal,
        'fromDate': JsonConverters.toJson(fromDate,'DateTime',context!),
        'toDate': JsonConverters.toJson(toDate,'DateTime',context!),
        'typeId': typeId,
        'statusId': statusId,
        'issuingAgencyId': issuingAgencyId,
        'isParty': isParty
    };

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

class DocumentSearchResultItem implements IConvertible
{
    String? title;
    String? description;
    String? owner;
    int? documentPolicyId;
    int? updateDocumentId;
    DateTime? effectBeginDate;
    DateTime? effectEndDate;
    int? issuingAgencyId;
    int? subjectId;
    String? signBy;
    DateTime? signDate;
    DateTime? updatedAt;
    int? statusId;
    bool? isInternal;
    String? documentNumber;
    String? documentCode;
    bool? isUrgent;
    int? id;
    String? reasonReturn;
    int? accountId;
    int? approverId;
    // @StringLength(500)
    String? updatedBy;

    // @StringLength(500)
    String? createdBy;

    bool? isParty;
    bool? isRevisionRequested;
    bool? isPrivate;
    int? departmentId;
    DateTime? publicationDate;
    int? processStatusId;
    int? documentTypeId;
    int? documentGroupId;
    String? accountName;
    String? acceptAccountName;
    String? documentGroupText;
    String? processStatusText;
    String? documentTypeText;
    String? departmentText;
    String? statusText;
    String? issuingAgencyText;
    String? subjectText;
    String? comment;
    String? submitComment;
    String? fullFile;
    String? parthFile;
    bool? isActive;
    int? stepOrder;
    int? stepCount;

    DocumentSearchResultItem({this.title,this.description,this.owner,this.documentPolicyId,this.updateDocumentId,this.effectBeginDate,this.effectEndDate,this.issuingAgencyId,this.subjectId,this.signBy,this.signDate,this.updatedAt,this.statusId,this.isInternal,this.documentNumber,this.documentCode,this.isUrgent,this.id,this.reasonReturn,this.accountId,this.approverId,this.updatedBy,this.createdBy,this.isParty,this.isRevisionRequested,this.isPrivate,this.departmentId,this.publicationDate,this.processStatusId,this.documentTypeId,this.documentGroupId,this.accountName,this.acceptAccountName,this.documentGroupText,this.processStatusText,this.documentTypeText,this.departmentText,this.statusText,this.issuingAgencyText,this.subjectText,this.comment,this.submitComment,this.fullFile,this.parthFile,this.isActive,this.stepOrder,this.stepCount});
    DocumentSearchResultItem.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'];
        subjectId = json['subjectId'];
        signBy = json['signBy'];
        signDate = JsonConverters.fromJson(json['signDate'],'DateTime',context!);
        updatedAt = JsonConverters.fromJson(json['updatedAt'],'DateTime',context!);
        statusId = json['statusId'];
        isInternal = json['isInternal'];
        documentNumber = json['documentNumber'];
        documentCode = json['documentCode'];
        isUrgent = json['isUrgent'];
        id = json['id'];
        reasonReturn = json['reasonReturn'];
        accountId = json['accountId'];
        approverId = json['approverId'];
        updatedBy = json['updatedBy'];
        createdBy = json['createdBy'];
        isParty = json['isParty'];
        isRevisionRequested = json['isRevisionRequested'];
        isPrivate = json['isPrivate'];
        departmentId = json['departmentId'];
        publicationDate = JsonConverters.fromJson(json['publicationDate'],'DateTime',context!);
        processStatusId = json['processStatusId'];
        documentTypeId = json['documentTypeId'];
        documentGroupId = json['documentGroupId'];
        accountName = json['accountName'];
        acceptAccountName = json['acceptAccountName'];
        documentGroupText = json['documentGroupText'];
        processStatusText = json['processStatusText'];
        documentTypeText = json['documentTypeText'];
        departmentText = json['departmentText'];
        statusText = json['statusText'];
        issuingAgencyText = json['issuingAgencyText'];
        subjectText = json['subjectText'];
        comment = json['comment'];
        submitComment = json['submitComment'];
        fullFile = json['fullFile'];
        parthFile = json['parthFile'];
        isActive = json['isActive'];
        stepOrder = json['stepOrder'];
        stepCount = json['stepCount'];
        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,
        'subjectId': subjectId,
        'signBy': signBy,
        'signDate': JsonConverters.toJson(signDate,'DateTime',context!),
        'updatedAt': JsonConverters.toJson(updatedAt,'DateTime',context!),
        'statusId': statusId,
        'isInternal': isInternal,
        'documentNumber': documentNumber,
        'documentCode': documentCode,
        'isUrgent': isUrgent,
        'id': id,
        'reasonReturn': reasonReturn,
        'accountId': accountId,
        'approverId': approverId,
        'updatedBy': updatedBy,
        'createdBy': createdBy,
        'isParty': isParty,
        'isRevisionRequested': isRevisionRequested,
        'isPrivate': isPrivate,
        'departmentId': departmentId,
        'publicationDate': JsonConverters.toJson(publicationDate,'DateTime',context!),
        'processStatusId': processStatusId,
        'documentTypeId': documentTypeId,
        'documentGroupId': documentGroupId,
        'accountName': accountName,
        'acceptAccountName': acceptAccountName,
        'documentGroupText': documentGroupText,
        'processStatusText': processStatusText,
        'documentTypeText': documentTypeText,
        'departmentText': departmentText,
        'statusText': statusText,
        'issuingAgencyText': issuingAgencyText,
        'subjectText': subjectText,
        'comment': comment,
        'submitComment': submitComment,
        'fullFile': fullFile,
        'parthFile': parthFile,
        'isActive': isActive,
        'stepOrder': stepOrder,
        'stepCount': stepCount
    };

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

class SearchResponse implements IResponseRequest, IConvertible
{
    int? totalCount;
    int? code;
    List<DocumentSearchResultItem>? data;
    String? message;

    SearchResponse({this.totalCount,this.code,this.data,this.message});
    SearchResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        totalCount = json['totalCount'];
        code = json['code'];
        data = JsonConverters.fromJson(json['data'],'List<DocumentSearchResultItem>',context!);
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'totalCount': totalCount,
        'code': code,
        'data': JsonConverters.toJson(data,'List<DocumentSearchResultItem>',context!),
        'message': message
    };

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

class StatDocByTypeRequest extends SimpleSearchFilter implements IPost, IConvertible
{
    StatDocByTypeRequest();
    StatDocByTypeRequest.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "StatDocByTypeRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'DocumentSearchStage': TypeInfo(TypeOf.Enum, enumValues:DocumentSearchStage.values),
    'SimpleSearchFilter': TypeInfo(TypeOf.Class, create:() => SimpleSearchFilter()),
    'DocumentSearchResultItem': TypeInfo(TypeOf.Class, create:() => DocumentSearchResultItem()),
    'SearchResponse': TypeInfo(TypeOf.Class, create:() => SearchResponse()),
    'List<DocumentSearchResultItem>': TypeInfo(TypeOf.Class, create:() => <DocumentSearchResultItem>[]),
    'StatDocByTypeRequest': TypeInfo(TypeOf.Class, create:() => StatDocByTypeRequest()),
});

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

POST /document/stat-search-by-type HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	title: String,
	groupId: 0,
	subjectId: 0,
	isUrgent: False,
	documentSearchStage: All,
	isInternal: False,
	fromDate: "0001-01-01T00:00:00.0000000+07:06",
	toDate: "0001-01-01T00:00:00.0000000+07:06",
	typeId: 0,
	statusId: 0,
	issuingAgencyId: 0,
	isParty: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	totalCount: 0,
	code: 0,
	data: 
	[
		{
			title: String,
			description: String,
			owner: String,
			documentPolicyId: 0,
			updateDocumentId: 0,
			effectBeginDate: "0001-01-01T00:00:00.0000000+07:06",
			effectEndDate: "0001-01-01T00:00:00.0000000+07:06",
			issuingAgencyId: 0,
			subjectId: 0,
			signBy: String,
			signDate: "0001-01-01T00:00:00.0000000+07:06",
			updatedAt: "0001-01-01T00:00:00.0000000+07:06",
			statusId: 0,
			isInternal: False,
			documentNumber: String,
			documentCode: String,
			isUrgent: False,
			id: 0,
			reasonReturn: String,
			accountId: 0,
			approverId: 0,
			updatedBy: String,
			createdBy: String,
			isParty: False,
			isRevisionRequested: False,
			isPrivate: False,
			departmentId: 0,
			publicationDate: "0001-01-01T00:00:00.0000000+07:06",
			processStatusId: 0,
			documentTypeId: 0,
			documentGroupId: 0,
			accountName: String,
			acceptAccountName: String,
			documentGroupText: String,
			processStatusText: String,
			documentTypeText: String,
			departmentText: String,
			statusText: String,
			issuingAgencyText: String,
			subjectText: String,
			comment: String,
			submitComment: String,
			fullFile: String,
			parthFile: String,
			isActive: False,
			stepOrder: 0,
			stepCount: 0
		}
	],
	message: String
}