Signal-iOS/SignalServiceKit/Subscriptions/SubscriptionLevel.swift
2024-10-10 13:34:55 -07:00

33 lines
782 B
Swift

//
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
import Foundation
public class SubscriptionLevel: Comparable, Equatable, Codable {
public let level: UInt
public let badge: ProfileBadge
public let amounts: [Currency.Code: FiatMoney]
public init(
level: UInt,
badge: ProfileBadge,
amounts: [Currency.Code: FiatMoney]
) {
self.level = level
self.badge = badge
self.amounts = amounts
}
// MARK: Comparable
public static func < (lhs: SubscriptionLevel, rhs: SubscriptionLevel) -> Bool {
return lhs.level < rhs.level
}
public static func == (lhs: SubscriptionLevel, rhs: SubscriptionLevel) -> Bool {
return lhs.level == rhs.level
}
}