- Auth: переключено на Pulse API (api.digital-home.site) вместо health - TabBar: Главная, Задачи, Привычки, Здоровье, Финансы - Models: TaskModels, HabitModels, FinanceModels, обновлённые AuthModels - Services: APIService (Pulse API), HealthAPIService (health отдельно) - Dashboard: обзор дня с задачами, привычками, readiness, балансом - Tasks: список, фильтр, создание, выполнение, удаление - Habits: список с прогресс-баром, отметка выполнения, стрики - Health: бывший DashboardView, HealthKit sync через health API key - Finance: баланс, список транзакций, добавление расхода/дохода - Health данные через x-api-key вместо JWT токена health сервиса
52 lines
1.2 KiB
Swift
52 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
struct FinanceTransaction: Codable, Identifiable {
|
|
let id: Int
|
|
var amount: Double
|
|
var categoryId: Int?
|
|
var description: String?
|
|
var type: String // "income" or "expense"
|
|
var date: String?
|
|
var createdAt: String?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case id, amount, description, type, date
|
|
case categoryId = "category_id"
|
|
case createdAt = "created_at"
|
|
}
|
|
}
|
|
|
|
struct FinanceCategory: Codable, Identifiable {
|
|
let id: Int
|
|
var name: String
|
|
var icon: String?
|
|
var color: String?
|
|
var type: String
|
|
}
|
|
|
|
struct FinanceSummary: Codable {
|
|
var totalIncome: Double?
|
|
var totalExpenses: Double?
|
|
var balance: Double?
|
|
var month: String?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case totalIncome = "total_income"
|
|
case totalExpenses = "total_expenses"
|
|
case balance, month
|
|
}
|
|
}
|
|
|
|
struct CreateTransactionRequest: Codable {
|
|
var amount: Double
|
|
var categoryId: Int?
|
|
var description: String?
|
|
var type: String
|
|
var date: String?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case amount, description, type, date
|
|
case categoryId = "category_id"
|
|
}
|
|
}
|