fix:revenue numbers that look like they belong to another company - #145
Open
tomnotthomas wants to merge 7 commits into
Open
fix:revenue numbers that look like they belong to another company#145tomnotthomas wants to merge 7 commits into
tomnotthomas wants to merge 7 commits into
Conversation
prop-001 exists under both tenants as two different buildings, so a property-only key returned one client's total to the other. Key the fallback by (tenant_id, property_id) and correct the figures to match database/seed.sql. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
float() in the dashboard response cannot represent NUMERIC(10, 3) totals exactly, and the frontend then scaled by 100 to round, losing the stored sub-cent precision. The amount is now passed and rendered as written, with no arithmetic on the way out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Month boundaries were naive datetimes, so they were compared against timestamptz check-ins as if they were UTC. A booking stored at 2024-02-29 23:30+00 is 1 March in Europe/Paris and was falling into February, understating Sunset Properties' March by 1250.00. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three faults left session_factory as None on every request, so revenue always fell back to hardcoded figures: initialize() read settings that do not exist, QueuePool is not valid for an async engine, and an async get_session cannot be used as a context manager. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Returning invented figures when the database is unreachable let a total outage look like a working dashboard. The error now propagates. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The function returned a hardcoded Decimal('0'), so the local-calendar
month boundaries were never applied to anything. It now reads the
property's timezone and sums reservations over that window.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tomnotthomas
marked this pull request as ready for review
August 7, 2026 14:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.