Added comprehensive services management with intelligent predictions: - New Services page (/services) with Luz, Agua, Gas, Internet tracking - AI-powered bill prediction based on historical data - Trend analysis (up/down percentage) for consumption patterns - Interactive service cards with icons and visual indicators - Complete payment history with period tracking - AddServiceModal for registering new bills - ServiceBill type definition with period tracking (YYYY-MM) - Services slice in Zustand store - Predictions engine using historical data analysis 🤖 Generated with [Claude Code](https://claude.com/claude-code)
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { create } from 'zustand'
|
|
import { persist } from 'zustand/middleware'
|
|
import { AppState } from '@/lib/types'
|
|
import { createDebtsSlice, DebtsSlice } from './store/slices/debtsSlice'
|
|
import { createCardsSlice, CardsSlice } from './store/slices/cardsSlice'
|
|
import { createBudgetSlice, BudgetSlice } from './store/slices/budgetSlice'
|
|
import { createAlertsSlice, AlertsSlice } from './store/slices/alertsSlice'
|
|
|
|
import { createServicesSlice, ServicesSlice } from './store/slices/servicesSlice'
|
|
|
|
// Combined State Interface
|
|
// Note: We extend the individual slices to create the full store interface
|
|
export interface FinanzasState extends DebtsSlice, CardsSlice, BudgetSlice, AlertsSlice, ServicesSlice { }
|
|
|
|
export const useFinanzasStore = create<FinanzasState>()(
|
|
persist(
|
|
(...a) => ({
|
|
...createDebtsSlice(...a),
|
|
...createCardsSlice(...a),
|
|
...createBudgetSlice(...a),
|
|
...createAlertsSlice(...a),
|
|
...createServicesSlice(...a),
|
|
}),
|
|
{
|
|
name: 'finanzas-storage',
|
|
// Optional: Filter what gets persisted if needed in the future
|
|
// partialize: (state) => ({ ... })
|
|
}
|
|
)
|
|
)
|