feat: add habit creation, savings tabs, fix dashboard, fix tab order
This commit is contained in:
@@ -55,6 +55,30 @@ struct SavingsCategory: Codable, Identifiable {
|
||||
}
|
||||
}
|
||||
|
||||
struct SavingsTransaction: Codable, Identifiable {
|
||||
let id: Int
|
||||
var categoryId: Int?
|
||||
var userId: Int?
|
||||
var amount: Double
|
||||
var type: String // "deposit" или "withdrawal"
|
||||
var description: String?
|
||||
var date: String?
|
||||
var createdAt: String?
|
||||
var categoryName: String?
|
||||
var userName: String?
|
||||
|
||||
var isDeposit: Bool { type == "deposit" }
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case id, amount, type, description, date
|
||||
case categoryId = "category_id"
|
||||
case userId = "user_id"
|
||||
case createdAt = "created_at"
|
||||
case categoryName = "category_name"
|
||||
case userName = "user_name"
|
||||
}
|
||||
}
|
||||
|
||||
struct SavingsStats: Codable {
|
||||
var totalBalance: Double?
|
||||
var totalDeposits: Double?
|
||||
|
||||
Reference in New Issue
Block a user