tvpl.api

<back to all web services

DocumentApproveRequest

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

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

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

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

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

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

class DocumentApproveRequest implements IPost, IConvertible
{
    int? documentId;
    String? submitComment;
    int? nextApproverId;
    DateTime? dueDate;

    DocumentApproveRequest({this.documentId,this.submitComment,this.nextApproverId,this.dueDate});
    DocumentApproveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        documentId = json['documentId'];
        submitComment = json['submitComment'];
        nextApproverId = json['nextApproverId'];
        dueDate = JsonConverters.fromJson(json['dueDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'documentId': documentId,
        'submitComment': submitComment,
        'nextApproverId': nextApproverId,
        'dueDate': JsonConverters.toJson(dueDate,'DateTime',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'ApprovalResponse': TypeInfo(TypeOf.Class, create:() => ApprovalResponse()),
    'DocumentApproveRequest': TypeInfo(TypeOf.Class, create:() => DocumentApproveRequest()),
});

Dart DocumentApproveRequest DTOs

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

HTTP + OTHER

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

POST /document/approve HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"documentId":0,"submitComment":"String","nextApproverId":0,"dueDate":"0001-01-01T00:00:00.0000000+07:06"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

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