/* Options: Date: 2026-04-30 21:08:07 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: SearchPurchaseHistoryRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/purchase-history/search", "GET") public class SearchPurchaseHistoryRequest : PagingRequest, IReturn { public typealias Return = PageResponse public var name:String public var workflowId:Int? public var equipmentId:Int? public var providerId:Int? public var createdFrom:Date? public var createdTo:Date? public var onlyMissingEquipment:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case name case workflowId case equipmentId case providerId case createdFrom case createdTo case onlyMissingEquipment } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decodeIfPresent(String.self, forKey: .name) workflowId = try container.decodeIfPresent(Int.self, forKey: .workflowId) equipmentId = try container.decodeIfPresent(Int.self, forKey: .equipmentId) providerId = try container.decodeIfPresent(Int.self, forKey: .providerId) createdFrom = try container.decodeIfPresent(Date.self, forKey: .createdFrom) createdTo = try container.decodeIfPresent(Date.self, forKey: .createdTo) onlyMissingEquipment = try container.decodeIfPresent(Bool.self, forKey: .onlyMissingEquipment) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if name != nil { try container.encode(name, forKey: .name) } if workflowId != nil { try container.encode(workflowId, forKey: .workflowId) } if equipmentId != nil { try container.encode(equipmentId, forKey: .equipmentId) } if providerId != nil { try container.encode(providerId, forKey: .providerId) } if createdFrom != nil { try container.encode(createdFrom, forKey: .createdFrom) } if createdTo != nil { try container.encode(createdTo, forKey: .createdTo) } if onlyMissingEquipment != nil { try container.encode(onlyMissingEquipment, forKey: .onlyMissingEquipment) } } } public class PageResponse : IResponseRequest, Codable { public var code:Int public var message:String public var data:[PurchaseHistory] = [] public var pagination:Pagination required public init(){} } public class PagingRequest : Codable { public var page:Int public var limit:Int required public init(){} }