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.
41 lines
1.6 KiB
Swift
41 lines
1.6 KiB
Swift
//
|
||
// PeriodEarningView.swift
|
||
//
|
||
// Generated by openapi-generator
|
||
// https://openapi-generator.tech
|
||
//
|
||
|
||
import Foundation
|
||
|
||
public struct PeriodEarningView: Sendable, Codable, ParameterConvertible, Hashable {
|
||
|
||
/** CommissionCents is what the caller earned that period, in cents: the sum over each referred org and upline level of margin × that level's rate. Always ≤ marginCents, by construction. */
|
||
public var commissionCents: Int64?
|
||
/** MarginCents is the margin Hanzo earned in that period on the spend of every org the caller referred, in cents — the base commission is a rate OF. It is the aggregate base, never any one customer's bill. */
|
||
public var marginCents: Int64?
|
||
/** Period is the accrual bucket: the UTC year-month, \"YYYY-MM\". Commission is latched at most once per referred org per period, so one row is one month. */
|
||
public var period: String?
|
||
|
||
public init(commissionCents: Int64? = nil, marginCents: Int64? = nil, period: String? = nil) {
|
||
self.commissionCents = commissionCents
|
||
self.marginCents = marginCents
|
||
self.period = period
|
||
}
|
||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||
case commissionCents
|
||
case marginCents
|
||
case period
|
||
}
|
||
|
||
// Encodable protocol methods
|
||
|
||
public func encode(to encoder: Encoder) throws {
|
||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||
try container.encodeIfPresent(commissionCents, forKey: .commissionCents)
|
||
try container.encodeIfPresent(marginCents, forKey: .marginCents)
|
||
try container.encodeIfPresent(period, forKey: .period)
|
||
}
|
||
}
|
||
|