| POST | /workflow-delete-request/{Id}/approve |
|---|
import 'package:servicestack/servicestack.dart';
enum WorkflowDeleteRequestStatus
{
Pending,
Approved,
Rejected,
Cancelled,
}
class WorkflowDeleteRequestDetail implements IConvertible
{
int? id;
int? workflowId;
int? requestedBy;
String? requestedByName;
int? approverId;
String? approverName;
WorkflowDeleteRequestStatus? status;
String? reason;
String? comment;
DateTime? createdAt;
DateTime? actionAt;
WorkflowDeleteRequestDetail({this.id,this.workflowId,this.requestedBy,this.requestedByName,this.approverId,this.approverName,this.status,this.reason,this.comment,this.createdAt,this.actionAt});
WorkflowDeleteRequestDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
workflowId = json['workflowId'];
requestedBy = json['requestedBy'];
requestedByName = json['requestedByName'];
approverId = json['approverId'];
approverName = json['approverName'];
status = JsonConverters.fromJson(json['status'],'WorkflowDeleteRequestStatus',context!);
reason = json['reason'];
comment = json['comment'];
createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
actionAt = JsonConverters.fromJson(json['actionAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'workflowId': workflowId,
'requestedBy': requestedBy,
'requestedByName': requestedByName,
'approverId': approverId,
'approverName': approverName,
'status': JsonConverters.toJson(status,'WorkflowDeleteRequestStatus',context!),
'reason': reason,
'comment': comment,
'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
'actionAt': JsonConverters.toJson(actionAt,'DateTime',context!)
};
getTypeName() => "WorkflowDeleteRequestDetail";
TypeContext? context = _ctx;
}
class WorkflowDeleteRequestResponse implements IConvertible
{
int? code;
String? message;
bool? requiresApproval;
WorkflowDeleteRequestDetail? request;
WorkflowDeleteRequestResponse({this.code,this.message,this.requiresApproval,this.request});
WorkflowDeleteRequestResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
requiresApproval = json['requiresApproval'];
request = JsonConverters.fromJson(json['request'],'WorkflowDeleteRequestDetail',context!);
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'requiresApproval': requiresApproval,
'request': JsonConverters.toJson(request,'WorkflowDeleteRequestDetail',context!)
};
getTypeName() => "WorkflowDeleteRequestResponse";
TypeContext? context = _ctx;
}
class ApproveWorkflowDeleteRequest implements IConvertible
{
int? id;
bool? approve;
String? comment;
ApproveWorkflowDeleteRequest({this.id,this.approve,this.comment});
ApproveWorkflowDeleteRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
approve = json['approve'];
comment = json['comment'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'approve': approve,
'comment': comment
};
getTypeName() => "ApproveWorkflowDeleteRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'qlcn_api.vsmlab.vn', types: <String, TypeInfo> {
'WorkflowDeleteRequestStatus': TypeInfo(TypeOf.Enum, enumValues:WorkflowDeleteRequestStatus.values),
'WorkflowDeleteRequestDetail': TypeInfo(TypeOf.Class, create:() => WorkflowDeleteRequestDetail()),
'WorkflowDeleteRequestResponse': TypeInfo(TypeOf.Class, create:() => WorkflowDeleteRequestResponse()),
'ApproveWorkflowDeleteRequest': TypeInfo(TypeOf.Class, create:() => ApproveWorkflowDeleteRequest()),
});
Dart ApproveWorkflowDeleteRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /workflow-delete-request/{Id}/approve HTTP/1.1
Host: qlcn-api.vsmlab.vn
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: 0,
approve: False,
comment: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
code: 0,
message: String,
requiresApproval: False,
request:
{
id: 0,
workflowId: 0,
requestedBy: 0,
requestedByName: String,
approverId: 0,
approverName: String,
status: Pending,
reason: String,
comment: String,
actionAt: "0001-01-01T00:00:00.0000000+07:06"
}
}