| POST | /document/advance-create |
|---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
open class AdvanceCreateDocument : BasicDocument()
{
var partUploadedFile:UploadedFiles? = null
var compactUploadedFile:UploadedFiles? = null
var analysisUploadedFile:UploadedFiles? = null
var fullUploadedFile:UploadedFiles? = null
var attachFiles:ArrayList<UploadedFiles> = ArrayList<UploadedFiles>()
var basisDocumentId:ArrayList<Int> = ArrayList<Int>()
var referenceDocumentId:ArrayList<Int> = ArrayList<Int>()
var replacedDocumentId:ArrayList<Int> = ArrayList<Int>()
var expiredDocumentId:ArrayList<Int> = ArrayList<Int>()
}
open class BasicDocument
{
@Required()
var title:String? = null
@StringLength(4000)
var description:String? = null
@StringLength(500)
var owner:String? = null
var documentPolicyId:Int? = null
var updateDocumentId:Int? = null
var effectBeginDate:Date? = null
var effectEndDate:Date? = null
var issuingAgencyId:Int? = null
var documentTypeId:Int? = null
var documentGroupId:Int? = null
var subjectId:Int? = null
@StringLength(500)
var signBy:String? = null
var signDate:Date? = null
var statusId:Int? = null
var isInternal:Boolean? = null
var documentNumber:String? = null
var documentCode:String? = null
var isUrgent:Boolean? = null
var scopeType:Int? = null
var isActive:Boolean? = null
}
open class UploadedFiles : BasicUploadedFile()
{
var id:Long? = null
var uploadedFile:String? = null
var subDocumentId:Int? = null
var stepId:Int? = null
var code:Int? = null
}
open class BasicUploadedFile
{
var fileName:String? = null
var filekey:String? = null
var fileUrl:String? = null
var checksum:String? = null
var eTag:String? = null
var fileSize:Long? = null
}
open class DocumentDetailResponse : IResponseRequest
{
@SerializedName("data") var Data:DocumentDetail? = null
var code:Int? = null
var message:String? = null
}
open class DocumentDetail : DocumentSearchResultItem()
{
var partUploadedFile:UploadedFileAttach? = null
var compactUploadedFile:UploadedFileAttach? = null
var analysisUploadedFile:UploadedFileAttach? = null
var fullUploadedFile:UploadedFileAttach? = null
var createdAt:Date? = null
var nextApprover:ApproversProfile? = null
var currentApprover:CurrentApprover? = null
var attachFiles:ArrayList<UploadedFileAttach> = ArrayList<UploadedFileAttach>()
var hasReadPermission:Boolean? = null
var canGrantReadPermission:Boolean? = null
var basisDocument:ArrayList<SimpleDocumentRelation> = ArrayList<SimpleDocumentRelation>()
var basisForDocument:ArrayList<SimpleDocumentRelation> = ArrayList<SimpleDocumentRelation>()
var mainDocument:SimpleDocumentRelation? = null
var referenceDocument:ArrayList<SimpleDocumentRelation> = ArrayList<SimpleDocumentRelation>()
var referencedByDocument:ArrayList<SimpleDocumentRelation> = ArrayList<SimpleDocumentRelation>()
var replacedDocument:ArrayList<SimpleDocumentRelation> = ArrayList<SimpleDocumentRelation>()
var replacedByDocument:ArrayList<SimpleDocumentRelation> = ArrayList<SimpleDocumentRelation>()
var expiredDocument:ArrayList<SimpleDocumentRelation> = ArrayList<SimpleDocumentRelation>()
var expiredByDocument:ArrayList<SimpleDocumentRelation> = ArrayList<SimpleDocumentRelation>()
var updateForDocument:SimpleDocumentRelation? = null
var scopeType:Int? = null
var stepOrder:Int? = null
}
open class DocumentSearchResultItem
{
var title:String? = null
var description:String? = null
var owner:String? = null
var documentPolicyId:Int? = null
var updateDocumentId:Int? = null
var effectBeginDate:Date? = null
var effectEndDate:Date? = null
var issuingAgencyId:Int? = null
var subjectId:Int? = null
var signBy:String? = null
var signDate:Date? = null
var updatedAt:Date? = null
var statusId:Int? = null
var isInternal:Boolean? = null
var documentNumber:String? = null
var documentCode:String? = null
var isUrgent:Boolean? = null
var id:Int? = null
var reasonReturn:String? = null
var accountId:Int? = null
var approverId:Int? = null
@StringLength(500)
var updatedBy:String? = null
@StringLength(500)
var createdBy:String? = null
var isParty:Boolean? = null
var isRevisionRequested:Boolean? = null
var isPrivate:Boolean? = null
var departmentId:Int? = null
var publicationDate:Date? = null
var processStatusId:Int? = null
var documentTypeId:Int? = null
var documentGroupId:Int? = null
var accountName:String? = null
var acceptAccountName:String? = null
var documentGroupText:String? = null
var processStatusText:String? = null
var documentTypeText:String? = null
var departmentText:String? = null
var statusText:String? = null
var issuingAgencyText:String? = null
var subjectText:String? = null
var comment:String? = null
var submitComment:String? = null
var fullFile:String? = null
var parthFile:String? = null
var isActive:Boolean? = null
var stepOrder:Int? = null
var stepCount:Int? = null
}
open class UploadedFileAttach : UploadedFileModel()
{
var fileType:String? = null
var subDocumentId:Int? = null
var stepId:Int? = null
}
open class UploadedFileModel : BasicUploadedFile()
{
var id:Long? = null
var accessType:AccessType? = null
var createdBy:Int? = null
var createdDate:Date? = null
}
enum class AccessType
{
Public,
Restricted,
}
open class ApproversProfile
{
var userProfiles:ArrayList<UserProfile> = ArrayList<UserProfile>()
var processStatusId:Int? = null
var processTitle:String? = null
var actionButtonLabel:String? = null
var processDescription:String? = null
var isApprovalRequired:Boolean? = null
var isFinalStep:Boolean? = null
var stepOrder:Int? = null
}
open class UserProfile : UserLogin()
{
var id:Int? = null
var fullName:String? = null
var email:String? = null
var departmentId:Int? = null
var partyGroupId:Int? = null
var avatar:String? = null
var telephone:String? = null
var birthday:Date? = null
var createdAt:Date? = null
var updatedAt:Date? = null
var failedLoginCount:Int? = null
@Ignore()
var roles:ArrayList<Int> = ArrayList<Int>()
var lastLoginDate:Date? = null
}
open class UserLogin
{
@Required()
var name:String? = null
}
open class CurrentApprover
{
var approverId:Int? = null
var status:String? = null
var processStatusId:Int? = null
var processTitle:String? = null
var actionButtonLabel:String? = null
var processDescription:String? = null
var isApprovalRequired:Boolean? = null
var isFinalStep:Boolean? = null
var stepOrder:Int? = null
}
open class SimpleDocumentRelation
{
var id:Int? = null
var title:String? = null
var documentCode:String? = null
var publicationDate:Date? = null
}
Kotlin AdvanceCreateDocument 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 /document/advance-create HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
partUploadedFile:
{
id: 0,
uploadedFile: String,
subDocumentId: 0,
stepId: 0,
code: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
compactUploadedFile:
{
id: 0,
uploadedFile: String,
subDocumentId: 0,
stepId: 0,
code: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
analysisUploadedFile:
{
id: 0,
uploadedFile: String,
subDocumentId: 0,
stepId: 0,
code: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
fullUploadedFile:
{
id: 0,
uploadedFile: String,
subDocumentId: 0,
stepId: 0,
code: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
attachFiles:
[
{
id: 0,
uploadedFile: String,
subDocumentId: 0,
stepId: 0,
code: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
}
],
basisDocumentId:
[
0
],
referenceDocumentId:
[
0
],
replacedDocumentId:
[
0
],
expiredDocumentId:
[
0
],
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,
documentTypeId: 0,
documentGroupId: 0,
subjectId: 0,
signBy: String,
signDate: "0001-01-01T00:00:00.0000000+07:06",
statusId: 0,
isInternal: False,
documentNumber: String,
documentCode: String,
isUrgent: False,
scopeType: 0,
isActive: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
data:
{
partUploadedFile:
{
fileType: String,
subDocumentId: 0,
stepId: 0,
id: 0,
accessType: Public,
createdBy: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
compactUploadedFile:
{
fileType: String,
subDocumentId: 0,
stepId: 0,
id: 0,
accessType: Public,
createdBy: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
analysisUploadedFile:
{
fileType: String,
subDocumentId: 0,
stepId: 0,
id: 0,
accessType: Public,
createdBy: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
fullUploadedFile:
{
fileType: String,
subDocumentId: 0,
stepId: 0,
id: 0,
accessType: Public,
createdBy: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
nextApprover:
{
userProfiles:
[
{
id: 0,
fullName: String,
email: String,
departmentId: 0,
partyGroupId: 0,
avatar: String,
telephone: String,
birthday: "0001-01-01T00:00:00.0000000+07:06",
createdAt: "0001-01-01T00:00:00.0000000+07:06",
updatedAt: "0001-01-01T00:00:00.0000000+07:06",
failedLoginCount: 0,
roles:
[
0
],
lastLoginDate: "0001-01-01T00:00:00.0000000+07:06",
name: String
}
],
processStatusId: 0,
processTitle: String,
actionButtonLabel: String,
processDescription: String,
isApprovalRequired: False,
isFinalStep: False,
stepOrder: 0
},
currentApprover:
{
approverId: 0,
status: String,
processStatusId: 0,
processTitle: String,
actionButtonLabel: String,
processDescription: String,
isApprovalRequired: False,
isFinalStep: False,
stepOrder: 0
},
attachFiles:
[
{
fileType: String,
subDocumentId: 0,
stepId: 0,
id: 0,
accessType: Public,
createdBy: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
}
],
hasReadPermission: False,
canGrantReadPermission: False,
basisDocument:
[
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
}
],
basisForDocument:
[
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
}
],
mainDocument:
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
},
referenceDocument:
[
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
}
],
referencedByDocument:
[
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
}
],
replacedDocument:
[
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
}
],
replacedByDocument:
[
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
}
],
expiredDocument:
[
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
}
],
expiredByDocument:
[
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
}
],
updateForDocument:
{
id: 0,
title: String,
documentCode: String,
publicationDate: "0001-01-01T00:00:00.0000000+07:06"
},
scopeType: 0,
stepOrder: 0,
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
},
code: 0,
message: String
}