-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/weekly reports effective revenue calculation #97
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
Fix/weekly reports effective revenue calculation #97
Conversation
…ustments - Added 'name' field to the project schema to ensure project identification in financial reports. - Updated `FinAppRepository` to include project names in the data retrieval process. - Removed unnecessary group total hours from report formatting to streamline output. - Adjusted formatting in `WeeklyFinancialReportFormatter` for improved readability and consistency. - Enhanced sorting logic in `WeeklyFinancialReportRepository` to sort groups by name alphabetically. These changes improve the clarity and organization of weekly financial reports, providing better insights into project performance.
Caution Review failedThe pull request is closed. WalkthroughIntegrates QBO effective revenue into weekly financial report generation. Adds effectiveRevenue to project data, updates FinApp schema/types and repository projection, adjusts formatter outputs and footer logic, refactors report repository to group-based aggregation and sorting by marginality, updates/adds tests, and changes QBO effectiveRevenueMonths default to 4. Changes
Sequence Diagram(s)sequenceDiagram
participant Cron as Cron/Worker
participant Activity as fetchFinancialAppData
participant FinApp as FinAppRepository
participant QBO as QBORepository
participant Storage as File Writer
Cron->>Activity: Execute
Activity->>FinApp: getEmployees(), getProjectsByRedmineIds(...)
Activity->>QBO: getEffectiveRevenue(projectIds, months)
QBO-->>Activity: Map<quick_books_id,effectiveRevenue>
Activity->>Activity: Enrich projects with effectiveRevenue (default 0)
Activity->>Storage: Write JSON {projects, employees, effectiveRevenue}
Activity-->>Cron: fileLink
sequenceDiagram
participant Repo as WeeklyFinancialReportRepository
participant Formatter as WeeklyFinancialReportFormatter
participant Marg as MarginalityCalculator
participant Config as qboConfig
Repo->>Repo: collectGroupData(targetUnits)
Repo->>Repo: aggregateGroupData per group (revenue, COGS, effectiveRevenue)
Repo->>Marg: calculate marginality/effectiveMarginality
Repo->>Repo: sortGroupData by marginality then name
Repo->>Repo: createSortedGroups (High/Medium/Low)
Repo->>Formatter: formatSummary({high, medium, low, lowGroups})
Formatter->>Config: effectiveRevenueMonths
Formatter-->>Repo: summary text
Repo->>Formatter: formatFooter()
Repo-->>Caller: {details, summary}
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yml ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
🔍 Vulnerabilities of
|
digest | sha256:b7ccf7fb78c14d77a50ca3ffc16b659ac3b8188192cba610310e1479c19e3e19 |
vulnerabilities | |
platform | linux/amd64 |
size | 248 MB |
packages | 1687 |
📦 Base Image node:20-alpine
Description
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
| ||||||||||||||||
Description
|
3a3d9be
into
feature/add_marginality_level
Enhance Weekly Financial Reports with Project Name and Formatting Adjustments
FinAppRepository
to include project names in the data retrieval process.WeeklyFinancialReportFormatter
for improved readability and consistency.WeeklyFinancialReportRepository
to sort groups by name alphabetically.These changes improve the clarity and organization of weekly financial reports, providing better insights into project performance.
Summary by CodeRabbit
New Features
Chores