Skip to content

Fix revenue accuracy, precision, and tenant isolation - #172

Open
RossiAlexis wants to merge 1 commit into
Base360-AI:mainfrom
RossiAlexis:main
Open

Fix revenue accuracy, precision, and tenant isolation#172
RossiAlexis wants to merge 1 commit into
Base360-AI:mainfrom
RossiAlexis:main

Conversation

@RossiAlexis

@RossiAlexis RossiAlexis commented Aug 26, 2026

Copy link
Copy Markdown

Summary

This PR resolves the revenue accuracy and privacy issues reported by Sunset Properties and Ocean Rentals.

Changes

  • Calculate monthly revenue using each property’s timezone.
  • Use the configured PostgreSQL database instead of mock fallback data.
  • Isolate Redis entries by tenant, property, year, and month.
  • Preserve monetary precision using decimal strings.
  • Reject authenticated users without a tenant assignment.
  • Return 404 for foreign or nonexistent properties.
  • Replace the hard-coded property list with tenant-scoped data.
  • Remove the fabricated revenue trend.

Verification:

✅ 7 backend tests passing
✅ Frontend production build passing
✅ Tested with both supplied client accounts
✅ Sunset March prop-001: USD 2250.00 — 4 reservations
✅ Ocean March prop-001: USD 0.00
✅ Repeated refreshes remain tenant-isolated
✅ Timezone-boundary reservation is correctly assigned to March

Detailed Findings

A complete explanation of the investigation, root causes, fixes, and verification is available in finding.MD.

Loom walkthrough

Video: Loom

P.S. Recording myself is a little outside my comfort zone, but I hope the walkthrough clearly communicates my investigation and decisions.

… dashboard features

- Created a .gitignore file to exclude unnecessary files and directories.
- Added a findings document detailing issues and fixes related to the revenue dashboard.
- Implemented tenant-aware revenue calculations, ensuring accurate data retrieval based on user permissions.
- Updated API endpoints to support tenant-specific property access and revenue summaries.
- Enhanced frontend components to dynamically load properties and display revenue data based on selected month and year.
- Added unit tests for revenue calculations and tenant isolation to ensure functionality and correctness.
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