mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
66 lines
2.8 KiB
Swift
66 lines
2.8 KiB
Swift
//
|
|
// Extracted.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Extracted: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Category is the expense bucket the SCANNER guessed, as a slug — a hint only. Vendor rules override it whenever they know better, so this is the model's reading and not the account the entry will land on. */
|
|
public var category: String?
|
|
/** Currency is the ISO code the document is denominated in. */
|
|
public var currency: String?
|
|
/** IssuedAt is the document's OWN date as YYYY-MM-DD — when the bill was issued, which is not when it was uploaded or when it will post. */
|
|
public var issuedAt: String?
|
|
/** LineItems are the individual lines read off the document, where it had any. They need not sum to totalCents: a document may carry lines the scanner could not read, and the total is taken from the total. */
|
|
public var lineItems: [LineItem]?
|
|
/** Merchant is the supplier as printed on the document. */
|
|
public var merchant: String?
|
|
/** Note is anything else worth carrying from the document that has no field of its own. */
|
|
public var note: String?
|
|
/** TaxCents is how much of that total is tax, in cents. It is part of totalCents, not additional to it. */
|
|
public var taxCents: Int64?
|
|
/** TotalCents is the document total in whole cents, tax INCLUDED. */
|
|
public var totalCents: Int64?
|
|
|
|
public init(category: String? = nil, currency: String? = nil, issuedAt: String? = nil, lineItems: [LineItem]? = nil, merchant: String? = nil, note: String? = nil, taxCents: Int64? = nil, totalCents: Int64? = nil) {
|
|
self.category = category
|
|
self.currency = currency
|
|
self.issuedAt = issuedAt
|
|
self.lineItems = lineItems
|
|
self.merchant = merchant
|
|
self.note = note
|
|
self.taxCents = taxCents
|
|
self.totalCents = totalCents
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case category
|
|
case currency
|
|
case issuedAt
|
|
case lineItems
|
|
case merchant
|
|
case note
|
|
case taxCents
|
|
case totalCents
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(category, forKey: .category)
|
|
try container.encodeIfPresent(currency, forKey: .currency)
|
|
try container.encodeIfPresent(issuedAt, forKey: .issuedAt)
|
|
try container.encodeIfPresent(lineItems, forKey: .lineItems)
|
|
try container.encodeIfPresent(merchant, forKey: .merchant)
|
|
try container.encodeIfPresent(note, forKey: .note)
|
|
try container.encodeIfPresent(taxCents, forKey: .taxCents)
|
|
try container.encodeIfPresent(totalCents, forKey: .totalCents)
|
|
}
|
|
}
|
|
|