|
| 1 | +# Placement Cell |
| 2 | + |
| 3 | +The Placement Cell module manages the full campus placement lifecycle for |
| 4 | +IIITDM Jabalpur — company drives, student applications and offers, interview |
| 5 | +rounds, statistics and reports, debarments and restrictions, an interactive |
| 6 | +placement calendar, an alumni network, and off-campus / published-CPI tracking. |
| 7 | + |
| 8 | +It is an API-only Django app (`applications/placement_cell`) consumed by the |
| 9 | +React placement module in `Fusion-client` (`src/Modules/PlacementCell`). |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Roles |
| 14 | + |
| 15 | +The module recognises four roles (the user's selected designation, exposed to |
| 16 | +the frontend as `state.user.role`): |
| 17 | + |
| 18 | +| Role (designation) | Capabilities | |
| 19 | +|----------------------|--------------| |
| 20 | +| `placement officer` | TPO: schedules/drives, applications, interview rounds, statistics, reports, debarments, restrictions, fields, notifications, off-campus records, published-CPI export, calendar management, announcements | |
| 21 | +| `placement chairman` | Admin oversight: officer capabilities plus placement policies | |
| 22 | +| `student` | Browse drives, apply, manage placement profile, view offers/timeline, download CV, read announcements/calendar, alumni network | |
| 23 | +| `alumni` | Alumni profile, post job referrals, mentorship sessions, student network | |
| 24 | + |
| 25 | +**How roles resolve** |
| 26 | + |
| 27 | +- **Backend** authorizes via `HoldsDesignation(working=user, designation__name=…)`. |
| 28 | + `selectors.is_tpo` is true for `placement officer` / `placement chairman`; |
| 29 | + officer/chairman-only endpoints return `403` with `{ "detail": … }`. |
| 30 | +- **Sidebar visibility** comes from `ModuleAccess.placement_cell` for the |
| 31 | + designation. |
| 32 | +- **Frontend** chooses the tab set in `PlacementCellPage` from `state.user.role`. |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Features |
| 37 | + |
| 38 | +### Students |
| 39 | +- **Placement Schedule** — browse drives as a chronological **Agenda** |
| 40 | + (Today / This Week / Upcoming / Closed) or a filterable **card** view, with |
| 41 | + per-drive eligibility and deadline countdowns; apply, withdraw, track status. |
| 42 | +- **My Applications / My Offers** — application timeline; accept/decline offers. |
| 43 | +- **Placement Calendar** — read-only, colour-coded view of drives, tests, |
| 44 | + interviews and deadlines. |
| 45 | +- **Announcements** — read placement-cell announcements. |
| 46 | +- **Download CV**, placement profile, notification preferences. |
| 47 | +- **Alumni Network** — connect with alumni, browse referrals, mentorship. |
| 48 | + |
| 49 | +### Placement Officer / Chairman |
| 50 | +- **Add / edit drives** with eligibility (min CPI, branches from the live |
| 51 | + department list, passout year, gender) and custom **application fields** |
| 52 | + (creatable inline). |
| 53 | +- **Student CPI** — per-batch published CPI (computed from the examination |
| 54 | + module's announced results), with off-campus companies and **Excel export**. |
| 55 | +- **Off-Campus Placements** — record offers students received off campus |
| 56 | + (company autocomplete from registered companies). |
| 57 | +- **Placement Statistics & Reports** — stats, report generation and export. |
| 58 | +- **Debarred Students** and **Restrictions** (institute-wide eligibility bars). |
| 59 | +- **Send Notifications**, **Company Registration**, **Fields** management. |
| 60 | +- **Placement Calendar** — Google-Calendar-style: click a date/slot to add an |
| 61 | + event, edit/delete events; merged with drives and deadlines. |
| 62 | +- **Announcements** — post / pin / delete. |
| 63 | +- **Placement Appeals**, **Higher Studies**, **Alumni Verification**. |
| 64 | + |
| 65 | +### Chairman |
| 66 | +- All officer capabilities plus **Placement Policies**. |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +## Backend |
| 71 | + |
| 72 | +- **Models** (`models.py`, ~45): profiles & academic info (Education, Skill, |
| 73 | + Experience, …), `NotifyStudent`, `PlacementSchedule`, `PlacementApplication`, |
| 74 | + `PlacementStatus`, `PlacementRound`, `PlacementRecord`, `StudentRecord`, |
| 75 | + `PlacementRestriction`, `PlacementPolicy`, `PlacementAppeal`, alumni models, |
| 76 | + and the additive `PlacementAnnouncement`, `OffCampusPlacement`, |
| 77 | + `PlacementCalendarEvent`. |
| 78 | +- **API** (`api/urls.py`, `api/views.py`, `api/serializers.py`): DRF, Token |
| 79 | + authentication. URLs are mounted under `placement/` (see `Fusion/urls.py`), |
| 80 | + so routes are `…/placement/api/<route>/`. |
| 81 | + |
| 82 | +### Endpoint groups |
| 83 | + |
| 84 | +| Area | Routes | |
| 85 | +|------|--------| |
| 86 | +| Drives & schedule | `api/placement/`, `api/placement/<id>/`, `api/calender/`, `api/timeline/<id>/`, `api/nextround/<id>/` | |
| 87 | +| Applications & offers | `api/apply-for-placement/`, `api/my-applications/`, `api/my-offers/`, `api/offer/<id>/`, `api/offer/<id>/respond/`, `api/student-applications/<id>/`, `api/application-detail/<id>/`, `api/download-applications/<id>/` | |
| 88 | +| Statistics & reports | `api/statistics/`, `api/delete-statistics/<id>/`, `api/reports/`, `api/reports/export/`, `api/report-schedules/`, `api/higher-studies/` | |
| 89 | +| Eligibility & policy | `api/restrictions/`, `api/policies/`, `api/branches/` | |
| 90 | +| Debarment | `api/debared-students/`, `api/debared-status/<roll_no>/` | |
| 91 | +| Fields & profile | `api/add-field/`, `api/form-fields/`, `api/profile/`, `api/notification-preferences/`, `api/registration/`, `api/generate-cv/` | |
| 92 | +| Notifications | `api/send-notification/` | |
| 93 | +| Announcements | `api/announcements/`, `api/announcements/<id>/` | |
| 94 | +| Off-campus | `api/offcampus/`, `api/offcampus/<id>/` | |
| 95 | +| Published CPI | `api/cpi-batches/`, `api/cpi-students/` (`?batch_id=` , `?export=excel`) | |
| 96 | +| Calendar events | `api/calendar-events/`, `api/calendar-events/<id>/` | |
| 97 | +| Appeals | `api/placement-appeals/`, `api/placement-appeals/<id>/` | |
| 98 | +| Alumni | `api/alumni/profile/`, `api/alumni/directory/`, `api/alumni/verification/`, `api/alumni/referrals/`, `api/alumni/connections/`, `api/alumni/sessions/` | |
| 99 | + |
| 100 | +**Authorization** — all endpoints require authentication; write/sensitive |
| 101 | +operations are gated on `selectors.is_tpo` (officer/chairman). Server-controlled |
| 102 | +fields (`created_by`, `added_by`, `posted_by`) are never client-settable. |
| 103 | + |
| 104 | +### Published CPI |
| 105 | + |
| 106 | +`selectors.get_student_published_cpi` derives a student's CPI from the |
| 107 | +examination module's latest **announced** `ResultAnnouncement` (not the static |
| 108 | +`Student.cpi`). The per-batch view memoises each student's computed CPI in the |
| 109 | +cache (keyed by roll number + semester), so reloading a batch is near-instant. |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Frontend (`Fusion-client/src/Modules/PlacementCell`) |
| 114 | + |
| 115 | +- React 18 + Vite, Mantine v7, Redux Toolkit, axios, `mantine-react-table`, |
| 116 | + `react-big-calendar`. |
| 117 | +- `pages/PlacementCellPage.jsx` renders the shared `ModuleTabs` navbar and the |
| 118 | + role-specific tab set. **Every tab is lazy-loaded** behind a `Suspense` |
| 119 | + boundary so opening the module only downloads the active tab's code; Vite |
| 120 | + `manualChunks` splits the heavy vendors into cacheable chunks. |
| 121 | +- `api.js` (+ `services/api.js` re-export) holds `placementApi` with one method |
| 122 | + per endpoint and `buildAuthConfig()` for the token header. |
| 123 | +- Date inputs use native `datetime-local` / `date` controls for reliability. |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## Setup — role accounts |
| 128 | + |
| 129 | +`manage.py setup_placement_roles` creates one idempotent login per role and |
| 130 | +enables `ModuleAccess.placement_cell`. The password is supplied at runtime and |
| 131 | +is **not** stored in the repo: |
| 132 | + |
| 133 | +```bash |
| 134 | +cd FusionIIIT |
| 135 | +python manage.py setup_placement_roles --password '<password>' |
| 136 | +# or set PLACEMENT_ROLE_PASSWORD |
| 137 | +``` |
| 138 | + |
| 139 | +| Username | Role | |
| 140 | +|----------------------|--------------------| |
| 141 | +| `placement_officer` | placement officer | |
| 142 | +| `placement_chairman` | placement chairman | |
| 143 | +| `placement_student` | student | |
| 144 | +| `placement_alumni` | alumni | |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +## Tests |
| 149 | + |
| 150 | +See [`tests/README.md`](tests/README.md). Run with the dedicated settings |
| 151 | +(migrations disabled so the historical chain cannot block test-DB creation): |
| 152 | + |
| 153 | +```bash |
| 154 | +cd FusionIIIT |
| 155 | +python manage.py test \ |
| 156 | + applications.placement_cell.tests.test_placement_api \ |
| 157 | + applications.placement_cell.tests.test_use_cases \ |
| 158 | + applications.placement_cell.tests.test_business_rules \ |
| 159 | + applications.placement_cell.tests.test_workflows \ |
| 160 | + applications.placement_cell.tests.test_module \ |
| 161 | + --settings=test_settings |
| 162 | +``` |
| 163 | + |
| 164 | +`test_placement_api` covers schema regressions, API-only URL wiring, |
| 165 | +authentication and role authorization (including announcements, off-campus, |
| 166 | +published-CPI export and calendar-event CRUD). |
0 commit comments