DAC Academy — Hidden Business Rules Report
Warning: These rules are NOT visible in the UI
RULE 1: Registration Fee Fixed at ₹3,000
Default: 300000 paise (₹3,000) UI Visible? ❌ — The amount is user-entered but effectively a free-form amount
RULE 2: Only One Active Academic Session
Enforcement: DB-level partial unique index prevents more than one active session
RULE 3: Cannot Deactivate Session with Active Students
Logic: Before deactivating, checks if any student has active status for this session Error: "Cannot deactivate session with active students"
RULE 4: Batch Changes Rejected in Student Edit
Logic: Student edit form throws error if batch differs from current Error: "Batch changes must use Transfer Student Batch." Workaround: Must use the Batch Transfer Dialog
RULE 5: Branch Changes Rejected in Student Edit
Logic: Student edit form throws error if branch differs Error: "Branch changes are not allowed through student edit." Note: No dedicated branch transfer workflow exists
RULE 6: Hostel Must Belong to Same Branch as Student
Logic: Before creating hostel allocation, system compares hostel's branch with student's branch Error: "HOSTEL_BRANCH_MISMATCH"
RULE 7: Admission Type Auto-Sync with Hostel Status
Logic: When hostelOpted changes, admission type is automatically updated:
tuition_only↔tuition_hosteltuition_school↔tuition_hostel_school
RULE 8: Document Checklist Required for Admission
Logic: At least one active checklist item must exist before any admission can be created Error: "Document checklist is not configured. Contact administrator."
RULE 9: Lead Status Cannot Go Backward
Logic: admitted status is terminal — admitted leads cannot be reverted
RULE 10: Phone Numbers Always E.164 Normalized
Logic: All phone numbers are converted to international format before storage (e.g., +919876543210)
RULE 11: WhatsApp Phone vs Regular Phone Distinction
Fields: parentPhone (always), parentHasWhatsApp (boolean), alternatePhone (optional)
Rule: Parent phone always has WhatsApp by default. Alternate phone requires explicit WhatsApp flag.
RULE 12: Registration Receipt Created Even with Zero Payment
Logic: A receipt is always created for registration, even if amount is ₹0
RULE 13: Admissions Viewed Through Student Profile
Logic: No standalone admission detail page — navigating to admission URL redirects to student page
RULE 14: Receipt PDF Generation is Fire-and-Forget
Logic: If PDF generation fails, the admission is already created. PDF can be regenerated on demand.
RULE 15: Payment Screenshot Cleanup on Admission Failure
Logic: If admission creation fails, uploaded payment screenshot and student photo are deleted
RULE 16: Disabled Accounts Cannot Login
Logic: Deactivated users are silently redirected to login without error message
RULE 17: Counselors Have Cross-Branch Read Access
Logic: Counselors can see all branches' data but can only modify their own branch's data
RULE 18: Wardens See Only Hostel-Opted Students
Logic: Wardens literally cannot see non-hostel students in the system
RULE 19: No Overpayment Allowed
Enforcement: DB-level constraint — totalPaidPaise <= totalFeePaise
RULE 20: Receipt Sequence Numbers Auto-Increment Within Financial Year
Format: KIND/FY/SEQUENCE — e.g., ADM/2025-26/0042
Note: Sequence numbers may have gaps if transactions are rolled back
RULE 21: Counselors Can Reset Parent Passwords — But NOT Their Own
Logic: Prevents a staff member who is also a parent from resetting their own password through this flow
RULE 22: Admission Fee Override Logic
Logic: If staff enters ₹0 for fee, batch defaults are used. Any positive value overrides defaults.
RULE 23: Already-Admitted Student Detection
Logic: Prevents double-conversion of leads by checking existing student records
RULE 24: GST Calculation Formula
gstFraction = gstRateBps / 10000
totalGst = totalFee - Math.round(totalFee / (1 + gstFraction))
gstAmount = Math.round(totalGst * amountPaid / totalFee)
Effect: GST calculated proportionally based on paid amount vs total fee
RULE 25: Rate Limiting on Auth Endpoints
- Login: limited attempts per IP
- Password reset: limited requests per email
- Returns RATE_LIMITED error
RULE 26: Admission Requires Active Checklist
Logic: New academy must configure checklist items before first admission
RULE 27: Student Photo is Optional
Behavior: Photo uploaded via client-side compression, stored in cloud storage with expiring signed URLs