# TEPL DHMS: our default designs (Sprint 0)

TEPL asked us (3 Nov 2026) to design these ourselves until they send their
own. Each one is built as a setting, a template or a column mapping, so
TEPL's real version replaces ours without new code. Samples are in
`samples/`.

## 1. Daily shift roster file (Sprint 1: built)

One row per employee per day. CSV or Excel, first sheet, header row first.

| Column | Example | Notes |
| --- | --- | --- |
| Employee ID | TEPL10234 | TEPL's employee number, as stored on the employee |
| Date | 2026-11-10 | `YYYY-MM-DD` or `DD-MM-YYYY` |
| Shift | B | A code from the shift list below |

Default shift list, editable per hostel in settings:

| Code | Name | Starts | Ends |
| --- | --- | --- | --- |
| A | First shift | 06:00 | 14:00 |
| B | Second shift | 14:00 | 22:00 |
| C | Night shift | 22:00 | 06:00 (next day) |
| G | General | 09:00 | 18:00 |
| WO | Weekly off | — | — |

When TEPL sends their file, the import screen maps their columns and shift
codes to these; the API connector follows in Sprint 6.

Adherence, per employee per day (built in Sprint 1, `roster-adherence.ts`):
- on shift: out of the hostel by the start (30 minutes' grace) is on time,
  out later is late, never out is "no swipe-out";
- on approved leave but seen in the hostel during the day is flagged;
- on a weekly off and out after curfew is flagged.

The flagged ones are what the daily "Shift adherence (yesterday)" report
leads with.

## 2. Leave policy (Sprint 1: built)

Leave types, each with a yearly balance and a carry-forward rule. All
editable in settings; these are the starting values.

| Type | Days per year | Carry forward | Notes |
| --- | --- | --- | --- |
| Casual leave (CL) | 12 | None | Up to 3 days at a time |
| Sick leave (SL) | 12 | Up to 30 days | A certificate attached for 3+ days |
| Earned leave (EL) | 18 | Up to 45 days | Applied 7 days ahead |
| Compensatory off | Earned per extra shift | Expires in 60 days | |
| Home visit | No balance | — | Hostel outing only, no plant leave |

- The leave year runs January to December; balances reset on 1 January.
- Half days are allowed for CL and SL.
- **Approval:** the hostel approves first (warden or block supervisor), then
  the plant approver for the employee's department. Each department has one
  or more plant approvers, each on their own login with approve-only access.
- An approved leave issues the gate pass and switches off the employee's
  meals for those days.

## 3. Excel import templates (Sprint 1: built)

Two sheets, filled per block (each block is its own property).

**Employees** (`samples/employees-template.csv`): Employee ID, Full name,
Phone, Email (for a login), Department, Shift, Contractor (if any), Room,
Bed, Moved in on, Emergency contact name, Emergency contact phone, Parent
name (optional), Parent phone (optional), Home address, City, State, Postal
code, ID type, ID number.

**Rooms** (`samples/rooms-template.csv`): Block, Floor, Room, Beds, Room
type, Accessible (yes/no).

Every row is checked before anything is saved, and the check report lists
each problem by row, so a sheet can be fixed and sent again.

In an employee hostel the import reads "Emergency contact" columns, ignores
any rent or deposit columns (the company pays), and makes ID proof and photo optional (HR holds them; they can
be added on the employee's page). A new department name in the sheet is
created; a shift code must be in the shift list.

## 4. ESSL terminals

Used as they are today, through HostelCare's device-key ingest
(`POST /api/biometric/punches`). If TEPL's terminals can only push in ESSL's
own format, a small adapter (about 2 days) comes from the sprint slack.

## 5. Still to come from TEPL, with where ours is designed

| Item | Our default | Sprint |
| --- | --- | --- |
| Roster file | Section 1 | 1 |
| Leave policy and approvers | Section 2 | 1 |
| BMS API and meter-to-room list | Our reading interface and a simulator | 3 |
| Licences, permits, registers | A starter list per block | 7 |
| Medical record fields, OHC staff | A default field set and an OHC role | 6 |
| Special-needs scope | Mobility, vision, hearing, medical | 6 |
| Employee and room data | Section 3 | Before UAT |

## Added 4 Nov 2026

- **Weekly mess menu from Excel:** Mess > Weekly template > Import from Excel. A row per day (Day, Breakfast, Lunch, Dinner) or a column per day both work; `samples/weekly-mess-menu-template.csv` is the sample. Each day in the sheet replaces that day, a blank cell clears that meal, and days left out stay as they are. The calendar takes it when the month is filled from the template.
- **Outing passes:** the employee asks and the warden (anyone with MANAGE_STUDENTS) approves or declines under Outings & curfew. There is no QR until it is approved. The gate or office can still give a pass to someone standing there. Outing report: same page, or Reports.
- **Staff employment record:** all optional, on Add or Edit staff. Only a hostel admin sets PAN, Aadhaar, UAN, PF and ESIC; other staff see them masked, and Aadhaar is masked for everyone. Staff ID and plant name feed the staff attendance report.
- **Reports on screen:** every report opens in the app with the same rows as its Excel file, up to 5,000 rows per sheet on screen. Excel times are India time.
