Add BudgetOverview.maxValue convenience field

This commit is contained in:
William Brawner 2023-01-03 21:28:16 -07:00
parent b242974544
commit 3c40566094

View file

@ -17,6 +17,14 @@ public struct Budget: Identifiable, Hashable, Codable {
public struct BudgetOverview: Equatable {
public let budget: Budget
public let balance: Int
public var maxValue: Float {
get {
return Float(max(
max(expectedIncome, actualIncome),
max(expectedExpenses, actualExpenses)
))
}
}
public var expectedIncome: Int
public var actualIncome: Int
public var expectedExpenses: Int