/* Options: Date: 2026-02-04 10:25:57 SwiftVersion: 5.0 Version: 6.110 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://etc-api.vsmlab.vn //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: SignatureRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/Signature", "POST") public class SignatureRequest : IReturn, Codable { public typealias Return = SignatureResponse public var fileId:Int public var originalFileId:Int public var workflowId:Int public var stepId:Int public var subDocumentId:Int required public init(){} } public class SignatureResponse : IResponseRequest, Codable { public var code:Int public var message:String public var signedFile:UploadedFiles public var signLog:DocumentSignLog required public init(){} } public class UploadedFiles : BasicUploadedFile { public var id:Int? public var uploadedFile:String public var subDocumentId:Int? public var stepId:Int? public var code:Int required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case uploadedFile case subDocumentId case stepId case code } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) uploadedFile = try container.decodeIfPresent(String.self, forKey: .uploadedFile) subDocumentId = try container.decodeIfPresent(Int.self, forKey: .subDocumentId) stepId = try container.decodeIfPresent(Int.self, forKey: .stepId) code = try container.decodeIfPresent(Int.self, forKey: .code) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if uploadedFile != nil { try container.encode(uploadedFile, forKey: .uploadedFile) } if subDocumentId != nil { try container.encode(subDocumentId, forKey: .subDocumentId) } if stepId != nil { try container.encode(stepId, forKey: .stepId) } if code != nil { try container.encode(code, forKey: .code) } } } public protocol IResponseRequest { var code:Int { get set } var message:String { get set } } public class DocumentSignLog : Codable { public var id:Int public var documentId:Int public var subDocumentId:Int? public var stepId:Int public var fileId:Int // @StringLength(50) public var signProvider:String // @StringLength(100) public var certSerial:String public var isSuccess:Bool // @StringLength(500) public var signMessage:String public var signBy:Int public var signAt:Date public var requestId:String? public var originalFileId:Int? public var effectBeginDate:Date? public var effectEndDate:Date? required public init(){} } public class BasicUploadedFile : Codable { public var fileName:String public var filekey:String public var fileUrl:String public var checksum:String public var eTag:String public var fileSize:Int required public init(){} }