tvpl.api

<back to all web services

CreateWorkflowStepRequest

Requires Authentication
The following routes are available for this service:
POST/WorkflowStep/update
import 'package:servicestack/servicestack.dart';

class BasicUploadedFile implements IConvertible
{
    String? fileName;
    String? filekey;
    String? fileUrl;
    String? checksum;
    String? eTag;
    int? fileSize;

    BasicUploadedFile({this.fileName,this.filekey,this.fileUrl,this.checksum,this.eTag,this.fileSize});
    BasicUploadedFile.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        fileName = json['fileName'];
        filekey = json['filekey'];
        fileUrl = json['fileUrl'];
        checksum = json['checksum'];
        eTag = json['eTag'];
        fileSize = json['fileSize'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'fileName': fileName,
        'filekey': filekey,
        'fileUrl': fileUrl,
        'checksum': checksum,
        'eTag': eTag,
        'fileSize': fileSize
    };

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

class UploadedFiles extends BasicUploadedFile implements IConvertible
{
    int? id;
    String? uploadedFile;
    int? subDocumentId;
    int? stepId;
    int? code;

    UploadedFiles({this.id,this.uploadedFile,this.subDocumentId,this.stepId,this.code});
    UploadedFiles.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        uploadedFile = json['uploadedFile'];
        subDocumentId = json['subDocumentId'];
        stepId = json['stepId'];
        code = json['code'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'uploadedFile': uploadedFile,
        'subDocumentId': subDocumentId,
        'stepId': stepId,
        'code': code
    });

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

class BasicSignerConfig implements IConvertible
{
    int? subDocumentId;
    int? departmentId;
    int? signerType;
    int? signerRefId;
    // @ignore()
    String? signerRefText;

    int? actionType;
    int? orderIndex;

    BasicSignerConfig({this.subDocumentId,this.departmentId,this.signerType,this.signerRefId,this.signerRefText,this.actionType,this.orderIndex});
    BasicSignerConfig.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        subDocumentId = json['subDocumentId'];
        departmentId = json['departmentId'];
        signerType = json['signerType'];
        signerRefId = json['signerRefId'];
        signerRefText = json['signerRefText'];
        actionType = json['actionType'];
        orderIndex = json['orderIndex'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'subDocumentId': subDocumentId,
        'departmentId': departmentId,
        'signerType': signerType,
        'signerRefId': signerRefId,
        'signerRefText': signerRefText,
        'actionType': actionType,
        'orderIndex': orderIndex
    };

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

class SignerConfig extends BasicSignerConfig implements IConvertible
{
    int? id;
    int? documentId;
    int? stepId;

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

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'documentId': documentId,
        'stepId': stepId
    });

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

class WorkFlowProfile implements IConvertible
{
    int? id;
    String? name;
    String? fullName;
    String? email;
    int? departmentId;
    String? avatar;
    String? telephone;
    DateTime? birthday;
    int? confirmStatus;
    String? confirmStatusText;
    DateTime? signAt;
    int? signedFileId;
    int? originalFileId;
    String? signedFileName;
    bool? isSigned;
    String? signStatusText;

    WorkFlowProfile({this.id,this.name,this.fullName,this.email,this.departmentId,this.avatar,this.telephone,this.birthday,this.confirmStatus,this.confirmStatusText,this.signAt,this.signedFileId,this.originalFileId,this.signedFileName,this.isSigned,this.signStatusText});
    WorkFlowProfile.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        fullName = json['fullName'];
        email = json['email'];
        departmentId = json['departmentId'];
        avatar = json['avatar'];
        telephone = json['telephone'];
        birthday = JsonConverters.fromJson(json['birthday'],'DateTime',context!);
        confirmStatus = json['confirmStatus'];
        confirmStatusText = json['confirmStatusText'];
        signAt = JsonConverters.fromJson(json['signAt'],'DateTime',context!);
        signedFileId = json['signedFileId'];
        originalFileId = json['originalFileId'];
        signedFileName = json['signedFileName'];
        isSigned = json['isSigned'];
        signStatusText = json['signStatusText'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'fullName': fullName,
        'email': email,
        'departmentId': departmentId,
        'avatar': avatar,
        'telephone': telephone,
        'birthday': JsonConverters.toJson(birthday,'DateTime',context!),
        'confirmStatus': confirmStatus,
        'confirmStatusText': confirmStatusText,
        'signAt': JsonConverters.toJson(signAt,'DateTime',context!),
        'signedFileId': signedFileId,
        'originalFileId': originalFileId,
        'signedFileName': signedFileName,
        'isSigned': isSigned,
        'signStatusText': signStatusText
    };

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

class Roles implements IConvertible
{
    int? id;
    // @StringLength(50)
    String? name;

    DateTime? createdAt;
    DateTime? deletedAt;
    DateTime? updatedAt;
    int? updatedBy;
    int? deletedBy;
    int? createdBy;
    // @ignore()
    List<String>? permission;

    Roles({this.id,this.name,this.createdAt,this.deletedAt,this.updatedAt,this.updatedBy,this.deletedBy,this.createdBy,this.permission});
    Roles.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
        deletedAt = JsonConverters.fromJson(json['deletedAt'],'DateTime',context!);
        updatedAt = JsonConverters.fromJson(json['updatedAt'],'DateTime',context!);
        updatedBy = json['updatedBy'];
        deletedBy = json['deletedBy'];
        createdBy = json['createdBy'];
        permission = JsonConverters.fromJson(json['permission'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
        'deletedAt': JsonConverters.toJson(deletedAt,'DateTime',context!),
        'updatedAt': JsonConverters.toJson(updatedAt,'DateTime',context!),
        'updatedBy': updatedBy,
        'deletedBy': deletedBy,
        'createdBy': createdBy,
        'permission': JsonConverters.toJson(permission,'List<String>',context!)
    };

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

class SignerConfigDetail extends SignerConfig implements IConvertible
{
    WorkFlowProfile? profile;
    Roles? role;

    SignerConfigDetail({this.profile,this.role});
    SignerConfigDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        profile = JsonConverters.fromJson(json['profile'],'WorkFlowProfile',context!);
        role = JsonConverters.fromJson(json['role'],'Roles',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'profile': JsonConverters.toJson(profile,'WorkFlowProfile',context!),
        'role': JsonConverters.toJson(role,'Roles',context!)
    });

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

class StepAttached implements IConvertible
{
    int? id;
    String? documentCode;
    String? title;
    bool? isSequentialSigning;
    UploadedFiles? pendingSignFile;
    UploadedFiles? originalFile;
    List<SignerConfigDetail>? signerConfigs;

    StepAttached({this.id,this.documentCode,this.title,this.isSequentialSigning,this.pendingSignFile,this.originalFile,this.signerConfigs});
    StepAttached.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        documentCode = json['documentCode'];
        title = json['title'];
        isSequentialSigning = json['isSequentialSigning'];
        pendingSignFile = JsonConverters.fromJson(json['pendingSignFile'],'UploadedFiles',context!);
        originalFile = JsonConverters.fromJson(json['originalFile'],'UploadedFiles',context!);
        signerConfigs = JsonConverters.fromJson(json['signerConfigs'],'List<SignerConfigDetail>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'documentCode': documentCode,
        'title': title,
        'isSequentialSigning': isSequentialSigning,
        'pendingSignFile': JsonConverters.toJson(pendingSignFile,'UploadedFiles',context!),
        'originalFile': JsonConverters.toJson(originalFile,'UploadedFiles',context!),
        'signerConfigs': JsonConverters.toJson(signerConfigs,'List<SignerConfigDetail>',context!)
    };

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

class WorkflowStep implements IConvertible
{
    int? id;
    // @References(typeof(Document))
    int? workflowId;

    int? stepOrder;
    int? statusId;
    // @required()
    // @StringLength(255)
    String? stepName;

    // @required()
    bool? isRequired;

    int? slaLegalValue;
    bool? slaLegalIsByDay;
    int? slaInternalValue;
    bool? slaInternalIsByDay;
    bool? requireAttachment;
    bool? isUsingForm;
    // @required()
    String? description;

    int? createdBy;
    // @ignore()
    List<int>? departmentIds;

    // @ignore()
    List<int>? mainAssigneeIds;

    // @ignore()
    List<int>? coDepartmentIds;

    // @ignore()
    List<int>? supportingAssigneeIds;

    // @ignore()
    List<int>? stepBasisDocumentIds;

    // @ignore()
    List<StepAttached>? attachedDocuments;

    WorkflowStep({this.id,this.workflowId,this.stepOrder,this.statusId,this.stepName,this.isRequired,this.slaLegalValue,this.slaLegalIsByDay,this.slaInternalValue,this.slaInternalIsByDay,this.requireAttachment,this.isUsingForm,this.description,this.createdBy,this.departmentIds,this.mainAssigneeIds,this.coDepartmentIds,this.supportingAssigneeIds,this.stepBasisDocumentIds,this.attachedDocuments});
    WorkflowStep.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        workflowId = json['workflowId'];
        stepOrder = json['stepOrder'];
        statusId = json['statusId'];
        stepName = json['stepName'];
        isRequired = json['isRequired'];
        slaLegalValue = json['slaLegalValue'];
        slaLegalIsByDay = json['slaLegalIsByDay'];
        slaInternalValue = json['slaInternalValue'];
        slaInternalIsByDay = json['slaInternalIsByDay'];
        requireAttachment = json['requireAttachment'];
        isUsingForm = json['isUsingForm'];
        description = json['description'];
        createdBy = json['createdBy'];
        departmentIds = JsonConverters.fromJson(json['departmentIds'],'List<int>',context!);
        mainAssigneeIds = JsonConverters.fromJson(json['mainAssigneeIds'],'List<int>',context!);
        coDepartmentIds = JsonConverters.fromJson(json['coDepartmentIds'],'List<int>',context!);
        supportingAssigneeIds = JsonConverters.fromJson(json['supportingAssigneeIds'],'List<int>',context!);
        stepBasisDocumentIds = JsonConverters.fromJson(json['stepBasisDocumentIds'],'List<int>',context!);
        attachedDocuments = JsonConverters.fromJson(json['attachedDocuments'],'List<StepAttached>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'workflowId': workflowId,
        'stepOrder': stepOrder,
        'statusId': statusId,
        'stepName': stepName,
        'isRequired': isRequired,
        'slaLegalValue': slaLegalValue,
        'slaLegalIsByDay': slaLegalIsByDay,
        'slaInternalValue': slaInternalValue,
        'slaInternalIsByDay': slaInternalIsByDay,
        'requireAttachment': requireAttachment,
        'isUsingForm': isUsingForm,
        'description': description,
        'createdBy': createdBy,
        'departmentIds': JsonConverters.toJson(departmentIds,'List<int>',context!),
        'mainAssigneeIds': JsonConverters.toJson(mainAssigneeIds,'List<int>',context!),
        'coDepartmentIds': JsonConverters.toJson(coDepartmentIds,'List<int>',context!),
        'supportingAssigneeIds': JsonConverters.toJson(supportingAssigneeIds,'List<int>',context!),
        'stepBasisDocumentIds': JsonConverters.toJson(stepBasisDocumentIds,'List<int>',context!),
        'attachedDocuments': JsonConverters.toJson(attachedDocuments,'List<StepAttached>',context!)
    };

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

class WorkflowStepResponse implements IResponseRequest, IConvertible
{
    int? code;
    String? message;
    int? insertedId;

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

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

    Map<String, dynamic> toJson() => {
        'code': code,
        'message': message,
        'insertedId': insertedId
    };

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

class CreateWorkflowStepRequest extends WorkflowStep implements IConvertible
{
    CreateWorkflowStepRequest();
    CreateWorkflowStepRequest.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() => "CreateWorkflowStepRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'BasicUploadedFile': TypeInfo(TypeOf.Class, create:() => BasicUploadedFile()),
    'UploadedFiles': TypeInfo(TypeOf.Class, create:() => UploadedFiles()),
    'BasicSignerConfig': TypeInfo(TypeOf.Class, create:() => BasicSignerConfig()),
    'SignerConfig': TypeInfo(TypeOf.Class, create:() => SignerConfig()),
    'WorkFlowProfile': TypeInfo(TypeOf.Class, create:() => WorkFlowProfile()),
    'Roles': TypeInfo(TypeOf.Class, create:() => Roles()),
    'SignerConfigDetail': TypeInfo(TypeOf.Class, create:() => SignerConfigDetail()),
    'StepAttached': TypeInfo(TypeOf.Class, create:() => StepAttached()),
    'List<SignerConfigDetail>': TypeInfo(TypeOf.Class, create:() => <SignerConfigDetail>[]),
    'WorkflowStep': TypeInfo(TypeOf.Class, create:() => WorkflowStep()),
    'List<StepAttached>': TypeInfo(TypeOf.Class, create:() => <StepAttached>[]),
    'WorkflowStepResponse': TypeInfo(TypeOf.Class, create:() => WorkflowStepResponse()),
    'CreateWorkflowStepRequest': TypeInfo(TypeOf.Class, create:() => CreateWorkflowStepRequest()),
});

Dart CreateWorkflowStepRequest DTOs

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

HTTP + CSV

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

POST /WorkflowStep/update HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"id":0,"workflowId":0,"stepOrder":0,"statusId":0,"stepName":"String","isRequired":false,"slaLegalValue":0,"slaLegalIsByDay":false,"slaInternalValue":0,"slaInternalIsByDay":false,"requireAttachment":false,"isUsingForm":false,"description":"String","createdBy":0,"departmentIds":[0],"mainAssigneeIds":[0],"coDepartmentIds":[0],"supportingAssigneeIds":[0],"stepBasisDocumentIds":[0],"attachedDocuments":[{"id":0,"documentCode":"String","title":"String","isSequentialSigning":false,"pendingSignFile":{"id":0,"uploadedFile":"String","subDocumentId":0,"stepId":0,"code":0,"fileName":"String","filekey":"String","fileUrl":"String","checksum":"String","eTag":"String","fileSize":0},"originalFile":{"id":0,"uploadedFile":"String","subDocumentId":0,"stepId":0,"code":0,"fileName":"String","filekey":"String","fileUrl":"String","checksum":"String","eTag":"String","fileSize":0},"signerConfigs":[{"profile":{"id":0,"name":"String","fullName":"String","email":"String","departmentId":0,"avatar":"String","telephone":"String","birthday":"0001-01-01T00:00:00.0000000+07:06","confirmStatus":0,"confirmStatusText":"String","signAt":"0001-01-01T00:00:00.0000000+07:06","signedFileId":0,"originalFileId":0,"signedFileName":"String","isSigned":false,"signStatusText":"String"},"role":{"id":0,"name":"String","createdAt":"0001-01-01T00:00:00.0000000+07:06","deletedAt":"0001-01-01T00:00:00.0000000+07:06","updatedAt":"0001-01-01T00:00:00.0000000+07:06","updatedBy":0,"deletedBy":0,"createdBy":0,"permission":["String"]},"id":0,"documentId":0,"stepId":0,"subDocumentId":0,"departmentId":0,"signerType":0,"signerRefId":0,"signerRefText":"String","actionType":0,"orderIndex":0}]}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"code":0,"message":"String","insertedId":0}