/* Options: Date: 2025-04-24 16:51:00 SwiftVersion: 5.0 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://testapi.bokamera.se //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: SuperAdminAdditionalInvoiceQuery.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/superadmin/billing/company/additionalinvoices", "GET") // @ValidateRequest(Validator="IsAuthenticated") public class SuperAdminAdditionalInvoiceQuery : QueryDb2, IReturn, ICompany { public typealias Return = QueryResponse /** * The company id, if empty will use the company id for the user you are logged in with. */ // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.") public var companyId:String? /** * Id of the invoice */ // @ApiMember(Description="Id of the invoice") public var id:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case companyId case id } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) companyId = try container.decodeIfPresent(String.self, forKey: .companyId) id = try container.decodeIfPresent(String.self, forKey: .id) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if companyId != nil { try container.encode(companyId, forKey: .companyId) } if id != nil { try container.encode(id, forKey: .id) } } } public protocol ICompany { var companyId:String? { get set } } public class AdditionalInvoicing : BaseModel, IBaseModelUpdated, IBaseModelCreated { // @Required() public var companyId:String? // @Required() public var id:String? public var articleNo:Int public var quantity:Int public var Description:String public var date:Date? public var createdBy:String public var createdDate:Date // @Required() public var updatedDate:Date? public var syncedToAccounting:Bool public var accountingSystemInfo:String public var modifiedDate:Date? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case companyId case id case articleNo case quantity case Description case date case createdBy case createdDate case updatedDate case syncedToAccounting case accountingSystemInfo case modifiedDate } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) companyId = try container.decodeIfPresent(String.self, forKey: .companyId) id = try container.decodeIfPresent(String.self, forKey: .id) articleNo = try container.decodeIfPresent(Int.self, forKey: .articleNo) quantity = try container.decodeIfPresent(Int.self, forKey: .quantity) Description = try container.decodeIfPresent(String.self, forKey: .Description) date = try container.decodeIfPresent(Date.self, forKey: .date) createdBy = try container.decodeIfPresent(String.self, forKey: .createdBy) createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate) updatedDate = try container.decodeIfPresent(Date.self, forKey: .updatedDate) syncedToAccounting = try container.decodeIfPresent(Bool.self, forKey: .syncedToAccounting) accountingSystemInfo = try container.decodeIfPresent(String.self, forKey: .accountingSystemInfo) modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if companyId != nil { try container.encode(companyId, forKey: .companyId) } if id != nil { try container.encode(id, forKey: .id) } if articleNo != nil { try container.encode(articleNo, forKey: .articleNo) } if quantity != nil { try container.encode(quantity, forKey: .quantity) } if Description != nil { try container.encode(Description, forKey: .Description) } if date != nil { try container.encode(date, forKey: .date) } if createdBy != nil { try container.encode(createdBy, forKey: .createdBy) } if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) } if updatedDate != nil { try container.encode(updatedDate, forKey: .updatedDate) } if syncedToAccounting != nil { try container.encode(syncedToAccounting, forKey: .syncedToAccounting) } if accountingSystemInfo != nil { try container.encode(accountingSystemInfo, forKey: .accountingSystemInfo) } if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) } } } public class AdditionalInvoiceQueryResponse : Codable { /** * The company id */ // @ApiMember(Description="The company id") public var companyId:String /** * The invoice id */ // @ApiMember(Description="The invoice id") public var id:String? /** * ArticleNo */ // @ApiMember(Description="ArticleNo") public var articleNo:Int /** * Quantity */ // @ApiMember(Description="Quantity") public var quantity:Int /** * Description */ // @ApiMember(Description="Description") public var Description:String /** * Invoie date */ // @ApiMember(Description="Invoie date") public var date:Date? /** * Created By */ // @ApiMember(Description="Created By") public var createdBy:String /** * Created Date */ // @ApiMember(Description="Created Date") public var createdDate:Date /** * Updated Date */ // @ApiMember(Description="Updated Date") public var updatedDate:Date required public init(){} } public class BaseModel : Codable { required public init(){} } public protocol IBaseModelCreated { var createdDate:Date { get set } } public protocol IBaseModelUpdated { var updatedDate:Date { get set } }