Skip to content

Backend Release to Main [3.04]#2204

Merged
one-community merged 89 commits into
mainfrom
development
May 8, 2026
Merged

Backend Release to Main [3.04]#2204
one-community merged 89 commits into
mainfrom
development

Conversation

@one-community
Copy link
Copy Markdown
Member

@one-community one-community commented May 8, 2026

Includes: Amalesh - Summary Dashboard: Create a line chart showing Weekly Progress 4320+#1878, Rithika taking over for Aditya-feat: refactor chart with multi-select filters, dark mode, and improved API integration 4496+#1937, Chirag: Fixed user registration for activites 5138+#2152, Diya 🔥 fix(bs): Fixed Blue Square Deletion Issue #2200, Rithika taking over for Sheetal phase3 Re Engagement Strategies No Show Follow Up Email #1333,

sheetalmangate and others added 30 commits October 20, 2024 13:11
branch 'development' of https://github.com/OneCommunityGlobal/HGNRest into development
Merge branch 'development' of https://github.com/OneCommunityGlobal/HGNRest into development
i especially if it merges an updated upstream into a topic branch.
…st controller

- Import LaborCost model for database queries
- Import logger utility for error tracking
- Wrap controller function in try-catch block for error handling
- Set up foundation for complete controller implementation
…troller

- Extract projects, tasks, and date_range from query parameters
- Add helper functions to parse arrays and date_range objects from query strings
- Validate projects and tasks are arrays with string values
- Validate date_range is object or null
- Validate ISO 8601 date format for start_date and end_date
- Validate date range logic (start_date <= end_date)
- Return appropriate error responses (400, 422) for validation failures
- Build date filter with support for null date_range, partial ranges (only start or end), and full ranges
- Use MongoDB operators $gte and $lte for date filtering with inclusive boundaries
- Build project filter using $in operator when projects array has values
- Build task filter using $in operator when tasks array has values
- Combine all filters into single query object with AND logic
- Convert date strings to Date objects and set appropriate time boundaries for inclusive filtering
- Execute MongoDB query using LaborCost.find() with combined filters
- Sort results chronologically by date using .sort({ date: 1 })
- Use .lean() for better query performance
- Return individual records without aggregation (frontend handles grouping)
- Database errors handled gracefully by existing try-catch block
- Map database fields to frontend structure (project_name → project)
- Convert date objects to ISO 8601 string format
- Ensure cost values are numbers (not strings)
- Calculate totalCost as sum of all cost values
- Return response with totalCost and data array structure
- Handle empty results case (totalCost = 0)
- Explicitly construct response object with totalCost and data fields
- Return 200 OK status code on successful response
- Handle empty results case (totalCost: 0, data: [])
- Ensure response is valid JSON using res.json() method
- Add clear comments documenting response structure
- Distinguish between database errors and unexpected errors
- Add error context logging with request parameters (query, method, URL)
- Return user-friendly error messages without exposing internal details
- Handle MongoDB/database connection errors with specific error code
- Maintain existing validation error handling (400, 422 status codes)
- Log errors with sufficient detail for debugging using logger utility
ChiragBellara and others added 28 commits April 4, 2026 21:06
…nd-re-engagement-strategies-follow-up-email

Rithika taking over for Sheetal phase3 Re Engagement Strategies No Show Follow Up Email
…ss-LineChart

Amalesh - Summary Dashboard: Create a line chart showing Weekly Progress
…n-backend

Sai Teja - Add backend support for dedicated pause/resume permission
…-paid-labor-cost-controller

Rithika taking over for Aditya-feat: Implement Paid Labor Cost API endpoint with comprehensive filtering and validation
…s-for-events

Chirag - Fix: Add API to register for events
Diya 🔥 fix(bs): Fixed Blue Square Deletion Issue
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@one-community one-community merged commit 1f9349f into main May 8, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants