Skip to content

Manusha Job Posting Page Analytics: Create a donut chart showing applicants by experience#1457

Open
manushajyasta30 wants to merge 2054 commits into
Manusha_donut_chart_show_applicants_by_experiencefrom
development
Open

Manusha Job Posting Page Analytics: Create a donut chart showing applicants by experience#1457
manushajyasta30 wants to merge 2054 commits into
Manusha_donut_chart_show_applicants_by_experiencefrom
development

Conversation

@manushajyasta30

Copy link
Copy Markdown
Contributor

Description

image

Related PRS (if any):

T
To test this backend PR you need to checkout the ##3654 frontend PR.

Main changes explained:

added routes:
Route: GET /api/applicants/experience-breakdown
GET http://localhost:4500/api/experience-breakdown?roles=Frontend Developer
GET http://localhost:4500/api/experience-breakdown?startDate=2023-01-01&endDate=2024-12-31

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. verify endpoints

Screenshots or videos of changes:

image

@manushajyasta30 manushajyasta30 changed the title Job Posting Page Analytics: Create a donut chart showing applicants by experience Manusha Job Posting Page Analytics: Create a donut chart showing applicants by experience Jun 14, 2025
@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 Jun 18, 2025
@Venk-rgb Venk-rgb self-assigned this Jun 19, 2025
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Test and others added 24 commits June 11, 2026 23:28
Each granular question permission now checks only its own action key for clearer separation of duties and simpler auditing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Expose expenditure endpoints under /api/bm for Financials Tracking
(Actual vs Planned pie charts):

- GET /api/bm/expenditure/projects — list project IDs with expenditure data
- GET /api/bm/expenditure/:projectId/pie — actual and planned by category

Register bmExpenditureRouter in the BM dashboard block alongside
bmActualVsPlannedCostRouter.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Validate projectId with mongoose.Types.ObjectId.isValid() before DB
  access; return 400 for invalid IDs to avoid unhandled throws.
- Use new mongoose.Types.ObjectId(projectId) only after validation.
- Replace console.error with logger.logException including transaction
  name and projectId (for pie handler) as extra data.
- Rename unused req to _req in getProjectIdsWithExpenditure.
- Use explicit return on all branches to prevent fall-through.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add expenditureController.test.js with full coverage:

getProjectIdsWithExpenditure:
- 200 with array of project IDs on success
- 200 with empty array when no records exist
- 500 and logger.logException on DB error

getProjectExpensesPie:
- 400 for invalid projectId (non-hex, short) without calling aggregate
- 200 with { actual, planned } shape on success
- 200 with { actual: [], planned: [] } when no matching records
- 500 and logger.logException with projectId on DB error

Co-authored-by: Cursor <cursoragent@cursor.com>
Cover the new updateEquipmentById handler and validation in
bmEquipmentController:

- 400 for invalid equipment ID or project ID
- 400 for invalid enum values (purchaseStatus, currentUsage, condition)
- 400 when no valid fields provided to update
- 200 with updated equipment on success
- 404 when equipment not found after update
- 500 on updateOne error

Add updateOne to the mock BuildingEquipment model.

Co-authored-by: Cursor <cursoragent@cursor.com>
…controller

Add laborHoursDistributionController.test.js for getLaborHoursDistribution:

- 403 when user lacks getWeeklySummaries permission
- 400 for missing or invalid start_date/end_date (format, calendar date, range)
- 200 with cached response on cache hit
- 200 with total_hours and distribution (with percentages) on success
- 200 with empty distribution when no data
- Optional category filter in cache key and aggregation pipeline
- 500 and logger.logException on aggregate error

Mocks: LaborHours, logger, nodeCache, hasPermission.
Co-authored-by: Cursor <cursoragent@cursor.com>
…s with it.each

Replace 6 near-duplicate it() blocks (validation tests) with a single it.each()
data table of [description, queryOverrides, expectedError]. Reduces file from
241 to 174 lines while preserving all 12 tests and identical assertions.
Test names unchanged (e.g. 'returns 400 when start_date format is invalid').

Made-with: Cursor
…chart-all-issues-visible

Saurabh taking over Vamsidhar - fix: show all issues from selected projects without limit
…-by-Side-Comparison-Mode-for-Actual-vs-Planned-Expenditure-Charts

Rithika taking over for Aditya-feat: Side-by-Side Comparison Mode for Actual vs. Planned Expenditure Charts
Bumps [joi](https://github.com/hapijs/joi) from 18.0.2 to 18.2.1.
- [Commits](hapijs/joi@v18.0.2...v18.2.1)

---
updated-dependencies:
- dependency-name: joi
  dependency-version: 18.2.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.5 to 0.2.7.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](raszi/node-tmp@v0.2.5...v0.2.7)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…der-warning-trackers

Anthony - feat: added values to support reordering warning trackers, and fixed …
…lBSEmails

Diya 🔥 fix(resendBS): Fixed Manual Resend Blue Square Emails
…ryCron_BSHistory

Diya 🔥 fix(multiple): Fixed Weekly Summary Cron + BS History
…x-email-update

Mahitha - 🔥 fix(userProfile): update email validation in controller
…archy

Diya 🔥 (BSemails): Fixed Blue Square assignment Email Hierarchy
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

…e4_Daily_Log_Backend

Shravya Feature Phase4 Daily Log Backend
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.