-
Notifications
You must be signed in to change notification settings - Fork 0
fix(admin): align revenue chart to July and August #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252,6 +252,15 @@ function platformAnalyticsRegistrationDate(index) { | |
| return new Date(Date.UTC(2026, monthIndex, day, 8 + (index % 9), (index * 11) % 60)); | ||
| } | ||
|
|
||
| // BUA-024: keep settled pilot revenue in the same July/August story as the | ||
| // synthetic customer cohort. Five July payments establish the smaller opening | ||
| // month; sixteen payments land before 14 August. | ||
| function platformAnalyticsPaymentDate(index) { | ||
| const monthIndex = index < 5 ? 6 : 7; | ||
| const day = index < 5 ? 5 + index * 6 : 1 + Math.floor(((index - 5) * 13) / 16); | ||
| return new Date(Date.UTC(2026, monthIndex, day, 9 + (index % 7), (index * 13) % 60)); | ||
| } | ||
|
|
||
| export function buildPlatformAnalyticsRows() { | ||
| const organizationNames = [ | ||
| 'An Phú Retail', | ||
|
|
@@ -300,8 +309,8 @@ export function buildPlatformAnalyticsRows() { | |
| }; | ||
| }); | ||
| const paymentOrders = organizations.map((organization, index) => { | ||
| const createdAt = minutesBefore((7 + index * 5) * 1_440); | ||
| const paidAt = minutesBefore((7 + index * 5) * 1_440 - 15); | ||
| const paidAt = platformAnalyticsPaymentDate(index); | ||
| const createdAt = new Date(paidAt.getTime() - 15 * 60 * 1_000); | ||
|
Comment on lines
+312
to
+313
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Keep For index 🤖 Prompt for AI Agents |
||
| return { | ||
| id: ids(8_300 + index), | ||
| provider: 'PAYOS', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert every leading zero-revenue month.
The test checks only
2026-02and2026-06. A regression that leaves2026-03,2026-04, or2026-05visible would still pass. Assert all five leading months.Suggested assertion
📝 Committable suggestion
🤖 Prompt for AI Agents