feat: полноценное Pulse приложение с TabBar

- 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 сервиса
This commit is contained in:
Cosmo
2026-03-25 11:49:52 +00:00
parent cf0e535639
commit c015824b36
23 changed files with 1090 additions and 202 deletions

View File

@@ -0,0 +1,51 @@
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"
}
}