# ASMS — Master plan and idea list (keep this file up to date)

This file records every requirement the owner has asked for, so nothing is forgotten.
Status: [x] done  [~] partly done  [ ] not started

## Standing principle (from the owner)
Every feature is built modern and complete, nothing hard-wired to one country, and every part can be changed, switched off or extended later without breaking old data. New work goes in as a numbered migration + module switch.

## Business model
- [ ] Sell to other schools: one-time setup fee, plus yearly or per-student license, plus optional support.
- [ ] License file signed by the owner: student limit, expiry date, enabled modules. Grace period, then warning, then block new admissions, then login block.
- [ ] Per-school feature switches (sell only what each school needs). Foundation done: module on/off (Modules.php).
- [ ] Honest limit: a school running the code on its own server can bypass licence checks; contract + hosting it for them is the strong protection.

## Foundation
- [x] Installer, login, roles and permissions, CSRF, password hashing, login lock after 5 wrong tries
- [x] Module on/off switch (System > Modules), health check, error log viewer, backups (auto backup before every update)
- [x] Numbered database migrations, docs/ folder, VERSION
- [ ] Language files (Bangla, English, Arabic, Hindi...) instead of text inside views
- [ ] Country-neutral settings: phone rules, currency, time zone, date format, grading systems (GPA 5.0, percent, A-F)
- [~] (built in 0.9.0, untested) Two units in one system: School and Coaching. Login then choose the unit; each has its own classes/batches, students' enrolment, fees, income-expense, receipts, SMS. A student can be in both (separate results, separate fees).
- [ ] JSON API + webhooks (mobile app, parent portal, other software). AI service layer (provider-neutral, off by default, student data never leaves without school consent).
- [ ] Update from the owner's server with one button, rollback, version check per school.

## Students
- [x] Admission (full form and quick admission), profile, photo (secure), search, status change, student ID
- [ ] Complete-your-profile reminders, bulk import from Excel/CSV (the 256 existing students), ID card, certificates (testimonial, basic certificate)
- [ ] Photo albums: by batch (SSC 2027...), teacher panel by year, events; tag people so one person's photos are together

## Fees and accounts  (v1 built in 0.5.0)
- [x] Fee types, amount per class and session, student discounts / free / percent, manual extra charge, manual adjustment with reason
- [x] Start rules (per school setting): from admission day (pro-rata), full admission month, from next month, full year whenever admitted
- [x] Partial payment: balance stays as due; collection screen shows all dues together, tick what to take
- [x] Receipts (half page A5 landscape), void with reason (nothing is ever deleted), audit log, receipts list = collection report
- [x] Inactive / transferred / passed students keep their dues; fees > "inactive students' dues" lists them; warning when deactivating a student who owes money
- [ ] SMS on payment and due reminders (needs SMS provider API)
- [ ] Reports: daily/monthly collection, due by class, student ledger, income and expense, profit per unit (school vs coaching)
- [ ] Online payment: bKash, Nagad, Rocket, bank, cards via an aggregator (SSLCommerz or similar), later Stripe/PayPal/others for other countries. Needs merchant accounts + sandbox testing + a payment callback (IPN). Planned as a "payment gateway adapter" so gateways can be added without touching fee code. Until then: record method and transaction ID by hand.
- [ ] Bank and mobile-banking account management, cash book, expense heads, vouchers
- [ ] Advance (future month) payments, fee waiver approval flow, late fee rules, scholarships

## Exams
- [ ] Exam types, setup per class/subject; enter only the full marks (50, 75, 10...) and the system converts to 100 and grades automatically (hand override allowed, logged)
- [ ] Results, GPA, position, marksheet, result sheet, seat plan, admit card, exam routine; separate results for school and coaching

## Attendance
- [~] (built in 0.10.0, untested) Student attendance: present/absent/late/leave, take by class+date, day summary (with "not taken"), absent list with guardian phone, month grid with %, printable blank A4-landscape sheet
- [~] (0.10.0, untested) Machine support by file import: any machine that can export CSV/TXT (machine number + date + time); late-after time per unit; never overwrites hand marks; unknown numbers reported
- [~] (0.11.0, untested) Teachers and employees: staff list (add/edit/deactivate/delete-if-unused, machine number) and their attendance in the SAME attendance screens (tabs: students / teachers / employees), reports, blank sheet, machine import (students or staff file), dashboard card. Permission attendance.staff.
- [ ] Next for attendance (owner's spec, see chat): weekly closure + holidays + special working days calendar; open/close time, grace, cutoff, half-day, early leave, shifts; raw punch table; correction history (old/new/reason/who); device register + sync log + adapter; A4 portrait/landscape options; teacher sees only own classes
- [ ] Direct machine link (ZKTeco push/pull adapter), SMS to guardians of absent students, leave applications

## Communication
- [ ] SMS panel: tick student number / father / mother / guardian, select all or none; templates; sender via provider API
- [ ] Notice board with reusable templates (holiday, class, exam...), publish with one click

## People
- [~] (0.12.0 "Teacher-1", untested) Teacher/employee profile: tabs (info, qualifications, training+experience, documents, attendance), photo (re-encoded JPEG, stored outside web root), admin-managed lists (departments, designations, job types, teaching subjects; rename / switch off / delete only if unused), many subjects per teacher with a main one, list filters + pagination + print, ID cards (single and bulk, print). Migration 010.
- [ ] Teacher-2: assignment of teachers to class/section/subject/session; timetable (routine), working hours, clash detection
- [ ] Teacher-3: salary structure, allowances, deductions, advances, monthly payroll linked to attendance, payment history, salary slip (ask the owner for the school's salary rules first)
- [ ] Teacher panel (teachers log in and see own classes, attendance, salary slip)
- [ ] Parent portal and student portal (results, dues, notices, attendance)
- [ ] Website panel: public admission form, online fee payment, results lookup, notices
- [ ] Mobile: installable web app (PWA) first; store apps later

## Other modules
- [ ] Library, events and calendar, sports and cultural programmes (who joins what)
- [ ] Online class links (Zoom/Meet/Jitsi), online exams, question bank

## Maintenance rules
- Every change is a numbered migration + an update ZIP; always back up first (the update page does it).
- New module steps are in docs/ADD_MODULE.md; fee rules are in docs/FEES.md.

- [x] Teacher-1/2/3 (v0.13.0): প্রোফাইল, ঠিকানা অটো-সিলেক্ট, বরাদ্দ, রুটিন, বেতন
- [ ] শিক্ষার্থী ফর্মে ঠিকানা-সিলেক্টর; সরকারি ছুটি ক্যালেন্ডার; আয়-ব্যয় খাতা (বেতন পোস্ট)

- [x] বেতন v2 (v0.14.0): বেতনের ধরন, কর্তন খাত, পেমেন্ট+রসিদ, অগ্রিম খাতা, লেজার, অনুমোদন প্রবাহ, রিপোর্ট, SMS (সাধারণ)
- [ ] ছুটির ক্যালেন্ডার; আয়-ব্যয় খাতায় পোস্ট; PDF এক্সপোর্ট; আসল SMS প্রোভাইডার যাচাই

## Owner's module map (v0.19.0 — the sidebar and dashboard now show this whole map; unbuilt items are greyed "শীঘ্রই" for admins only)
Rule: every module is its own heading with its own report. Add a module = add a row in app/Menu.php (+ route + permission); remove = delete the row. Nothing is hard-wired.
- [~] শিক্ষার্থী: list, quick admission done. Todo: Excel bulk admission, promotion/transfer, testimonial/certificates, student ID card.
- [~] ফি কালেকশন: collection, receipts, setup done. Todo: due list + reminders, waiver approval, fee reports, online payment.
- [ ] পরীক্ষা ও ফলাফল: exam setup, marks entry (enter only full marks, system converts), automatic result/GPA/position, marksheet, result sheet, seat plan, admit card, exam routine.
- [x] একাডেমিক: class, section, group/department, subject, routine, teacher assignment.
- [ ] নোটিশ বোর্ড: notice types (class, holiday, fee, exam, attendance), templates, one-click publish, notice report.
- [~] হাজিরা: students + teachers/staff + any-brand machine file import done. Todo: direct device link, holiday calendar, attendance SMS.
- [ ] SMS প্যানেল: send to student / father / mother / guardian (single or tick many), templates (holiday, class, closure), SMS report; API setting lives here (/payroll/sms for now).
- [~] শিক্ষক ও কর্মচারী + বেতন: done (profile, assignment, payroll, personal account, finance dashboard). Todo: teacher self-login panel.
- [ ] ব্যাংক ও লেনদেন: bank, bKash/Nagad, online payment gateway, cash book, vouchers, income-expense (also feeds the finance dashboard).
- [ ] রিপোর্ট কেন্দ্র: one report page per module + a hub.
- [ ] লাইব্রেরি, খেলাধুলা ও অনুষ্ঠান (lists of who joins cricket/football), ইভেন্ট ক্যালেন্ডার.
- [ ] ওয়েবসাইট প্যানেল: online admission, results, fees, reports linked to the school website; parent/student panel; online class links, online exam, question bank.
- [x] ইউনিট: add any number of units (school, coaching, more) at /units (super admin).
- [ ] Offline use: installable web app (PWA) with a local queue for attendance and fee entry that syncs when the internet returns. Needs HTTPS. Not started — design first.
- [ ] Update any time: migrations + auto backup exist; later one-button update with rollback.
- [ ] Results fully automatic; certificates and testimonials generated from templates; ID cards for students.
