swift-domain-models/Sources/LilithDomainModels/RateCardContent.swift

42 lines
1.1 KiB
Swift

import Foundation
// MARK: - Rate Entry
/// A single rate/duration entry within a rate card.
public struct RateEntry: Codable, Hashable, Sendable {
public let duration: Double
public let amount: Double
public let label: String?
public init(duration: Double, amount: Double, label: String? = nil) {
self.duration = duration
self.amount = amount
self.label = label
}
}
// MARK: - Rate Card Content
/// Backend-aligned rate card content.
/// Source: `message.entity.ts` `RateCardContent`
public struct RateCardContent: Codable, Hashable, Sendable {
public let profileId: String
public let rates: [RateEntry]
public let currency: String
public let services: [String]
public let note: String?
public init(
profileId: String,
rates: [RateEntry],
currency: String,
services: [String],
note: String? = nil
) {
self.profileId = profileId
self.rates = rates
self.currency = currency
self.services = services
self.note = note
}
}