Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/muhammadbugaje/gobarau_backend/llms.txt

Use this file to discover all available pages before exploring further.

The Welfare module provides a comprehensive, multi-domain view of student well-being at Gobarau Academy. It spans four interconnected areas: Health (medical profiles, clinic visits, and prescribed medications), Counselling (one-to-one sessions between students and school counsellors), Discipline (incident records and merit/demerit point tracking), and Interventions (structured case management for students requiring multi-domain support, alongside extended absence logging and periodic welfare reports). All welfare models inherit from SoftDeleteModel and AuditMixin, meaning records are never hard-deleted and every access action is audited. All endpoints are prefixed with /api/welfare/ and follow standard DRF router conventions.
Welfare data is highly sensitive and personally identifiable. Access to health and counselling endpoints is restricted to users with the nurse or counsellor role respectively. Disciplinary and intervention endpoints require admin-level access. Always ensure the calling user’s token carries the appropriate role permissions before making requests.

Health

Health Profiles

GET /api/welfare/health-profiles/
endpoint
List all student health profiles.
POST /api/welfare/health-profiles/
endpoint
Create a health profile for a student.
A HealthProfile holds a student’s core medical information: blood group, genotype, known allergies, chronic conditions, and emergency contact details. Each student has at most one health profile (enforced by a OneToOneField). Access is restricted to the school nurse role.

Request Fields

student
integer
required
Foreign key (one-to-one) — ID of the StudentProfile. Each student can have only one health profile.
blood_group
string
Student’s blood group, e.g. "O+". Optional.
genotype
string
Student’s genotype, e.g. "AA". Optional.
allergies
string
Free-text description of known allergies. Optional.
chronic_conditions
string
Free-text description of any chronic medical conditions. Optional.
emergency_contact_name
string
Full name of the emergency contact person. Optional.
emergency_contact_phone
string
Phone number for the emergency contact. Optional.

Example — Create a Health Profile

curl -X POST https://api.gobarau.edu.ng/api/welfare/health-profiles/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "student": 42,
    "blood_group": "B+",
    "genotype": "AS",
    "allergies": "Penicillin",
    "chronic_conditions": "",
    "emergency_contact_name": "Aisha Musa",
    "emergency_contact_phone": "+2348031234567"
  }'
id
integer
Unique identifier for the health profile.
student
integer
ID of the linked StudentProfile.
blood_group
string
Student’s blood group.
genotype
string
Student’s genotype.
allergies
string
Known allergies.
chronic_conditions
string
Known chronic conditions.
emergency_contact_name
string
Name of emergency contact.
emergency_contact_phone
string
Phone number of emergency contact.

Clinic Visits

GET /api/welfare/clinic-visits/
endpoint
List all clinic visit records.
POST /api/welfare/clinic-visits/
endpoint
Record a new clinic visit for a student.
A ClinicVisit records each time a student attends the school clinic. It captures the presenting complaint, diagnosis, treatment administered, and whether the student was referred to an external facility. Clinic visit records are fully audited.

Request Fields

student
integer
required
Foreign key — ID of the StudentProfile.
visit_date
string
required
Date of the clinic visit in YYYY-MM-DD format.
complaint
string
required
The student’s presenting complaint or reason for the visit.
diagnosis
string
Nurse or doctor’s diagnosis. Optional.
treatment
string
Treatment or care administered during the visit. Optional.
referred_out
boolean
Whether the student was referred to an external clinic or hospital. Defaults to false.

Medications

GET /api/welfare/medications/
endpoint
List all medication records.
POST /api/welfare/medications/
endpoint
Add a medication prescribed during a clinic visit.
A Medication entry records a drug prescribed to a student during a specific clinic visit. Multiple medications can be linked to a single visit.

Request Fields

clinic_visit
integer
required
Foreign key — ID of the ClinicVisit this medication belongs to.
drug_name
string
required
Name of the prescribed drug, e.g. "Paracetamol".
dosage
string
required
Dose amount and unit, e.g. "500mg".
frequency
string
required
How often the medication should be taken, e.g. "Twice daily".
duration
string
required
How long the course lasts, e.g. "5 days".

Counselling

Counselling Sessions

GET /api/welfare/counselling-sessions/
endpoint
List all counselling session records.
POST /api/welfare/counselling-sessions/
endpoint
Record a new counselling session.
A CounsellingSession documents a structured meeting between a student and a school counsellor, capturing the presenting issue, session notes, and any scheduled follow-up date. These records are soft-deleted and fully audited. Access is restricted to users with the counsellor role.

Request Fields

student
integer
required
Foreign key — ID of the StudentProfile.
counsellor
integer
Foreign key — ID of the TeacherProfile acting as counsellor. Nullable.
session_date
string
required
Date the session took place in YYYY-MM-DD format.
presenting_issue
string
required
Description of the issue or concern the student presented with.
notes
string
Counsellor’s session notes. Optional.
follow_up_date
string
Scheduled follow-up date in YYYY-MM-DD format. Nullable.
Counselling session notes are strictly confidential. Only authenticated users with the counsellor or principal role should have read access to this endpoint. Never expose session notes in parent-facing or student-facing API consumers.

Discipline

Disciplinary Records

GET /api/welfare/disciplinary-records/
endpoint
List all disciplinary records.
POST /api/welfare/disciplinary-records/
endpoint
Create a disciplinary record for a student incident.
A DisciplinaryRecord documents a behavioural incident involving a student, including the type of incident, a description, any action taken by the school, and the current resolution status. Records are ordered by most recent incident first.

Disciplinary Status Values

ValueDescription
pendingIncident recorded, no action taken yet (default)
resolvedIncident has been fully resolved
escalatedIncident has been escalated to senior management

Request Fields

student
integer
required
Foreign key — ID of the StudentProfile.
incident_date
string
required
Date of the incident in YYYY-MM-DD format.
incident_type
string
required
Short classification of the incident, e.g. "Fighting", "Insubordination".
description
string
required
Full narrative description of what occurred.
action_taken
string
Description of any disciplinary action applied. Optional.
status
string
Current status. One of pending, resolved, or escalated. Defaults to pending.

Example — Create a Disciplinary Record

curl -X POST https://api.gobarau.edu.ng/api/welfare/disciplinary-records/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "student": 42,
    "incident_date": "2025-02-14",
    "incident_type": "Bullying",
    "description": "Student was found intimidating a junior student during break time.",
    "action_taken": "Verbal warning issued, parents notified.",
    "status": "pending"
  }'
id
integer
Unique identifier for the disciplinary record.
student
integer
ID of the StudentProfile involved.
incident_type
string
Type classification of the incident.
status
string
Current resolution status: pending, resolved, or escalated.

Merit Deductions

GET /api/welfare/merit-deductions/
endpoint
List all merit and demerit point entries.
POST /api/welfare/merit-deductions/
endpoint
Record a merit addition or deduction for a student.
A MeritDeduction record adjusts a student’s running merit points balance. It can represent either an addition (reward) or a deduction (penalty), with a reason and the staff member who recorded it.

Merit Direction Values

ValueDescription
addPoints are being added (reward) (default)
deductPoints are being removed (penalty)

Request Fields

student
integer
required
Foreign key — ID of the StudentProfile.
points
integer
required
Number of merit points to add or deduct. Must be a positive integer. Defaults to 1.
direction
string
required
Whether points are being added or deducted. One of add or deduct.
reason
string
required
Brief reason for the merit change, e.g. "Outstanding conduct during assembly".
recorded_by
integer
Foreign key — ID of the User who recorded this entry. Nullable.

Interventions

Intervention Cases

GET /api/welfare/intervention-cases/
endpoint
List all intervention cases.
POST /api/welfare/intervention-cases/
endpoint
Open a new intervention case for a student.
An InterventionCase is a structured, trackable case opened when a student requires sustained support across one or more domains. Cases transition through open → on_hold → closed as progress is made.

Intervention Type Values

ValueDescription
academicAcademic underperformance or learning difficulties
attendancePersistent absenteeism or lateness
behaviouralOngoing behavioural concerns
welfareGeneral welfare or safeguarding issues
healthChronic health conditions requiring monitoring
tahfeezDifficulties or concerns in Qur’an memorization progress

Intervention Status Values

ValueDescription
openCase is actively being managed (default)
on_holdCase is paused, awaiting further information
closedCase has been resolved and closed

Request Fields

student
integer
required
Foreign key — ID of the StudentProfile.
case_type
string
required
Type or domain of the intervention. Recommended values: academic, attendance, behavioural, welfare, health, tahfeez.
description
string
required
Full description of the concern and context for this case.
closed_at
string
Date the case was closed in YYYY-MM-DD format. Nullable; set when status moves to closed.
status
string
Current case status. One of open, on_hold, or closed. Defaults to open.

Example — Open an Intervention Case

curl -X POST https://api.gobarau.edu.ng/api/welfare/intervention-cases/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "student": 88,
    "case_type": "attendance",
    "description": "Student has been absent for 12 out of the last 20 school days without adequate explanation. Parents have been unresponsive.",
    "status": "open"
  }'
id
integer
Unique identifier for the intervention case.
student
integer
ID of the StudentProfile.
case_type
string
Type/domain of the intervention.
opened_at
string
Date the case was opened (auto-set on creation).
status
string
Current case status: open, on_hold, or closed.

Intervention Notes

GET /api/welfare/intervention-notes/
endpoint
List all notes attached to intervention cases.
POST /api/welfare/intervention-notes/
endpoint
Add a progress note to an intervention case.
An InterventionNote is a timestamped progress update or observation added to an open intervention case by a staff member. Multiple notes can be attached to a single case.

Request Fields

case
integer
required
Foreign key — ID of the InterventionCase this note belongs to.
note
string
required
The full text of the progress note or update.
added_by
integer
Foreign key — ID of the User who wrote the note. Nullable.
Use intervention notes to maintain a running audit trail for each case. All notes are timestamped automatically via added_at and ordered from most recent to oldest.

Absences

GET /api/welfare/absences/
endpoint
List all extended absence records.
POST /api/welfare/absences/
endpoint
Log an extended absence period for a student.
An Absence record documents a multi-day absence period for a student, distinct from single-day attendance records. It captures the date range, the reason, whether the absence is officially excused, and whether the student’s parent or guardian has been notified.

Request Fields

student
integer
required
Foreign key — ID of the StudentProfile.
from_date
string
required
First day of the absence in YYYY-MM-DD format.
to_date
string
required
Last day of the absence in YYYY-MM-DD format.
reason
string
required
Reason provided for the absence.
is_excused
boolean
Whether the absence has been officially excused by the school. Defaults to false.
parent_notified
boolean
Whether the student’s parent or guardian has been informed. Defaults to false.

Welfare Reports

GET /api/welfare/welfare-reports/
endpoint
List all welfare reports.
POST /api/welfare/welfare-reports/
endpoint
Create a periodic welfare summary report for a student.
A WelfareReport is a termly summary of a student’s overall welfare level, bringing together health, behavioural, and counselling observations into a single consolidated assessment with recommendations for the upcoming term.

Request Fields

student
integer
required
Foreign key — ID of the StudentProfile.
term
integer
required
Foreign key — ID of the Term this report covers.
overall_welfare_level
string
required
A descriptive welfare level label, e.g. "Good", "Needs Monitoring", "At Risk".
recommendations
string
Recommendations for supporting the student in the next term. Optional.
prepared_by
integer
Foreign key — ID of the User who prepared this report. Nullable.
Welfare reports should only be prepared by authorised welfare staff (nurse, counsellor, or admin). When prepared_by is set, it creates an auditable record of who authored the report. Reports are soft-deleted — a DELETE request marks them as inactive rather than permanently removing them from the database.

Build docs developers (and LLMs) love