Required role: | superadmin | Requires the role: | superadmin |
GET | /superadmin/billing/company/additionalinvoices | Get all company additional invoices for the subscription | Get all company additional invoices for the subscription you have assigned to. |
---|
import Foundation
import ServiceStack
// @ValidateRequest(Validator="IsAuthenticated")
public class SuperAdminAdditionalInvoiceQuery : QueryDb2<AdditionalInvoicing, AdditionalInvoiceQueryResponse>, ICompany
{
/**
* 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 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 BaseModel : Codable
{
required public init(){}
}
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 AccessKeyTypeResponse : Codable
{
public var id:Int
public var keyType:String
public var Description:String
required public init(){}
}
Swift SuperAdminAdditionalInvoiceQuery 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.
GET /superadmin/billing/company/additionalinvoices HTTP/1.1 Host: testapi.bokamera.se Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Offset: 0, Total: 0, Results: [ { Id: 00000000-0000-0000-0000-000000000000, ArticleNo: 0, Quantity: 0, Description: String, Date: "0001-01-01T00:00:00", CreatedBy: String } ], Meta: { String: String }, ResponseStatus: { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } } }