add class progress and fix endpoints

This commit is contained in:
root
2026-03-12 17:27:49 -04:00
parent 0f39dbee62
commit 33be0c9a0d
40 changed files with 2086 additions and 438 deletions
+5 -9
View File
@@ -1271,19 +1271,15 @@ This document lists every API controller alphabetically with any inline route co
- `PATCH /api/v1/refunds/{id}` Update status, payout amounts/methods, or notes; stamps approval/refunded timestamps when applicable.
## RegisterController
**File:** `app/Http/Controllers/Api/RegisterController.php`
**File:** `app/Http/Controllers/Api/Auth/RegisterController.php`
**Purpose:** Public registration portal for parents/guests, including CAPTCHA and confirmation email handling. Handles user registration with validation, role assignment, optional second parent information, and email confirmation.
**Endpoints:**
- `GET /api/v1/register` (`index`) Generate or retrieve CAPTCHA challenge for registration form. Returns:
- `captcha_question` Random CAPTCHA string (4-8 characters) stored in session
- `GET /api/v1/auth/register/captcha` (`captcha`) Generate or retrieve CAPTCHA challenge for registration form. Returns:
- `captcha` Random CAPTCHA string (4-10 characters) stored in session
- If CAPTCHA already exists in session, returns existing value
- Used to prevent automated registrations
- `GET /api/v1/register/success` (`registrationSuccess`) Get registration success data. Returns:
- `email` Email address from registration session
- Returns 400 error if no registration session exists
- Used to display confirmation screen after successful registration
- `POST /api/v1/register` (`register`) Submit registration form. Body parameters:
- `POST /api/v1/auth/register` (`store`) Submit registration form. Body parameters:
- **Required fields:**
- `firstname` (string, required) First name (2-30 chars, letters/spaces/hyphens only)
- `lastname` (string, required) Last name (2-30 chars, letters/spaces/hyphens only)
@@ -1781,7 +1777,7 @@ This document lists every API controller alphabetically with any inline route co
**Purpose:** Full REST API for managing students, class assignments, health information, and automated distribution.
**Endpoints:**
- `GET /api/v1/students` (`index`) Requires auth. Supports pagination and filters (`parent_id`, `class_id`). Augments each record with the student's current class info. Returns paginated list of students.
- `GET /api/v1/students` (`index`) Requires auth. Supports filters (`parent_id`, `parent_ids[]`). Returns list of students for the selected school year.
- `GET /api/v1/students/{id}` (`show`) Requires auth. Returns detailed student profile plus current class section information.
- `POST /api/v1/students` (`store`) Requires auth. Creates a new student. Validates demographic fields (firstname, lastname, dob, gender, parent_id) and automatically stamps school year, semester, and registration date.
- `PATCH /api/v1/students/{id}` (`update`) Requires auth. Updates student information. Accepts fields: `school_id`, `firstname`, `lastname`, `dob` (automatically calculates age), `gender`, `registration_grade`, `photo_consent`, `parent_id`, `registration_date`, `tuition_paid`, `year_of_registration`, `school_year`, `rfid_tag`, `semester`, `is_new`. Also supports health information: `medical_conditions` (comma/semicolon/newline separated list), `allergies` (comma/semicolon/newline separated list), `medical_touched`, `allergies_touched` (flags to indicate user interaction). Health lists are normalized, deduplicated, and synced with related tables. Only updates fields that are provided and non-empty.