Skip to content

Shreya P taking over for Vamsidhar - Create a Line Graph Chart for Cost Breakdown by Type of Expenditure#1357

Open
ReinaT5678 wants to merge 23 commits into
developmentfrom
reina-create-line-graph-chart-for-cost-breakdown-by-expenditure-backend
Open

Shreya P taking over for Vamsidhar - Create a Line Graph Chart for Cost Breakdown by Type of Expenditure#1357
ReinaT5678 wants to merge 23 commits into
developmentfrom
reina-create-line-graph-chart-for-cost-breakdown-by-expenditure-backend

Conversation

@ReinaT5678

@ReinaT5678 ReinaT5678 commented May 1, 2025

Copy link
Copy Markdown
Contributor

Description

image

Backend for a frontend line graph chart that shows time in months (x-axis) and cost (y-axis) of projects. The chart can be filtered by projects and by date range.

Related PRS (if any):

To test this backend PR you need to checkout the #3458 frontend PR --> Redone with OneCommunityGlobal/HighestGoodNetworkApp#3906

Main changes explained:

  • Added a controller file to retrieve the sample expenditure data from the backend (id, date, category, cost)
  • Schema for expenditure data
  • Corresponding routes under '/expenditure'

How to test:

  1. check into current branch
  2. do npm install and npm run start to run this PR locally
  3. Check out the frontend for more details

@ReinaT5678 ReinaT5678 added the Do Not Review Do not review or look at code without full context label May 1, 2025
@ReinaT5678 ReinaT5678 added High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible Do Not Review Do not review or look at code without full context and removed Do Not Review Do not review or look at code without full context High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible labels May 1, 2025
@Venk-rgb Venk-rgb self-assigned this Jun 27, 2025

@Venk-rgb Venk-rgb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the PR with the corresponding UI. Approving changes in the backend. I have added comments in the frontend PR.

Screen.Recording.2025-06-27.at.9.46.48.AM.mov

@ReinaT5678 ReinaT5678 removed the Do Not Review Do not review or look at code without full context label Jun 30, 2025

@shashank-madan shashank-madan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected in light mode.

filters light_mode total_construction_summary In dark mode axis and legend labels are not visible. Added further comments in frontend pr. dark_mode

Comment thread src/startup/routes.js Outdated
@suparshwa31

suparshwa31 commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

while I was testing of this PR I got an error fetching the data, the get request is failing
Screenshot 2025-07-08 at 16 31 21

@vamsidharpanithi vamsidharpanithi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked out and tested the backend along with the related frontend PR. The routes under /expenditure are defined, and the controller for retrieving expenditure data is present. However, the /ExpenditureLineGraph page on the frontend returns a 404 error, and there is a TypeError related to an undefined projectFilter state. This may indicate a mismatch between the expected backend response and the frontend integration. Please review the route accessibility and ensure the endpoint is correctly connected to the frontend component.

@adithya-6101 adithya-6101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the backend changes alongside the UI. The graph renders correctly, filters are working as expected, and both Light and Dark Mode are displaying properly and everything looks good. Approving this backend PR. I’ve shared my feedback separately on the frontend PR.

Screenshot 2025-07-15 144813 Screenshot 2025-07-15 144751

@Neeraj-Kondaveeti Neeraj-Kondaveeti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the backend PR locally. The server runs without issues, but the /expenditure endpoint seems to return a 404 when accessed via the frontend in PR #3458. Happy to retest once it's addressed.

Screenshot 2025-07-15 at 4 10 32 PM

@shashankm9 shashankm9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this PR along with the frontend, Everything is working as expected.

PR.3458.mp4

@harshavarma29 harshavarma29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested the related Frontend PR, and it's working as expected. However, I have left a few comments.

I noticed that an "undefined" category is being added next to the expenditures. Please refer to the screenshot below:

undefined-category

It seems the JSON property highlighted below leads to the "undefined" issue in the Frontend.

undefined-property

@kanishkagarwal6101 kanishkagarwal6101 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like few before me I am also getting the error in fetching data.
Screenshot 2025-08-04 at 1 10 57 PM

@aseemdeshmukh

Copy link
Copy Markdown

With reference to PR 3906, tested the backend:

  • After navigating to /bmdashboard/ExpenditureLineGraph), getting the error message:
    Error: Error fetching data: Request failed with status code 404 and I could not fetch the data
  • Even the 'Filter by project' drop down is not working to navigate through the list of projects
  • There was also a failure of GET request: GET https://api-staging.highestgood.com/api/bm/expenditure 404 (Not Found)
    PR3906+1357

@Swetha-1306

Copy link
Copy Markdown

Tested the related frontend PR #3906 by checking out this PR, got the following error while fetching the data: Error: Error fetching data: Request failed with status code 404

@vishnu-ing vishnu-ing left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the expenditure graph code changes and API in local and added comments in FE PR-3906.

@aseemdeshmukh aseemdeshmukh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfect! (Referred FE PR 3906)

  • Tested in light and dark mode. Everything is clearly visible.
  • Filters work properly.
  • Getting the error when start date is greater than end date; which is expected
  • attached screenshots

NOTE (Whoever is getting Error 404 and the graph is not loading; check if the frontend API hitting the backend. Make sure your .env file has the same port as backend, and in the browser when loading the website check the API.)

PR3906_1
PR3906_2

@one-community one-community added Do Not Review Do not review or look at code without full context Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it. labels Aug 26, 2025

@shashank-madan shashank-madan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, requested changes on the frontend branch

@one-community one-community changed the title Reina Create a Line Graph Chart for Cost Breakdown by Type of Expenditure Vamsidhar taking over for Reina Create a Line Graph Chart for Cost Breakdown by Type of Expenditure Feb 27, 2026
@one-community one-community changed the title Vamsidhar taking over for Reina Create a Line Graph Chart for Cost Breakdown by Type of Expenditure Shreay P taking over for Vamsidhar - Create a Line Graph Chart for Cost Breakdown by Type of Expenditure Apr 26, 2026
@one-community one-community changed the title Shreay P taking over for Vamsidhar - Create a Line Graph Chart for Cost Breakdown by Type of Expenditure Shreya P taking over for Vamsidhar - Create a Line Graph Chart for Cost Breakdown by Type of Expenditure Apr 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

Do Not Review Do not review or look at code without full context Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.