mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-05-19 10:28:48 +02:00
Add accounts expansion, analytics, exchange rates, API tokens, PWA support, and UI overhaul
All checks were successful
Deploy to VPS / deploy (push) Successful in 45s
All checks were successful
Deploy to VPS / deploy (push) Successful in 45s
- Expand Account model with account_type (pension, savings, liability, crypto), new banks/currencies (BTC, XMR, FCL, ROP, VOL, MEMP, MPAT, MORTGAGE), and next_payment field - Add exchange rate endpoint (BCCR integration), analytics endpoint, paste-import for transactions, and API token management - Add PWA manifest, service worker, and app icons - Redesign dashboard, transactions, transfers, and login pages with theme support - Add billing cycle selector, confirm dialog, and paste import modal components - One-time DB reset in deploy workflow for schema migration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from sqlmodel import Session, select
|
||||
|
||||
from app.db import engine
|
||||
from app.models.models import Account, Bank, Category, Currency
|
||||
from app.models.models import Account, AccountType, Bank, Category, Currency
|
||||
|
||||
DEFAULT_CATEGORIES = [
|
||||
("Groceries", "shopping-cart", "automercado,auto mercado,fresh market,macrobiotica,pricesmart,price smart,grassfedcr,pequeno mundo"),
|
||||
@@ -23,10 +23,25 @@ DEFAULT_CATEGORIES = [
|
||||
]
|
||||
|
||||
DEFAULT_ACCOUNTS = [
|
||||
(Bank.BAC, Currency.CRC, "BAC Colones", 0.0),
|
||||
(Bank.BAC, Currency.USD, "BAC Dólares", 0.0),
|
||||
(Bank.BCR, Currency.CRC, "BCR Colones", 0.0),
|
||||
(Bank.DAVIVIENDA, Currency.CRC, "Davivienda Colones", 0.0),
|
||||
# Bank accounts
|
||||
(Bank.BAC, Currency.CRC, "BAC", AccountType.BANK),
|
||||
(Bank.BAC, Currency.USD, "BAC", AccountType.BANK),
|
||||
(Bank.BCR, Currency.CRC, "BCR", AccountType.BANK),
|
||||
(Bank.BCR, Currency.USD, "BCR", AccountType.BANK),
|
||||
(Bank.DAVIVIENDA, Currency.CRC, "DAV", AccountType.BANK),
|
||||
(Bank.DAVIVIENDA, Currency.USD, "DAV", AccountType.BANK),
|
||||
# Pensions (CRC)
|
||||
(Bank.FCL, Currency.CRC, "FCL", AccountType.PENSION),
|
||||
(Bank.ROP, Currency.CRC, "ROP", AccountType.PENSION),
|
||||
(Bank.VOL, Currency.CRC, "VOL", AccountType.PENSION),
|
||||
# Savings (CRC)
|
||||
(Bank.MEMP, Currency.CRC, "MEMP", AccountType.SAVINGS),
|
||||
(Bank.MPAT, Currency.CRC, "MPAT", AccountType.SAVINGS),
|
||||
# Liabilities
|
||||
(Bank.MORTGAGE, Currency.USD, "Mortgage", AccountType.LIABILITY),
|
||||
# Crypto
|
||||
(Bank.BAC, Currency.BTC, "BTC", AccountType.CRYPTO),
|
||||
(Bank.BAC, Currency.XMR, "XMR", AccountType.CRYPTO),
|
||||
]
|
||||
|
||||
|
||||
@@ -40,6 +55,6 @@ def seed_db():
|
||||
|
||||
existing_acc = session.exec(select(Account)).first()
|
||||
if not existing_acc:
|
||||
for bank, currency, label, balance in DEFAULT_ACCOUNTS:
|
||||
session.add(Account(bank=bank, currency=currency, label=label, balance=balance))
|
||||
for bank, currency, label, account_type in DEFAULT_ACCOUNTS:
|
||||
session.add(Account(bank=bank, currency=currency, label=label, account_type=account_type))
|
||||
session.commit()
|
||||
|
||||
Reference in New Issue
Block a user