Skip to content

Fix/revenue dashboard#112

Open
ahmadalauddin wants to merge 4 commits into
Base360-AI:mainfrom
ahmadalauddin:fix/revenue-dashboard
Open

Fix/revenue dashboard#112
ahmadalauddin wants to merge 4 commits into
Base360-AI:mainfrom
ahmadalauddin:fix/revenue-dashboard

Conversation

@ahmadalauddin

@ahmadalauddin ahmadalauddin commented Jun 8, 2026

Copy link
Copy Markdown

What Fixes the 3 reported dashboard issues + the reason none of it worked.

Turned out the DB pool was misconfigured (wrong settings, async-incompatible QueuePool, missing await), so every tenant was just getting hardcoded mock data. Fixed that first, then the actual bugs:

  • DB pool use database_url + asyncpg, real data flows now.
  • Cache leak key was revenue:{property_id}, no tenant, so tenants with the same property id saw each other's numbers. Namespaced by tenant + added a mismatch guard.
  • March totals monthly revenue bucketed in naive UTC, ignored property timezone. 23:30 UTC Feb 29 = Mar 1 in Paris, was counted in Feb. Now derives month bounds in the property's tz in SQL.
  • Cent errors money was cast to float. Switched to Decimal.

Tested

docker-compose up --build. Sunset prop-001 → 2250/4, Ocean prop-001 → 0/0, separate cache keys per tenant, March now 2250 not 1000.

Files: database_pool.py, reservations.py, cache.py, dashboard.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant