feat: add habit creation, savings tabs, fix dashboard, fix tab order

This commit is contained in:
Cosmo
2026-03-25 12:32:55 +00:00
parent 4c54467b5e
commit 17b82a874f
6 changed files with 339 additions and 30 deletions

View File

@@ -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?