Skip to content

feat: add attendance grid feature and resolve conflicts

Greeshma Kanukunta requested to merge attendance-new into develop

Overview

This merge request introduces a new attendance tracking feature that records and displays patient/user attendance specifically on the first Sunday of every month. It integrates with backend APIs to fetch live attendance data and ensures that only relevant attendance records are considered, improving data accuracy and system efficiency.

What does this MR do and why?

This MR implements a structured attendance tracking system to monitor user/patient engagement on a monthly basis, specifically targeting the first Sunday.

  • The motivation behind this change is to standardize attendance tracking and ensure consistency in reporting.
  • The approach includes filtering attendance data to only include first Sundays and integrating with backend APIs for real-time data.
  • Trade-offs include added logic complexity for date calculations and stricter validation for attendance records.

Changes Made

image

  • Added FirstSundayAttendance.tsx component for handling first Sunday attendance logic
  • Introduced AttendanceGrid.tsx component for UI display of attendance data
  • Added utility functions for date calculations (first Sundays of a month)
  • Integrated backend API calls for fetching live attendance data
  • Updated i18n translation files (en, te, hi)
  • Modified existing attendance-related components to support new logic

Technical Details

  • The feature calculates the first Sunday of each month using date utilities and filters attendance records accordingly.
  • State management is handled using React hooks with API data fetched via backend integration.
  • Data flow:
    1. Fetch attendance data from API
    2. Filter records based on first Sunday logic
    3. Display results in a structured grid UI
  • API integration ensures that the data is always up-to-date and consistent with backend records.

Type of Change

  • 🐛 Bug fix
  • New feature
  • 💥 Breaking change
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • ️ Refactor
  • Performance improvement
  • 🧪 Test update
  • 🔧 Configuration change
  • 🚨 Security fix

Related Issues / References

  • Related to attendance tracking enhancement
  • Implements first Sunday filtering logic
  • Integrates with backend API for attendance data

Screenshots or Screen Recordings

Before After
No first Sunday tracking First Sunday attendance displayed in grid

How to Set Up and Validate Locally

  1. Pull this branch:
    git checkout feature/attendance-grid-clean
    
     Install dependencies:
    
     bun install
    
     Run development server:
    
     bun dev
    
     Navigate to:
    
     http://localhost:5173
    
     Verify:
    
         Attendance grid loads correctly
    
         Only first Sunday data is displayed
    
         API data is fetched successfully
    

Testing Done

Manual testing completed

Test Cases Covered: Scenario Expected Result Status First Sunday exists Attendance displayed Non-first Sunday Ignored API failure Graceful error handling UI renders correctly Grid visible Code Quality Checklist Code Standards

Code follows project conventions

No console.log or debug statements

No unused variables

i18n support maintained

TypeScript types properly defined

ESLint and Prettier pass

React Best Practices

Hooks used correctly

State management handled properly

Components are modular

No unnecessary re-renders

Component Patterns

shadcn/ui components used

Tailwind styling applied

Responsive design handled

Accessibility considered

API & Data Fetching

Backend API integration done

Loading and error states handled

Data types properly defined

Error Handling

Errors handled gracefully

User-friendly messages shown

Documentation

README updated

i18n translations updated

CHANGELOG updated

Known Limitations / Technical Debt

Date utility logic may need optimization for edge cases

Further backend validation can be added for stricter rules

Additional Notes

This feature is tightly coupled with backend attendance APIs

Future improvements may include analytics and visualization enhancements
Edited by Greeshma Kanukunta

Merge request reports

Loading