Skip to main content

1. API Purpose

The Admission Form API digitizes the enrollment process. It allows prospective parents to submit their data through a multi-step form, which then automatically populates the core student and parent registries.

2. Endpoint Definition

MethodRouteAuthDescription
POST/web-app/admission-form🔓 PublicSubmit full admission data
GET/web-app/student-info🔓 PublicLookup existing info by roll number
GET/web-app/grades🔓 PublicList available grades for a school
PATCH/web-app/update-student🔓 PublicUpdate specific admission sections

3. Authentication Flow

Zero-Auth Flow: These endpoints are marked as @Public() and do not require a JWT. This allows new parents who are not yet in the system to submit their data. Security is maintained by requiring a valid skole_id in the request body to link data to the correct institution.

4. Request Structure

POST /web-app/admission-form

Request Body:
{
  "skole_id": "SKL001",
  "student": {
    "student_full_name": "Aarav Sharma",
    "gender": "Male",
    "date_of_birth": "2015-05-15",
    "grade": "Grade 1"
  },
  "parent_details": {
    "father_name": "Rajesh Sharma",
    "father_phone_no": 9876543210,
    "father_email": "rajesh.s@example.com"
  },
  "student_address": {
    "address_type": "permanent",
    "address": "123 School Street",
    "city": "Chennai",
    "state": "Tamil Nadu",
    "pincode": 600001
  }
}

GET /web-app/student-info

Query Parameters:
FieldTypeRequiredDescription
skole_idstringYesSchool identifier.
roll_nostringYesStudent roll number.

GET /web-app/grades

Query Parameters:
FieldTypeRequiredDescription
skole_idstringYesSchool identifier.

PATCH /web-app/update-student

Request Body:
{
  "blood_group": "AB+",
  "aadhaar_number": "123456789012"
}

5. Response Structure

Success: Admission Submitted (201 Created)

Route: POST /web-app/admission-form
{
  "success": true,
  "message": "Admission application received",
  "data": {
    "student": { "id": 105, "roll_no": "20240105", "status": "registered" }
  }
}

Success: Student Info Lookup (200 OK)

Route: GET /web-app/student-info
{
  "success": true,
  "data": {
    "student_full_name": "Aarav Sharma",
    "grade": "Grade 1",
    "status": "registered"
  }
}

Success: Grade List (200 OK)

Route: GET /web-app/grades
{
  "success": true,
  "data": [
    { "id": 1, "grade_name": "Grade 1" },
    { "id": 2, "grade_name": "Grade 2" }
  ]
}

Success: Admission Section Updated (200 OK)

Route: PATCH /web-app/update-student
{
  "success": true,
  "message": "Student profile partially updated"
}

6. Error Responses

HTTP CodeDescription
400Missing required fields in one of the sections (student/parent/address)
409Student with this roll number already exists

7. Security Considerations

  • Input Validation: Strict DTO (Data Transfer Object) validation ensures no malformed data enters the core registry.
  • Tenant Isolation: Every submission MUST include a valid skole_id.

8. Token Usage

N/A (Public endpoints).

9. Token Refresh

N/A.

10. Logout / Session Invalidation

N/A.

11. Usage Example (cURL)

curl -X POST http://localhost:3000/web-app/admission-form \
-H "Content-Type: application/json" \
-d '{"skole_id": "SKL001", "student": {...}, "parent": {...}}'

12. Notes / Special Behaviors

  • Atomic Transactions: The admission process uses database transactions. If any section (e.g., Address) fails to save, the entire student and parent creation is rolled back.
  • PIN Setup: Upon successful submission, a setup link is typically generated for the parent to configure their initial login PIN.