Skip to content

feat(database): add backend APIs for batch and branch wise student count - #2013

Open
basant-gautam wants to merge 2 commits into
FusionIIIT:prod/acad-reactfrom
basant-gautam:feature/database-new-reports
Open

basant-gautam wants to merge 2 commits into
FusionIIIT:prod/acad-reactfrom
basant-gautam:feature/database-new-reports

Conversation

@basant-gautam

Copy link
Copy Markdown

Description

This PR provides the backend API endpoints required for the new Batch-wise and Branch-wise student count reports in the Database module. The data is fetched dynamically directly from the database using Django aggregations.

Changes Made

  • Added two new endpoints in academic_information/api/urls.py:
    • /database/batch-wise-student-count/
    • /database/branch-wise-student-count/
  • Implemented database_batch_wise_student_count and database_branch_wise_student_count views in views.py.
  • The views dynamically aggregate data using Count and Q objects filtering by gender (M, F) mapped from ExtraInfo, grouped by batch, programme, and discipline.
  • Secured both endpoints with @role_required(DATABASE_REPORT_ROLES) so they align completely with the existing database reports access control.

Note

No hardcoded data is used (apart from the specified 2020-2026 batch filter boundary). The new APIs do not interfere with any existing database reporting endpoints.

@FusionIIIT-Bot

Copy link
Copy Markdown
Collaborator

Congratulations for making your first Pull Request at Fusion!! 🎉 Someone from our team will review it soon.

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.

2 participants