Skip to content

Sanjeevkumar - Added APIs for financial summary of the Building Projects#1307

Closed
sanjeev30 wants to merge 2 commits into
OneCommunityGlobal:developmentfrom
sanjeev30:sanjeev_phase_2_financial_summary_data_apis
Closed

Sanjeevkumar - Added APIs for financial summary of the Building Projects#1307
sanjeev30 wants to merge 2 commits into
OneCommunityGlobal:developmentfrom
sanjeev30:sanjeev_phase_2_financial_summary_data_apis

Conversation

@sanjeev30
Copy link
Copy Markdown
Contributor

Description

This PR adds multiple backend APIs to provide financial data for building projects, including total costs and month-over-month percentage changes for materials, labor, and equipment. These endpoints support filtering by project type and date range to enhance project financial insights and reporting.

Implements: Financial Summary APIs for Phase 2 (WBS: FinancialReporting.2.1)

Related PRS (if any):

N/A

Main changes explained:

  • Created API for calculating the the total cost of a project ( /api/financials/project/{projectId}/total-cost )
  • Created API for cost breakdown of a project ( /api/financials/project/{projectId}/costs )
  • Created API for calculating month over month change for a project [current and previous months] ( /api/financials/project/{projectId}/mom-changes )
  • Created API to get projects by date range ( /api/financials/projects?startDate=2025-01-01&endDate=2025-03-01 )
  • Created API to get projects by their type ( /api/financials/projects?projectType=commercial )

How to test:

  1. check into current branch (git checkout sanjeev_phase_2_financial_summary_data_apis)
  2. do npm install
  3. do npm run dev to run this PR locally
  4. log as admin/normal user
  5. verify APIs responses

Screenshots or videos of changes:

Screenshot 2025-04-05 at 2 54 49 AM Screenshot 2025-04-05 at 2 55 09 AM Screenshot 2025-04-05 at 2 55 26 AM Screenshot 2025-04-05 at 2 55 39 AM Screenshot 2025-04-05 at 2 56 04 AM

Note:

  • Make sure your local DB has relevant projects, materials, tools, and members with purchase records and logged hours.
  • calculateLaborCost for the last month currently uses a placeholder. If historical data is available, this logic can be extended in a future PR.

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Apr 7, 2025
@gopikalakshmia
Copy link
Copy Markdown
Contributor

I am getting an error whenever I try to check out the branch.
image
Please guide me if I am doing anything wrong here.

Copy link
Copy Markdown
Contributor

@KH07 KH07 left a comment

Choose a reason for hiding this comment

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

Tested functioned as intended. I checked out the current branch, ran npm install, ran npm run dev, and started the frontend. Logged in and obtained token from Inspect -> Storage -> Local Storage. In the Thunder Client extension on VS Code, filled in the third row under Headers, where key is ‘Authorization’ and value is the token. Send the GET request and API is responsive.
PR#1317 Total Cost
PR#1317 Cost
PR#1317 Changes
PR#1317 Date
PR#1317 Type

@KH07
Copy link
Copy Markdown
Contributor

KH07 commented Apr 18, 2025

I am getting an error whenever I try to check out the branch. image Please guide me if I am doing anything wrong here.

I used gh pr checkout # (PR number, 1307 in this case).

@ganeshpodishetti
Copy link
Copy Markdown

While checking out to this PR, I am getting an error.
Screenshot 2025-04-18 at 7 24 51 PM

Copy link
Copy Markdown
Contributor

@gopikalakshmia gopikalakshmia left a comment

Choose a reason for hiding this comment

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

Verified the changes. . Checked out the branch, logged in, and obtained the token from Inspect → Storage → Local Storage. Opened the Thunder Client extension in VS Code and The API (GET request) is working correctly
image
image
image
image
image

Copy link
Copy Markdown
Contributor

@AnthonyWeathers AnthonyWeathers left a comment

Choose a reason for hiding this comment

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

I tested all of the api routes, and received successful responses from each of them, although I had to handle the projectId differently due to testing on Postman. This PR is approved.

PR #1307 calculating month over month change for a project  current and previous months
PR #1307 calculating the the total cost of a project
PR #1307 cost breakdown of a project
PR #1307 get projects by date range
PR #1307 get projects by their type

@one-community one-community changed the title Added APIs for financial summary of the Building Projects Sanjeevkumar - Added APIs for financial summary of the Building Projects May 5, 2025
@one-community one-community added Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it. and removed High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible labels Jul 14, 2025
@jeyanthi-sm
Copy link
Copy Markdown
Contributor

Superseded by PR #1595 , which resolves the merge conflict and incorporates the same work

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

Labels

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.

7 participants