recreate project
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Assignment API
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://your-domain.com/api/v1
|
||||
tags: [ { name: Assignments } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/assignments:
|
||||
get:
|
||||
tags: [Assignments]
|
||||
summary: List all assignments
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: class_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: teacher_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: student_id
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
post:
|
||||
tags: [Assignments]
|
||||
summary: Create a new assignment
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AssignmentCreate'
|
||||
responses:
|
||||
"201":
|
||||
description: Assignment created successfully
|
||||
|
||||
/assignments/{id}:
|
||||
get:
|
||||
tags: [Assignments]
|
||||
summary: Get an assignment by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Assignment found
|
||||
"404":
|
||||
description: Assignment not found
|
||||
put:
|
||||
tags: [Assignments]
|
||||
summary: Update an assignment
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AssignmentUpdate'
|
||||
responses:
|
||||
"200":
|
||||
description: Assignment updated successfully
|
||||
"404":
|
||||
description: Assignment not found
|
||||
delete:
|
||||
tags: [Assignments]
|
||||
summary: Delete an assignment
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Assignment deleted successfully
|
||||
"404":
|
||||
description: Assignment not found
|
||||
|
||||
/assignments/student/{id}:
|
||||
get:
|
||||
tags: [Assignments]
|
||||
summary: Get assignments for a specific student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: List of student assignments
|
||||
|
||||
components:
|
||||
schemas:
|
||||
AssignmentCreate:
|
||||
type: object
|
||||
required: [title, due_date, class_id, teacher_id]
|
||||
properties:
|
||||
title: { type: string }
|
||||
description: { type: string }
|
||||
due_date: { type: string, format: date }
|
||||
class_id: { type: integer }
|
||||
teacher_id: { type: integer }
|
||||
AssignmentUpdate:
|
||||
type: object
|
||||
properties:
|
||||
title: { type: string }
|
||||
description: { type: string }
|
||||
due_date: { type: string, format: date }
|
||||
class_id: { type: integer }
|
||||
teacher_id: { type: integer }
|
||||
@@ -0,0 +1,175 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Attendance API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Attendance } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/attendance:
|
||||
get:
|
||||
tags: [Attendance]
|
||||
summary: List attendance records
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: student_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: date
|
||||
schema: { type: string, format: date }
|
||||
responses:
|
||||
"200": { description: Attendance records retrieved successfully }
|
||||
post:
|
||||
tags: [Attendance]
|
||||
summary: Create new attendance record
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/AttendanceCreate' }
|
||||
responses:
|
||||
"201": { description: Record created }
|
||||
"409": { description: Duplicate record }
|
||||
"422": { description: Validation error }
|
||||
|
||||
/attendance/{id}:
|
||||
get:
|
||||
tags: [Attendance]
|
||||
summary: Get attendance by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Record retrieved }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Attendance]
|
||||
summary: Update attendance record
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/AttendanceUpdate' }
|
||||
responses:
|
||||
"200": { description: Record updated }
|
||||
"422": { description: Validation error }
|
||||
"404": { description: Not found }
|
||||
delete:
|
||||
tags: [Attendance]
|
||||
summary: Delete attendance record
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Record deleted }
|
||||
"404": { description: Not found }
|
||||
|
||||
/attendance/student/{id}:
|
||||
get:
|
||||
tags: [Attendance]
|
||||
summary: Get all attendance records for a student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Student attendance list }
|
||||
|
||||
/attendance/class/{class_section_id}:
|
||||
get:
|
||||
tags: [Attendance]
|
||||
summary: Get class roster attendance for a date
|
||||
parameters:
|
||||
- in: path
|
||||
name: class_section_id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: date
|
||||
schema: { type: string, format: date }
|
||||
responses:
|
||||
"200":
|
||||
description: Roster with attendance status
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
class_section_id: { type: integer }
|
||||
date: { type: string, format: date }
|
||||
students:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
status: { type: string, nullable: true, enum: [present, absent, late] }
|
||||
reason: { type: string, nullable: true }
|
||||
|
||||
/attendance/class/{class_section_id}/record:
|
||||
post:
|
||||
tags: [Attendance]
|
||||
summary: Record class attendance for a date
|
||||
parameters:
|
||||
- in: path
|
||||
name: class_section_id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [date, records]
|
||||
properties:
|
||||
date: { type: string, format: date }
|
||||
records:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required: [student_id, status]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
status: { type: string, enum: [present, absent, late] }
|
||||
reason: { type: string, nullable: true }
|
||||
responses:
|
||||
"200": { description: Attendance rows saved }
|
||||
|
||||
components:
|
||||
schemas:
|
||||
AttendanceCreate:
|
||||
type: object
|
||||
required: [student_id, date, status]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
date: { type: string, format: date }
|
||||
status: { type: string, enum: [present, absent, late] }
|
||||
notes: { type: string }
|
||||
AttendanceUpdate:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, enum: [present, absent, late] }
|
||||
notes: { type: string }
|
||||
@@ -0,0 +1,56 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Attendance Tracking API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Attendance Tracking } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/attendance-tracking/record:
|
||||
post:
|
||||
tags: [Attendance Tracking]
|
||||
summary: Record or update an attendance tracking entry
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/TrackingCreate' }
|
||||
responses:
|
||||
"201": { description: Tracking record created }
|
||||
"200": { description: Tracking record updated }
|
||||
"422": { description: Validation error }
|
||||
|
||||
/attendance-tracking/violations:
|
||||
get:
|
||||
tags: [Attendance Tracking]
|
||||
summary: Get students with attendance violations
|
||||
parameters:
|
||||
- in: query
|
||||
name: threshold
|
||||
schema: { type: integer, default: 3 }
|
||||
description: Minimum number of violations
|
||||
responses:
|
||||
"200": { description: Violations retrieved successfully }
|
||||
|
||||
/attendance-tracking/student/{id}:
|
||||
get:
|
||||
tags: [Attendance Tracking]
|
||||
summary: Get attendance tracking records for a student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Student tracking history }
|
||||
|
||||
components:
|
||||
schemas:
|
||||
TrackingCreate:
|
||||
type: object
|
||||
required: [student_id, date, status]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
date: { type: string, format: date }
|
||||
status: { type: string, enum: [present, absent, late] }
|
||||
type: { type: string, example: "late arrival" }
|
||||
notes: { type: string }
|
||||
@@ -0,0 +1,145 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Authentication API
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://your-domain.com/api/v1
|
||||
description: Production
|
||||
- url: http://localhost:8080/api/v1
|
||||
description: Local
|
||||
tags:
|
||||
- name: Authentication
|
||||
paths:
|
||||
/login:
|
||||
post:
|
||||
tags: [Authentication]
|
||||
summary: Obtain a JWT token for a user
|
||||
description: Authenticate with valid credentials to receive a JWT token and user summary.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [email, password]
|
||||
properties:
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
example: admin@example.com
|
||||
password:
|
||||
type: string
|
||||
minLength: 8
|
||||
example: 12345678
|
||||
responses:
|
||||
"200":
|
||||
description: Login successful
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/LoginSuccess'
|
||||
"400":
|
||||
description: Missing email or password
|
||||
"401":
|
||||
description: Invalid credentials
|
||||
"403":
|
||||
description: Account suspended
|
||||
"429":
|
||||
description: Too many attempts from this IP address
|
||||
security: []
|
||||
/register:
|
||||
post:
|
||||
tags: [Authentication]
|
||||
summary: Create a new user account (parent registration)
|
||||
description: Open registration endpoint that creates a parent account and returns the created profile.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RegisterRequest'
|
||||
responses:
|
||||
"201":
|
||||
description: User registered successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RegisterSuccess'
|
||||
"400":
|
||||
description: Invalid request data
|
||||
"422":
|
||||
description: Validation failure (e.g., email already registered)
|
||||
"500":
|
||||
description: Server error while creating user
|
||||
security: []
|
||||
components:
|
||||
schemas:
|
||||
LoginSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: boolean
|
||||
example: true
|
||||
token:
|
||||
type: string
|
||||
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
user:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
example: 1
|
||||
name:
|
||||
type: string
|
||||
example: Admin User
|
||||
roles:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
example:
|
||||
admin: true
|
||||
RegisterRequest:
|
||||
type: object
|
||||
required: [firstname, lastname, email, password, captcha_answer]
|
||||
properties:
|
||||
firstname:
|
||||
type: string
|
||||
example: Jane
|
||||
lastname:
|
||||
type: string
|
||||
example: Doe
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
example: parent@example.com
|
||||
password:
|
||||
type: string
|
||||
minLength: 8
|
||||
example: StrongPass123
|
||||
phone:
|
||||
type: string
|
||||
nullable: true
|
||||
example: "+1-410-555-1234"
|
||||
captcha_answer:
|
||||
type: string
|
||||
example: "5"
|
||||
RegisterSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: boolean
|
||||
example: true
|
||||
message:
|
||||
type: string
|
||||
example: Registration successful. Please verify your email.
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
user:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, example: 101 }
|
||||
firstname: { type: string, example: "Jane" }
|
||||
lastname: { type: string, example: "Doe" }
|
||||
email: { type: string, format: email, example: "parent@example.com" }
|
||||
school_id: { type: string, example: "SCH-0001" }
|
||||
@@ -0,0 +1,72 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Authorized Users API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Authorized Users } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/authorized-users:
|
||||
get:
|
||||
tags: [Authorized Users]
|
||||
summary: List all authorized users
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: role
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: status
|
||||
schema: { type: string, enum: [active, inactive] }
|
||||
responses:
|
||||
"200": { description: Authorized users retrieved }
|
||||
post:
|
||||
tags: [Authorized Users]
|
||||
summary: Create new authorized user
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/AuthorizedUserCreate' }
|
||||
responses:
|
||||
"201": { description: User created successfully }
|
||||
|
||||
/authorized-users/{id}:
|
||||
get:
|
||||
tags: [Authorized Users]
|
||||
summary: Get authorized user by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: User retrieved successfully }
|
||||
"404": { description: Not found }
|
||||
delete:
|
||||
tags: [Authorized Users]
|
||||
summary: Delete authorized user
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: User deleted }
|
||||
"404": { description: Not found }
|
||||
|
||||
components:
|
||||
schemas:
|
||||
AuthorizedUserCreate:
|
||||
type: object
|
||||
required: [name, email, password, role]
|
||||
properties:
|
||||
name: { type: string }
|
||||
email: { type: string, format: email }
|
||||
password: { type: string, minLength: 6 }
|
||||
role: { type: string }
|
||||
status: { type: string, enum: [active, inactive] }
|
||||
@@ -0,0 +1,38 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Broadcast Email API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Broadcast Email } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/broadcast-email/send:
|
||||
post:
|
||||
tags: [Broadcast Email]
|
||||
summary: Send broadcast email
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/BroadcastEmailSend' }
|
||||
responses:
|
||||
"200": { description: Broadcast sent successfully }
|
||||
"422": { description: Validation error }
|
||||
|
||||
/broadcast-email/parents:
|
||||
get:
|
||||
tags: [Broadcast Email]
|
||||
summary: Get all parents for broadcast selection
|
||||
responses:
|
||||
"200": { description: List of parent recipients }
|
||||
|
||||
components:
|
||||
schemas:
|
||||
BroadcastEmailSend:
|
||||
type: object
|
||||
required: [subject, body, recipients]
|
||||
properties:
|
||||
subject: { type: string, example: "Reminder: School Closed on Sunday" }
|
||||
body: { type: string, example: "Dear parents, please note that..." }
|
||||
recipients:
|
||||
type: array
|
||||
items: { type: string, format: email }
|
||||
@@ -0,0 +1,97 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Calendar API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Calendar } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/calendar:
|
||||
get:
|
||||
tags: [Calendar]
|
||||
summary: List all calendar events
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: month
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: year
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Events retrieved successfully }
|
||||
post:
|
||||
tags: [Calendar]
|
||||
summary: Create new calendar event
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/EventCreate' }
|
||||
responses:
|
||||
"201": { description: Event created }
|
||||
|
||||
/calendar/{id}:
|
||||
get:
|
||||
tags: [Calendar]
|
||||
summary: Get event details by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Event retrieved }
|
||||
"404": { description: Event not found }
|
||||
put:
|
||||
tags: [Calendar]
|
||||
summary: Update an existing event
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/EventUpdate' }
|
||||
responses:
|
||||
"200": { description: Event updated }
|
||||
"404": { description: Event not found }
|
||||
"422": { description: Validation error }
|
||||
delete:
|
||||
tags: [Calendar]
|
||||
summary: Delete an event
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Event deleted }
|
||||
"404": { description: Event not found }
|
||||
|
||||
components:
|
||||
schemas:
|
||||
EventCreate:
|
||||
type: object
|
||||
required: [title, start_date]
|
||||
properties:
|
||||
title: { type: string }
|
||||
description: { type: string }
|
||||
start_date: { type: string, format: date }
|
||||
end_date: { type: string, format: date }
|
||||
location: { type: string }
|
||||
EventUpdate:
|
||||
type: object
|
||||
properties:
|
||||
title: { type: string }
|
||||
description: { type: string }
|
||||
start_date: { type: string, format: date }
|
||||
end_date: { type: string, format: date }
|
||||
location: { type: string }
|
||||
@@ -0,0 +1,51 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Class API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Classes } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/classes:
|
||||
get:
|
||||
tags: [Classes]
|
||||
summary: List all classes
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: grade
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: teacher_id
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Classes retrieved successfully }
|
||||
|
||||
/classes/{id}:
|
||||
get:
|
||||
tags: [Classes]
|
||||
summary: Get class details by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Class details retrieved }
|
||||
"404": { description: Class not found }
|
||||
|
||||
/classes/{id}/students:
|
||||
get:
|
||||
tags: [Classes]
|
||||
summary: Get students enrolled in a specific class
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Students retrieved }
|
||||
@@ -0,0 +1,61 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Class Preparation API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Class Preparation } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/class-preparation:
|
||||
get:
|
||||
tags: [Class Preparation]
|
||||
summary: List all class preparation records
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: class_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: school_year
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Records retrieved successfully }
|
||||
|
||||
/class-preparation/{class_id}:
|
||||
get:
|
||||
tags: [Class Preparation]
|
||||
summary: Get preparation details for a specific class
|
||||
parameters:
|
||||
- in: path
|
||||
name: class_id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Preparation record retrieved }
|
||||
"404": { description: Not found }
|
||||
|
||||
/class-preparation/calculate:
|
||||
post:
|
||||
tags: [Class Preparation]
|
||||
summary: Calculate required items for a class
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/PreparationCalculateRequest' }
|
||||
responses:
|
||||
"200": { description: Calculation successful }
|
||||
"422": { description: Validation error }
|
||||
|
||||
components:
|
||||
schemas:
|
||||
PreparationCalculateRequest:
|
||||
type: object
|
||||
required: [class_id, school_year]
|
||||
properties:
|
||||
class_id: { type: integer }
|
||||
school_year: { type: string }
|
||||
@@ -0,0 +1,79 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Communication API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Communications } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/communications:
|
||||
get:
|
||||
tags: [Communications]
|
||||
summary: List all communications
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: sender_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: receiver_id
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Communications retrieved successfully }
|
||||
|
||||
/communications/send:
|
||||
post:
|
||||
tags: [Communications]
|
||||
summary: Send a new message
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: '#/components/schemas/CommunicationSend' }
|
||||
responses:
|
||||
"201": { description: Message sent successfully }
|
||||
"422": { description: Validation error }
|
||||
|
||||
/communications/conversation:
|
||||
get:
|
||||
tags: [Communications]
|
||||
summary: Get conversation between two users
|
||||
parameters:
|
||||
- in: query
|
||||
name: sender_id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: receiver_id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Conversation retrieved }
|
||||
|
||||
/communications/{id}:
|
||||
delete:
|
||||
tags: [Communications]
|
||||
summary: Delete a message
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Message deleted successfully }
|
||||
"404": { description: Message not found }
|
||||
|
||||
components:
|
||||
schemas:
|
||||
CommunicationSend:
|
||||
type: object
|
||||
required: [sender_id, receiver_id, subject, message]
|
||||
properties:
|
||||
sender_id: { type: integer }
|
||||
receiver_id: { type: integer }
|
||||
subject: { type: string }
|
||||
message: { type: string }
|
||||
@@ -0,0 +1,48 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Discount API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Discounts } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/discounts:
|
||||
get:
|
||||
tags: [Discounts]
|
||||
summary: List discount vouchers
|
||||
parameters:
|
||||
- in: query
|
||||
name: active
|
||||
schema: { type: boolean }
|
||||
responses:
|
||||
"200": { description: Discount vouchers }
|
||||
|
||||
/discounts/code/{code}:
|
||||
get:
|
||||
tags: [Discounts]
|
||||
summary: Get discount by code
|
||||
parameters:
|
||||
- in: path
|
||||
name: code
|
||||
required: true
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Discount voucher }
|
||||
"404": { description: Not found }
|
||||
|
||||
/discounts/apply:
|
||||
post:
|
||||
tags: [Discounts]
|
||||
summary: Apply a discount voucher to an invoice
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [code, invoice_id]
|
||||
properties:
|
||||
code: { type: string }
|
||||
invoice_id: { type: integer }
|
||||
responses:
|
||||
"200": { description: Discount applied }
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Emergency Contact API - Al Rahma Sunday School
|
||||
version: 1.0.0
|
||||
description: Manage emergency contacts for parents and students.
|
||||
servers:
|
||||
- url: https://your-domain.com/api/v1
|
||||
security:
|
||||
- bearerAuth: []
|
||||
tags:
|
||||
- name: Emergency Contacts
|
||||
description: CRUD operations for emergency contacts
|
||||
|
||||
paths:
|
||||
/emergency-contacts:
|
||||
get:
|
||||
tags: [Emergency Contacts]
|
||||
summary: List emergency contacts
|
||||
parameters:
|
||||
- in: query
|
||||
name: parent_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: student_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: school_year
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: semester
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
responses:
|
||||
"200":
|
||||
description: Emergency contacts list
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EmergencyContactsResponse'
|
||||
post:
|
||||
tags: [Emergency Contacts]
|
||||
summary: Create a new emergency contact
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SaveEmergencyContactRequest'
|
||||
responses:
|
||||
"201":
|
||||
description: Created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EmergencyContactResponse'
|
||||
|
||||
/emergency-contacts/{id}:
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
get:
|
||||
tags: [Emergency Contacts]
|
||||
summary: Retrieve an emergency contact
|
||||
responses:
|
||||
"200":
|
||||
description: Emergency contact details
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EmergencyContactResponse'
|
||||
"404":
|
||||
description: Not found
|
||||
put:
|
||||
tags: [Emergency Contacts]
|
||||
summary: Update an emergency contact
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SaveEmergencyContactRequest'
|
||||
responses:
|
||||
"200":
|
||||
description: Updated
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EmergencyContactResponse'
|
||||
delete:
|
||||
tags: [Emergency Contacts]
|
||||
summary: Delete an emergency contact
|
||||
responses:
|
||||
"200":
|
||||
description: Deleted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
/emergency-contacts/parent/{id}:
|
||||
get:
|
||||
tags: [Emergency Contacts]
|
||||
summary: List emergency contacts for a parent
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Parent emergency contacts
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EmergencyContactsResponse'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
EmergencyContact:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
parent_id: { type: integer }
|
||||
emergency_contact_name: { type: string }
|
||||
cellphone: { type: string }
|
||||
email: { type: string, nullable: true }
|
||||
relation: { type: string, nullable: true }
|
||||
school_year: { type: string }
|
||||
semester: { type: string }
|
||||
created_at: { type: string, format: date-time }
|
||||
updated_at: { type: string, format: date-time }
|
||||
|
||||
EmergencyContactsResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/EmergencyContact'
|
||||
|
||||
EmergencyContactResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
$ref: '#/components/schemas/EmergencyContact'
|
||||
|
||||
SaveEmergencyContactRequest:
|
||||
type: object
|
||||
required: [parent_id, emergency_contact_name, cellphone, relation, school_year, semester]
|
||||
properties:
|
||||
parent_id: { type: integer }
|
||||
emergency_contact_name: { type: string }
|
||||
cellphone: { type: string }
|
||||
email: { type: string, nullable: true }
|
||||
relation: { type: string }
|
||||
school_year: { type: string }
|
||||
semester: { type: string }
|
||||
|
||||
BasicSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data: {}
|
||||
@@ -0,0 +1,94 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Expense API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Expenses } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/expenses:
|
||||
get:
|
||||
tags: [Expenses]
|
||||
summary: List expenses
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: status
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: category
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Expenses retrieved }
|
||||
post:
|
||||
tags: [Expenses]
|
||||
summary: Create expense
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [category, amount, description, date_of_purchase]
|
||||
properties:
|
||||
category: { type: string }
|
||||
amount: { type: number }
|
||||
description: { type: string }
|
||||
retailor: { type: string }
|
||||
date_of_purchase: { type: string, format: date }
|
||||
purchased_by: { type: integer }
|
||||
status: { type: string }
|
||||
responses:
|
||||
"201": { description: Expense created }
|
||||
|
||||
/expenses/{id}:
|
||||
get:
|
||||
tags: [Expenses]
|
||||
summary: Get expense by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Expense }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Expenses]
|
||||
summary: Update expense
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
category: { type: string }
|
||||
amount: { type: number }
|
||||
description: { type: string }
|
||||
retailor: { type: string }
|
||||
date_of_purchase: { type: string, format: date }
|
||||
status: { type: string }
|
||||
status_reason: { type: string }
|
||||
responses:
|
||||
"200": { description: Expense updated }
|
||||
delete:
|
||||
tags: [Expenses]
|
||||
summary: Delete expense
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Expense deleted }
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Extra Charges API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Extra Charges } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/extra-charges:
|
||||
get:
|
||||
tags: [Extra Charges]
|
||||
summary: List extra charges
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: parent_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: status
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: school_year
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Extra charges retrieved }
|
||||
post:
|
||||
tags: [Extra Charges]
|
||||
summary: Create an extra charge
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [parent_id, invoice_id, amount, description]
|
||||
properties:
|
||||
parent_id: { type: integer }
|
||||
invoice_id: { type: integer }
|
||||
title: { type: string }
|
||||
description: { type: string }
|
||||
amount: { type: number }
|
||||
charge_type: { type: string, enum: [add, deduct] }
|
||||
due_date: { type: string, format: date }
|
||||
responses:
|
||||
"201": { description: Extra charge created }
|
||||
|
||||
/extra-charges/{id}:
|
||||
get:
|
||||
tags: [Extra Charges]
|
||||
summary: Get an extra charge
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Extra charge }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Extra Charges]
|
||||
summary: Update an extra charge
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
title: { type: string }
|
||||
description: { type: string }
|
||||
amount: { type: number }
|
||||
status: { type: string }
|
||||
charge_type: { type: string, enum: [add, deduct] }
|
||||
due_date: { type: string, format: date }
|
||||
responses:
|
||||
"200": { description: Extra charge updated }
|
||||
delete:
|
||||
tags: [Extra Charges]
|
||||
summary: Delete an extra charge
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Extra charge deleted }
|
||||
|
||||
/extra-charges/{id}/apply:
|
||||
post:
|
||||
tags: [Extra Charges]
|
||||
summary: Mark an extra charge as applied
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [invoice_id]
|
||||
properties:
|
||||
invoice_id: { type: integer }
|
||||
responses:
|
||||
"200": { description: Extra charge applied }
|
||||
|
||||
/extra-charges/parents:
|
||||
get:
|
||||
tags: [Extra Charges]
|
||||
summary: Get parent options
|
||||
responses:
|
||||
"200": { description: Parent options list }
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Family API - Al Rahma Sunday School
|
||||
version: 1.0.0
|
||||
description: >
|
||||
Manage household groupings, students, and guardians that are linked to parents.
|
||||
All endpoints expect JWT Bearer authentication.
|
||||
servers:
|
||||
- url: https://your-domain.com/api/v1
|
||||
security:
|
||||
- bearerAuth: []
|
||||
tags:
|
||||
- name: Families
|
||||
description: Manage families, students, and guardian relationships
|
||||
|
||||
paths:
|
||||
/families:
|
||||
get:
|
||||
tags: [Families]
|
||||
summary: List family records
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
responses:
|
||||
"200":
|
||||
description: Paginated family list
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedFamiliesResponse'
|
||||
|
||||
/families/{id}:
|
||||
get:
|
||||
tags: [Families]
|
||||
summary: Get a specific family
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Family info
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FamilyResponse'
|
||||
"404":
|
||||
description: Family not found
|
||||
|
||||
/families/student/{id}:
|
||||
get:
|
||||
tags: [Families]
|
||||
summary: Get families that include a specific student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: One or more families
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedFamiliesResponse'
|
||||
|
||||
/families/{id}/guardians:
|
||||
get:
|
||||
tags: [Families]
|
||||
summary: List guardians linked to a family
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Guardians for the family
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/GuardiansListResponse'
|
||||
components:
|
||||
schemas:
|
||||
Family:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
family_name: { type: string, nullable: true }
|
||||
created_at: { type: string, format: date-time }
|
||||
updated_at: { type: string, format: date-time }
|
||||
students:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/StudentSummary'
|
||||
guardians:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Guardian'
|
||||
|
||||
StudentSummary:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
grade: { type: string, nullable: true }
|
||||
|
||||
Guardian:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
family_id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
cellphone: { type: string }
|
||||
email: { type: string, nullable: true }
|
||||
relation: { type: string, nullable: true }
|
||||
|
||||
FamilyResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
$ref: '#/components/schemas/Family'
|
||||
|
||||
PaginatedFamiliesResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Family'
|
||||
pagination:
|
||||
type: object
|
||||
properties:
|
||||
current_page: { type: integer }
|
||||
per_page: { type: integer }
|
||||
total: { type: integer }
|
||||
total_pages: { type: integer }
|
||||
|
||||
GuardiansListResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Guardian'
|
||||
@@ -0,0 +1,59 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Final Exam API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Finals } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/finals:
|
||||
post:
|
||||
tags: [Finals]
|
||||
summary: Create or update final score
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [student_id, class_section_id]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"201": { description: Final saved }
|
||||
|
||||
/finals/student/{id}:
|
||||
get:
|
||||
tags: [Finals]
|
||||
summary: Get final by student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Final }
|
||||
|
||||
/finals/{id}:
|
||||
put:
|
||||
tags: [Finals]
|
||||
summary: Update final row
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"200": { description: Final updated }
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Financial API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Financial } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/financial/report:
|
||||
get:
|
||||
tags: [Financial]
|
||||
summary: Get financial report data
|
||||
parameters:
|
||||
- in: query
|
||||
name: date_from
|
||||
schema: { type: string, format: date }
|
||||
- in: query
|
||||
name: date_to
|
||||
schema: { type: string, format: date }
|
||||
- in: query
|
||||
name: school_year
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Report data }
|
||||
|
||||
/financial/unpaid-parents:
|
||||
get:
|
||||
tags: [Financial]
|
||||
summary: List unpaid parents with balances
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
responses:
|
||||
"200": { description: Unpaid parents list }
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Homework API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Homework } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/homework:
|
||||
get:
|
||||
tags: [Homework]
|
||||
summary: List homework rows
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: class_section_id
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Homework retrieved }
|
||||
post:
|
||||
tags: [Homework]
|
||||
summary: Create homework row
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [student_id, class_section_id, homework_index]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
homework_index: { type: integer }
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"201": { description: Homework created }
|
||||
|
||||
/homework/student/{id}:
|
||||
get:
|
||||
tags: [Homework]
|
||||
summary: Get homework rows by student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Homework list }
|
||||
|
||||
/homework/{id}:
|
||||
put:
|
||||
tags: [Homework]
|
||||
summary: Update homework
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"200": { description: Homework updated }
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Homework Tracking API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Homework Tracking } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/homework-tracking:
|
||||
get:
|
||||
tags: [Homework Tracking]
|
||||
summary: Get homework tracking overview (Sundays, no-school event days, aggregation)
|
||||
parameters:
|
||||
- in: query
|
||||
name: start_date
|
||||
schema: { type: string, format: date, example: "2025-09-21" }
|
||||
- in: query
|
||||
name: end_date
|
||||
schema: { type: string, format: date, example: "2026-01-18" }
|
||||
responses:
|
||||
"200": { description: Tracking data returned }
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Invoice API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Invoices } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/invoices:
|
||||
get:
|
||||
tags: [Invoices]
|
||||
summary: List invoices
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: parent_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: status
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Invoices retrieved }
|
||||
post:
|
||||
tags: [Invoices]
|
||||
summary: Create invoice
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [invoice_number, total_amount, issue_date, status]
|
||||
properties:
|
||||
parent_id: { type: integer }
|
||||
invoice_number: { type: string }
|
||||
total_amount: { type: number }
|
||||
balance: { type: number }
|
||||
paid_amount: { type: number }
|
||||
school_year: { type: string }
|
||||
semester: { type: string }
|
||||
issue_date: { type: string, format: date-time }
|
||||
due_date: { type: string, format: date-time }
|
||||
status: { type: string }
|
||||
description: { type: string }
|
||||
responses:
|
||||
"201": { description: Invoice created }
|
||||
|
||||
/invoices/{id}:
|
||||
get:
|
||||
tags: [Invoices]
|
||||
summary: Get invoice by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Invoice }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Invoices]
|
||||
summary: Update invoice
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
paid_amount: { type: number }
|
||||
balance: { type: number }
|
||||
description: { type: string }
|
||||
responses:
|
||||
"200": { description: Invoice updated }
|
||||
delete:
|
||||
tags: [Invoices]
|
||||
summary: Delete invoice
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Invoice deleted }
|
||||
|
||||
/invoices/parent/{id}:
|
||||
get:
|
||||
tags: [Invoices]
|
||||
summary: List invoices by parent
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Parent invoices list }
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Late Slip Logs API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Late Slip Logs } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/late-slip-logs:
|
||||
get:
|
||||
tags: [Late Slip Logs]
|
||||
summary: List late slip logs
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 50 }
|
||||
- in: query
|
||||
name: school_year
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: semester
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: q
|
||||
schema: { type: string, description: 'Filter by student name' }
|
||||
- in: query
|
||||
name: date_from
|
||||
schema: { type: string, format: date }
|
||||
- in: query
|
||||
name: date_to
|
||||
schema: { type: string, format: date }
|
||||
responses:
|
||||
"200": { description: Logs retrieved }
|
||||
|
||||
/late-slip-logs/{id}:
|
||||
get:
|
||||
tags: [Late Slip Logs]
|
||||
summary: Get a late slip log by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Log retrieved }
|
||||
"404": { description: Not found }
|
||||
|
||||
@@ -0,0 +1,349 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Al Rahma Sunday School API
|
||||
version: 1.0.0
|
||||
description: |
|
||||
Unified API specification for all system modules.
|
||||
All routes require JWT Bearer authentication (`Authorization: Bearer <token>`).
|
||||
|
||||
servers:
|
||||
- url: https://your-domain.com/api/v1
|
||||
description: Production
|
||||
- url: http://localhost:8080/api/v1
|
||||
description: Local
|
||||
|
||||
security:
|
||||
- bearerAuth: []
|
||||
|
||||
tags:
|
||||
- name: Assignments
|
||||
- name: Attendance
|
||||
- name: Attendance Tracking
|
||||
- name: Authorized Users
|
||||
- name: Authentication
|
||||
- name: Broadcast Email
|
||||
- name: Calendar
|
||||
- name: Classes
|
||||
- name: Class Preparation
|
||||
- name: Communications
|
||||
- name: Homework
|
||||
- name: Quizzes
|
||||
- name: Projects
|
||||
- name: Payments
|
||||
- name: Invoices
|
||||
- name: Expenses
|
||||
- name: Midterms
|
||||
- name: Finals
|
||||
- name: Score Comments
|
||||
- name: Scores
|
||||
- name: Messages
|
||||
- name: Notifications
|
||||
- name: Extra Charges
|
||||
- name: Discounts
|
||||
- name: Teachers
|
||||
- name: Staff
|
||||
- name: Users
|
||||
- name: Financial
|
||||
- name: Purchase Orders
|
||||
- name: Late Slip Logs
|
||||
- name: Homework Tracking
|
||||
- name: Teachers
|
||||
- name: Parents
|
||||
- name: Admin Dashboard
|
||||
- name: Absence
|
||||
- name: Search
|
||||
- name: Enrollment
|
||||
- name: Profiles
|
||||
- name: Score Predictor
|
||||
- name: Families
|
||||
- name: Emergency Contacts
|
||||
- name: Suppliers
|
||||
- name: Roles
|
||||
- name: Permissions
|
||||
|
||||
paths:
|
||||
/login:
|
||||
$ref: './auth_controller.yaml#/paths/~1login'
|
||||
/register:
|
||||
$ref: './auth_controller.yaml#/paths/~1register'
|
||||
/assignments:
|
||||
$ref: './assignment_controller.yaml#/paths/~1assignments'
|
||||
/assignments/{id}:
|
||||
$ref: './assignment_controller.yaml#/paths/~1assignments~1{id}'
|
||||
/assignments/student/{id}:
|
||||
$ref: './assignment_controller.yaml#/paths/~1assignments~1student~1{id}'
|
||||
|
||||
/attendance:
|
||||
$ref: './attendance_controller.yaml#/paths/~1attendance'
|
||||
/attendance/{id}:
|
||||
$ref: './attendance_controller.yaml#/paths/~1attendance~1{id}'
|
||||
/attendance/student/{id}:
|
||||
$ref: './attendance_controller.yaml#/paths/~1attendance~1student~1{id}'
|
||||
/attendance/class/{class_section_id}:
|
||||
$ref: './attendance_controller.yaml#/paths/~1attendance~1class~1{class_section_id}'
|
||||
/attendance/class/{class_section_id}/record:
|
||||
$ref: './attendance_controller.yaml#/paths/~1attendance~1class~1{class_section_id}~1record'
|
||||
|
||||
/attendance-tracking/record:
|
||||
$ref: './attendance_tracking_controller.yaml#/paths/~1attendance-tracking~1record'
|
||||
/attendance-tracking/violations:
|
||||
$ref: './attendance_tracking_controller.yaml#/paths/~1attendance-tracking~1violations'
|
||||
/attendance-tracking/student/{id}:
|
||||
$ref: './attendance_tracking_controller.yaml#/paths/~1attendance-tracking~1student~1{id}'
|
||||
|
||||
/authorized-users:
|
||||
$ref: './authorized_users_controller.yaml#/paths/~1authorized-users'
|
||||
/authorized-users/{id}:
|
||||
$ref: './authorized_users_controller.yaml#/paths/~1authorized-users~1{id}'
|
||||
|
||||
/broadcast-email/send:
|
||||
$ref: './broadcast_email_controller.yaml#/paths/~1broadcast-email~1send'
|
||||
/broadcast-email/parents:
|
||||
$ref: './broadcast_email_controller.yaml#/paths/~1broadcast-email~1parents'
|
||||
|
||||
/calendar:
|
||||
$ref: './calendar_controller.yaml#/paths/~1calendar'
|
||||
/calendar/{id}:
|
||||
$ref: './calendar_controller.yaml#/paths/~1calendar~1{id}'
|
||||
|
||||
/classes:
|
||||
$ref: './class_controller.yaml#/paths/~1classes'
|
||||
/classes/{id}:
|
||||
$ref: './class_controller.yaml#/paths/~1classes~1{id}'
|
||||
/classes/{id}/students:
|
||||
$ref: './class_controller.yaml#/paths/~1classes~1{id}~1students'
|
||||
|
||||
/class-preparation:
|
||||
$ref: './class_preparation_controller.yaml#/paths/~1class-preparation'
|
||||
/class-preparation/{class_id}:
|
||||
$ref: './class_preparation_controller.yaml#/paths/~1class-preparation~1{class_id}'
|
||||
/class-preparation/calculate:
|
||||
$ref: './class_preparation_controller.yaml#/paths/~1class-preparation~1calculate'
|
||||
|
||||
/homework:
|
||||
$ref: './homework_controller.yaml#/paths/~1homework'
|
||||
/homework/{id}:
|
||||
$ref: './homework_controller.yaml#/paths/~1homework~1{id}'
|
||||
/homework/student/{id}:
|
||||
$ref: './homework_controller.yaml#/paths/~1homework~1student~1{id}'
|
||||
|
||||
/quizzes:
|
||||
$ref: './quiz_controller.yaml#/paths/~1quizzes'
|
||||
/quizzes/{id}:
|
||||
$ref: './quiz_controller.yaml#/paths/~1quizzes~1{id}'
|
||||
/quizzes/student/{id}:
|
||||
$ref: './quiz_controller.yaml#/paths/~1quizzes~1student~1{id}'
|
||||
|
||||
/projects:
|
||||
$ref: './project_controller.yaml#/paths/~1projects'
|
||||
/projects/{id}:
|
||||
$ref: './project_controller.yaml#/paths/~1projects~1{id}'
|
||||
/projects/student/{id}:
|
||||
$ref: './project_controller.yaml#/paths/~1projects~1student~1{id}'
|
||||
|
||||
/payments:
|
||||
$ref: './payment_controller.yaml#/paths/~1payments'
|
||||
/payments/{id}:
|
||||
$ref: './payment_controller.yaml#/paths/~1payments~1{id}'
|
||||
/payments/parent/{id}:
|
||||
$ref: './payment_controller.yaml#/paths/~1payments~1parent~1{id}'
|
||||
|
||||
/invoices:
|
||||
$ref: './invoice_controller.yaml#/paths/~1invoices'
|
||||
/invoices/{id}:
|
||||
$ref: './invoice_controller.yaml#/paths/~1invoices~1{id}'
|
||||
/invoices/parent/{id}:
|
||||
$ref: './invoice_controller.yaml#/paths/~1invoices~1parent~1{id}'
|
||||
|
||||
/expenses:
|
||||
$ref: './expense_controller.yaml#/paths/~1expenses'
|
||||
/expenses/{id}:
|
||||
$ref: './expense_controller.yaml#/paths/~1expenses~1{id}'
|
||||
|
||||
/midterms:
|
||||
$ref: './midterm_controller.yaml#/paths/~1midterms'
|
||||
/midterms/student/{id}:
|
||||
$ref: './midterm_controller.yaml#/paths/~1midterms~1student~1{id}'
|
||||
/midterms/{id}:
|
||||
$ref: './midterm_controller.yaml#/paths/~1midterms~1{id}'
|
||||
|
||||
/finals:
|
||||
$ref: './final_controller.yaml#/paths/~1finals'
|
||||
/finals/student/{id}:
|
||||
$ref: './final_controller.yaml#/paths/~1finals~1student~1{id}'
|
||||
/finals/{id}:
|
||||
$ref: './final_controller.yaml#/paths/~1finals~1{id}'
|
||||
|
||||
/score-comments:
|
||||
$ref: './score_comment_controller.yaml#/paths/~1score-comments'
|
||||
/score-comments/student/{id}:
|
||||
$ref: './score_comment_controller.yaml#/paths/~1score-comments~1student~1{id}'
|
||||
/score-comments/{id}:
|
||||
$ref: './score_comment_controller.yaml#/paths/~1score-comments~1{id}'
|
||||
|
||||
/scores:
|
||||
$ref: './score_controller.yaml#/paths/~1scores'
|
||||
/scores/{id}:
|
||||
$ref: './score_controller.yaml#/paths/~1scores~1{id}'
|
||||
/scores/student/{id}:
|
||||
$ref: './score_controller.yaml#/paths/~1scores~1student~1{id}'
|
||||
/scores/recalculate:
|
||||
$ref: './score_controller.yaml#/paths/~1scores~1recalculate'
|
||||
|
||||
/messages:
|
||||
$ref: './message_controller.yaml#/paths/~1messages'
|
||||
/messages/{id}:
|
||||
$ref: './message_controller.yaml#/paths/~1messages~1{id}'
|
||||
|
||||
/notifications:
|
||||
$ref: './notification_controller.yaml#/paths/~1notifications'
|
||||
/notifications/{id}:
|
||||
$ref: './notification_controller.yaml#/paths/~1notifications~1{id}'
|
||||
/notifications/{id}/read:
|
||||
$ref: './notification_controller.yaml#/paths/~1notifications~1{id}~1read'
|
||||
|
||||
/extra-charges:
|
||||
$ref: './extra_charges_controller.yaml#/paths/~1extra-charges'
|
||||
/extra-charges/{id}:
|
||||
$ref: './extra_charges_controller.yaml#/paths/~1extra-charges~1{id}'
|
||||
/extra-charges/{id}/apply:
|
||||
$ref: './extra_charges_controller.yaml#/paths/~1extra-charges~1{id}~1apply'
|
||||
/extra-charges/parents:
|
||||
$ref: './extra_charges_controller.yaml#/paths/~1extra-charges~1parents'
|
||||
|
||||
/discounts:
|
||||
$ref: './discount_controller.yaml#/paths/~1discounts'
|
||||
/discounts/code/{code}:
|
||||
$ref: './discount_controller.yaml#/paths/~1discounts~1code~1{code}'
|
||||
/discounts/apply:
|
||||
$ref: './discount_controller.yaml#/paths/~1discounts~1apply'
|
||||
|
||||
# Teacher API
|
||||
/teachers:
|
||||
$ref: './teacher_controller.yaml#/paths/~1teachers'
|
||||
/teachers/{id}:
|
||||
$ref: './teacher_controller.yaml#/paths/~1teachers~1{id}'
|
||||
/teachers/{id}/classes:
|
||||
$ref: './teacher_controller.yaml#/paths/~1teachers~1{id}~1classes'
|
||||
|
||||
# Staff API
|
||||
/staff:
|
||||
$ref: './staff_controller.yaml#/paths/~1staff'
|
||||
/staff/{id}:
|
||||
$ref: './staff_controller.yaml#/paths/~1staff~1{id}'
|
||||
|
||||
# User API
|
||||
/profile:
|
||||
$ref: './user_controller.yaml#/paths/~1profile'
|
||||
|
||||
# Financial API
|
||||
/financial/report:
|
||||
$ref: './financial_controller.yaml#/paths/~1financial~1report'
|
||||
/financial/unpaid-parents:
|
||||
$ref: './financial_controller.yaml#/paths/~1financial~1unpaid-parents'
|
||||
|
||||
# Purchase Orders API
|
||||
/purchase-orders:
|
||||
$ref: './purchase_order_controller.yaml#/paths/~1purchase-orders'
|
||||
/purchase-orders/{id}:
|
||||
$ref: './purchase_order_controller.yaml#/paths/~1purchase-orders~1{id}'
|
||||
|
||||
# Late Slip Logs API
|
||||
/late-slip-logs:
|
||||
$ref: './late_slip_logs_controller.yaml#/paths/~1late-slip-logs'
|
||||
/late-slip-logs/{id}:
|
||||
$ref: './late_slip_logs_controller.yaml#/paths/~1late-slip-logs~1{id}'
|
||||
|
||||
# Homework Tracking API
|
||||
/homework-tracking:
|
||||
$ref: './homework_tracking_controller.yaml#/paths/~1homework-tracking'
|
||||
|
||||
/suppliers:
|
||||
$ref: './supplier_controller.yaml#/paths/~1suppliers'
|
||||
/suppliers/{id}:
|
||||
$ref: './supplier_controller.yaml#/paths/~1suppliers~1{id}'
|
||||
|
||||
# Parent API (referenced from parent controller spec)
|
||||
/parents:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents'
|
||||
/parents/{id}:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}'
|
||||
/parents/{id}/profile:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1profile'
|
||||
/parents/{id}/students:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1students'
|
||||
/parents/{id}/students/{studentId}:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1students~1{studentId}'
|
||||
/parents/{id}/attendance:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1attendance'
|
||||
/parents/{id}/payments:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1payments'
|
||||
/parents/{id}/enrollments:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1enrollments'
|
||||
/parents/{id}/enroll-classes:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1enroll-classes'
|
||||
/parents/{id}/emergency-contacts:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1emergency-contacts'
|
||||
/parents/{id}/authorized-users:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1authorized-users'
|
||||
/parents/{id}/events:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1events'
|
||||
/parents/{id}/events/update:
|
||||
$ref: '../openapi_parent_controller.yaml#/paths/~1parents~1{id}~1events~1update'
|
||||
|
||||
/families:
|
||||
$ref: './family_controller.yaml#/paths/~1families'
|
||||
/families/{id}:
|
||||
$ref: './family_controller.yaml#/paths/~1families~1{id}'
|
||||
/families/student/{id}:
|
||||
$ref: './family_controller.yaml#/paths/~1families~1student~1{id}'
|
||||
/families/{id}/guardians:
|
||||
$ref: './family_controller.yaml#/paths/~1families~1{id}~1guardians'
|
||||
|
||||
/emergency-contacts:
|
||||
$ref: './emergency_contact_controller.yaml#/paths/~1emergency-contacts'
|
||||
/emergency-contacts/{id}:
|
||||
$ref: './emergency_contact_controller.yaml#/paths/~1emergency-contacts~1{id}'
|
||||
/emergency-contacts/parent/{id}:
|
||||
$ref: './emergency_contact_controller.yaml#/paths/~1emergency-contacts~1parent~1{id}'
|
||||
|
||||
# Administrator API (referenced from administrator controller spec)
|
||||
/administrator/dashboard:
|
||||
$ref: '../openapi_administrator_controller.yaml#/paths/~1administrator~1dashboard'
|
||||
/administrator/absence:
|
||||
$ref: '../openapi_administrator_controller.yaml#/paths/~1administrator~1absence'
|
||||
/administrator/search:
|
||||
$ref: '../openapi_administrator_controller.yaml#/paths/~1administrator~1search'
|
||||
/administrator/enrollment-withdrawal/data:
|
||||
$ref: '../openapi_administrator_controller.yaml#/paths/~1administrator~1enrollment-withdrawal~1data'
|
||||
/administrator/enrollment-withdrawal/update:
|
||||
$ref: '../openapi_administrator_controller.yaml#/paths/~1administrator~1enrollment-withdrawal~1update'
|
||||
/administrator/students:
|
||||
$ref: '../openapi_administrator_controller.yaml#/paths/~1administrator~1students'
|
||||
/administrator/parents:
|
||||
$ref: '../openapi_administrator_controller.yaml#/paths/~1administrator~1parents'
|
||||
|
||||
/score-predictor/report:
|
||||
$ref: './score_predictor_controller.yaml#/paths/~1score-predictor~1report'
|
||||
|
||||
/roles:
|
||||
$ref: './role_permission_controller.yaml#/paths/~1roles'
|
||||
/roles/{id}:
|
||||
$ref: './role_permission_controller.yaml#/paths/~1roles~1{id}'
|
||||
/roles/{id}/permissions:
|
||||
$ref: './role_permission_controller.yaml#/paths/~1roles~1{id}~1permissions'
|
||||
/permissions:
|
||||
$ref: './role_permission_controller.yaml#/paths/~1permissions'
|
||||
/users:
|
||||
$ref: './role_permission_controller.yaml#/paths/~1users'
|
||||
/admins:
|
||||
$ref: './role_permission_controller.yaml#/paths/~1admins'
|
||||
/users/{id}/roles:
|
||||
$ref: './role_permission_controller.yaml#/paths/~1users~1{id}~1roles'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
bearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
@@ -0,0 +1,57 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Message API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Messages } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/messages:
|
||||
get:
|
||||
tags: [Messages]
|
||||
summary: List user messages
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: type
|
||||
schema: { type: string, enum: [sent, received] }
|
||||
- in: query
|
||||
name: read
|
||||
schema: { type: boolean }
|
||||
responses:
|
||||
"200": { description: Messages retrieved }
|
||||
post:
|
||||
tags: [Messages]
|
||||
summary: Send a new message
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [to, subject, body]
|
||||
properties:
|
||||
to: { type: integer, description: Recipient user ID }
|
||||
subject: { type: string }
|
||||
body: { type: string }
|
||||
priority: { type: string, enum: [low, normal, high], default: normal }
|
||||
responses:
|
||||
"201": { description: Message sent }
|
||||
|
||||
/messages/{id}:
|
||||
get:
|
||||
tags: [Messages]
|
||||
summary: Get message by ID (auto-marks read if recipient)
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Message retrieved }
|
||||
"404": { description: Not found }
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Midterm API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Midterms } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/midterms:
|
||||
post:
|
||||
tags: [Midterms]
|
||||
summary: Create or update midterm score
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [student_id, class_section_id]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"201": { description: Midterm saved }
|
||||
|
||||
/midterms/student/{id}:
|
||||
get:
|
||||
tags: [Midterms]
|
||||
summary: Get midterm by student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Midterm }
|
||||
|
||||
/midterms/{id}:
|
||||
put:
|
||||
tags: [Midterms]
|
||||
summary: Update midterm row
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"200": { description: Midterm updated }
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Notification API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Notifications } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/notifications:
|
||||
get:
|
||||
tags: [Notifications]
|
||||
summary: List notifications for current user
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: read
|
||||
schema: { type: boolean }
|
||||
responses:
|
||||
"200": { description: Notifications retrieved }
|
||||
|
||||
/notifications/{id}:
|
||||
get:
|
||||
tags: [Notifications]
|
||||
summary: Get a single notification
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Notification }
|
||||
"404": { description: Not found }
|
||||
|
||||
/notifications/{id}/read:
|
||||
post:
|
||||
tags: [Notifications]
|
||||
summary: Mark a notification as read
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Notification marked as read }
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Payment API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Payments } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/payments:
|
||||
get:
|
||||
tags: [Payments]
|
||||
summary: List payments
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: parent_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: status
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Payments retrieved }
|
||||
post:
|
||||
tags: [Payments]
|
||||
summary: Create payment
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [parent_id, invoice_id, total_amount, payment_method, payment_date]
|
||||
properties:
|
||||
parent_id: { type: integer }
|
||||
invoice_id: { type: integer }
|
||||
total_amount: { type: number }
|
||||
paid_amount: { type: number }
|
||||
balance: { type: number }
|
||||
number_of_installments: { type: integer }
|
||||
payment_method: { type: string }
|
||||
payment_date: { type: string, format: date }
|
||||
check_number: { type: string }
|
||||
status: { type: string }
|
||||
responses:
|
||||
"201": { description: Payment created }
|
||||
|
||||
/payments/{id}:
|
||||
get:
|
||||
tags: [Payments]
|
||||
summary: Get payment by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Payment }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Payments]
|
||||
summary: Update payment
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
paid_amount: { type: number }
|
||||
balance: { type: number }
|
||||
status: { type: string }
|
||||
payment_method: { type: string }
|
||||
payment_date: { type: string, format: date }
|
||||
check_number: { type: string }
|
||||
responses:
|
||||
"200": { description: Payment updated }
|
||||
delete:
|
||||
tags: [Payments]
|
||||
summary: Delete payment
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Payment deleted }
|
||||
|
||||
/payments/parent/{id}:
|
||||
get:
|
||||
tags: [Payments]
|
||||
summary: List payments by parent
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Parent payments list }
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Project API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Projects } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/projects:
|
||||
get:
|
||||
tags: [Projects]
|
||||
summary: List projects
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: student_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: class_section_id
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Projects retrieved }
|
||||
post:
|
||||
tags: [Projects]
|
||||
summary: Create project row
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [student_id, class_section_id, project_index]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
project_index: { type: integer }
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"201": { description: Project created }
|
||||
|
||||
/projects/{id}:
|
||||
get:
|
||||
tags: [Projects]
|
||||
summary: Get project by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Project }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Projects]
|
||||
summary: Update project row
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
project_index: { type: integer }
|
||||
responses:
|
||||
"200": { description: Project updated }
|
||||
|
||||
/projects/student/{id}:
|
||||
get:
|
||||
tags: [Projects]
|
||||
summary: Get projects by student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Student projects list }
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Purchase Order API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Purchase Orders } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/purchase-orders:
|
||||
get:
|
||||
tags: [Purchase Orders]
|
||||
summary: List purchase orders
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: q
|
||||
schema: { type: string, description: 'Search by PO number or supplier name' }
|
||||
responses:
|
||||
"200": { description: Purchase orders retrieved }
|
||||
post:
|
||||
tags: [Purchase Orders]
|
||||
summary: Create a purchase order with items
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [po_number, supplier_id, order_date, items]
|
||||
properties:
|
||||
po_number: { type: string }
|
||||
supplier_id: { type: integer }
|
||||
order_date: { type: string, format: date }
|
||||
expected_date: { type: string, format: date }
|
||||
status: { type: string, example: ordered }
|
||||
tax: { type: number, example: 0 }
|
||||
notes: { type: string }
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
supply_id: { type: integer, nullable: true }
|
||||
description: { type: string }
|
||||
quantity: { type: integer }
|
||||
unit_cost: { type: number }
|
||||
responses:
|
||||
"201": { description: Purchase order created }
|
||||
|
||||
/purchase-orders/{id}:
|
||||
get:
|
||||
tags: [Purchase Orders]
|
||||
summary: Get purchase order by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Purchase order with items }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Purchase Orders]
|
||||
summary: Update purchase order status or dates
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
expected_date: { type: string, format: date }
|
||||
notes: { type: string }
|
||||
responses:
|
||||
"200": { description: Purchase order updated }
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Quiz API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Quizzes } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/quizzes:
|
||||
get:
|
||||
tags: [Quizzes]
|
||||
summary: List quizzes
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: student_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: class_section_id
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Quizzes retrieved }
|
||||
post:
|
||||
tags: [Quizzes]
|
||||
summary: Create quiz row
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [student_id, class_section_id, quiz_index]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
quiz_index: { type: integer }
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"201": { description: Quiz created }
|
||||
|
||||
/quizzes/{id}:
|
||||
get:
|
||||
tags: [Quizzes]
|
||||
summary: Get quiz by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Quiz }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Quizzes]
|
||||
summary: Update quiz row
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
score: { type: number }
|
||||
comment: { type: string }
|
||||
quiz_index: { type: integer }
|
||||
responses:
|
||||
"200": { description: Quiz updated }
|
||||
|
||||
/quizzes/student/{id}:
|
||||
get:
|
||||
tags: [Quizzes]
|
||||
summary: Get quizzes by student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Student quizzes list }
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Roles & Permissions API - Al Rahma Sunday School
|
||||
version: 1.0.0
|
||||
description: Manage roles, permissions, and user assignments.
|
||||
servers:
|
||||
- url: https://your-domain.com/api/v1
|
||||
security:
|
||||
- bearerAuth: []
|
||||
tags:
|
||||
- name: Roles
|
||||
description: Role definitions and assignments
|
||||
- name: Permissions
|
||||
description: Permission catalog and lookups
|
||||
- name: Users
|
||||
description: User search and role assignment helpers
|
||||
|
||||
paths:
|
||||
/roles:
|
||||
get:
|
||||
tags: [Roles]
|
||||
summary: List all roles
|
||||
responses:
|
||||
"200":
|
||||
description: Roles list
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RolesResponse'
|
||||
|
||||
/roles/{id}:
|
||||
get:
|
||||
tags: [Roles]
|
||||
summary: Get role by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Single role
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RoleResponse'
|
||||
"404":
|
||||
description: Not found
|
||||
|
||||
/roles/{id}/permissions:
|
||||
get:
|
||||
tags: [Permissions]
|
||||
summary: Permissions assigned to a role
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Role permissions
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PermissionsResponse'
|
||||
|
||||
/permissions:
|
||||
get:
|
||||
tags: [Permissions]
|
||||
summary: List all permissions
|
||||
responses:
|
||||
"200":
|
||||
description: Permissions catalog
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PermissionsResponse'
|
||||
|
||||
/users:
|
||||
get:
|
||||
tags: [Users]
|
||||
summary: List user summaries
|
||||
parameters:
|
||||
- in: query
|
||||
name: q
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200":
|
||||
description: Users for assignment select lists
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UsersResponse'
|
||||
|
||||
/admins:
|
||||
get:
|
||||
tags: [Users]
|
||||
summary: List admin users
|
||||
responses:
|
||||
"200":
|
||||
description: Admins list
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UsersResponse'
|
||||
|
||||
/users/{id}/roles:
|
||||
post:
|
||||
tags: [Users]
|
||||
summary: Assign roles to a user
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AssignRolesRequest'
|
||||
responses:
|
||||
"200":
|
||||
description: Roles assigned
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
Role:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
name: { type: string }
|
||||
description: { type: string, nullable: true }
|
||||
|
||||
Permission:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
name: { type: string }
|
||||
description: { type: string, nullable: true }
|
||||
|
||||
UserSummary:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
email: { type: string }
|
||||
|
||||
RolesResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Role'
|
||||
|
||||
RoleResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
$ref: '#/components/schemas/Role'
|
||||
|
||||
PermissionsResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Permission'
|
||||
|
||||
UsersResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/UserSummary'
|
||||
|
||||
AssignRolesRequest:
|
||||
type: object
|
||||
required: [role_ids]
|
||||
properties:
|
||||
role_ids:
|
||||
type: array
|
||||
items: { type: integer }
|
||||
|
||||
BasicSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data: {}
|
||||
@@ -0,0 +1,68 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Score Comment API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Score Comments } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/score-comments:
|
||||
post:
|
||||
tags: [Score Comments]
|
||||
summary: Save comments for students
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [comments, subject_id]
|
||||
properties:
|
||||
subject_id: { type: integer }
|
||||
comments:
|
||||
type: object
|
||||
description: student_id -> { score_type -> comment }
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties: { type: string }
|
||||
responses:
|
||||
"200": { description: Comments saved }
|
||||
|
||||
/score-comments/student/{id}:
|
||||
get:
|
||||
tags: [Score Comments]
|
||||
summary: Get comments by student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: subject_id
|
||||
schema: { type: integer }
|
||||
- in: query
|
||||
name: score_type
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Comments list }
|
||||
|
||||
/score-comments/{id}:
|
||||
put:
|
||||
tags: [Score Comments]
|
||||
summary: Update a single comment
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [comment]
|
||||
properties:
|
||||
comment: { type: string }
|
||||
responses:
|
||||
"200": { description: Comment updated }
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Semester Score API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Scores } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/scores:
|
||||
get:
|
||||
tags: [Scores]
|
||||
summary: List semester scores
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: class_section_id
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Scores retrieved }
|
||||
post:
|
||||
tags: [Scores]
|
||||
summary: Create semester score row
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [student_id, class_section_id]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
homework_avg: { type: number }
|
||||
quiz_avg: { type: number }
|
||||
project_avg: { type: number }
|
||||
participation_avg: { type: number }
|
||||
midterm_score: { type: number }
|
||||
final_score: { type: number }
|
||||
semester_score: { type: number }
|
||||
responses:
|
||||
"201": { description: Score created }
|
||||
|
||||
/scores/{id}:
|
||||
put:
|
||||
tags: [Scores]
|
||||
summary: Update score row
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
homework_avg: { type: number }
|
||||
quiz_avg: { type: number }
|
||||
project_avg: { type: number }
|
||||
participation_avg: { type: number }
|
||||
midterm_score: { type: number }
|
||||
final_score: { type: number }
|
||||
semester_score: { type: number }
|
||||
responses:
|
||||
"200": { description: Score updated }
|
||||
|
||||
/scores/student/{id}:
|
||||
get:
|
||||
tags: [Scores]
|
||||
summary: Get scores by student
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Student scores list }
|
||||
|
||||
/scores/recalculate:
|
||||
post:
|
||||
tags: [Scores]
|
||||
summary: Recalculate scores for a class or explicit student list
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
class_section_id: { type: integer }
|
||||
semester: { type: string }
|
||||
school_year: { type: string }
|
||||
students:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required: [student_id, class_section_id]
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
school_id: { type: string }
|
||||
class_section_id: { type: integer }
|
||||
responses:
|
||||
"200": { description: Scores recalculated }
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Score Predictor API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Score Predictor } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/score-predictor/report:
|
||||
get:
|
||||
tags: [Score Predictor]
|
||||
summary: Get score prediction report for a year and optional class
|
||||
parameters:
|
||||
- in: query
|
||||
name: school_year
|
||||
schema: { type: string, example: "2024-2025" }
|
||||
- in: query
|
||||
name: class_section_id
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200":
|
||||
description: Prediction report
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
students:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
student_name: { type: string }
|
||||
fall_score: { type: number }
|
||||
spring_score: { type: number }
|
||||
probability_trophy: { type: number }
|
||||
probability_pass: { type: number }
|
||||
class_sections:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
class_section_name: { type: string }
|
||||
stats:
|
||||
type: object
|
||||
properties:
|
||||
mean: { type: number }
|
||||
std: { type: number }
|
||||
target_trophy: { type: number }
|
||||
target_pass: { type: number }
|
||||
school_year: { type: string }
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Staff API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Staff } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/staff:
|
||||
get:
|
||||
tags: [Staff]
|
||||
summary: List staff members
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
- in: query
|
||||
name: role
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200": { description: Staff retrieved }
|
||||
post:
|
||||
tags: [Staff]
|
||||
summary: Create staff member
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [user_id, active_role]
|
||||
properties:
|
||||
user_id: { type: integer }
|
||||
active_role: { type: string }
|
||||
notes: { type: string }
|
||||
responses:
|
||||
"201": { description: Staff created }
|
||||
|
||||
/staff/{id}:
|
||||
get:
|
||||
tags: [Staff]
|
||||
summary: Get staff member
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Staff member }
|
||||
"404": { description: Not found }
|
||||
put:
|
||||
tags: [Staff]
|
||||
summary: Update staff member
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
active_role: { type: string }
|
||||
notes: { type: string }
|
||||
status: { type: string }
|
||||
responses:
|
||||
"200": { description: Staff updated }
|
||||
delete:
|
||||
tags: [Staff]
|
||||
summary: Delete staff member
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Staff deleted }
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Supplier API - Al Rahma Sunday School
|
||||
version: 1.0.0
|
||||
description: >
|
||||
Endpoints for managing vendor and supplier records used by the school.
|
||||
servers:
|
||||
- url: https://your-domain.com/api/v1
|
||||
security:
|
||||
- bearerAuth: []
|
||||
tags:
|
||||
- name: Suppliers
|
||||
description: CRUD for supplier data
|
||||
|
||||
paths:
|
||||
/suppliers:
|
||||
get:
|
||||
tags: [Suppliers]
|
||||
summary: List suppliers
|
||||
parameters:
|
||||
- in: query
|
||||
name: q
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
responses:
|
||||
"200":
|
||||
description: Suppliers paginated list
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedSuppliersResponse'
|
||||
post:
|
||||
tags: [Suppliers]
|
||||
summary: Create a supplier
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SupplierRequest'
|
||||
responses:
|
||||
"201":
|
||||
description: Supplier created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SupplierResponse'
|
||||
|
||||
/suppliers/{id}:
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
get:
|
||||
tags: [Suppliers]
|
||||
summary: Get supplier details
|
||||
responses:
|
||||
"200":
|
||||
description: Supplier data
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SupplierResponse'
|
||||
"404":
|
||||
description: Not found
|
||||
put:
|
||||
tags: [Suppliers]
|
||||
summary: Update supplier
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SupplierRequest'
|
||||
responses:
|
||||
"200":
|
||||
description: Supplier updated
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SupplierResponse'
|
||||
delete:
|
||||
tags: [Suppliers]
|
||||
summary: Delete supplier
|
||||
responses:
|
||||
"200":
|
||||
description: Supplier deleted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
components:
|
||||
schemas:
|
||||
Supplier:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
name: { type: string }
|
||||
email: { type: string, nullable: true }
|
||||
phone: { type: string, nullable: true }
|
||||
address: { type: string, nullable: true }
|
||||
notes: { type: string, nullable: true }
|
||||
created_at: { type: string, format: date-time }
|
||||
updated_at: { type: string, format: date-time }
|
||||
|
||||
SupplierRequest:
|
||||
type: object
|
||||
required: [name]
|
||||
properties:
|
||||
name: { type: string }
|
||||
email: { type: string, nullable: true }
|
||||
phone: { type: string, nullable: true }
|
||||
address: { type: string, nullable: true }
|
||||
notes: { type: string, nullable: true }
|
||||
|
||||
PaginatedSuppliersResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Supplier'
|
||||
pagination:
|
||||
type: object
|
||||
properties:
|
||||
current_page: { type: integer }
|
||||
per_page: { type: integer }
|
||||
total: { type: integer }
|
||||
total_pages: { type: integer }
|
||||
|
||||
SupplierResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
$ref: '#/components/schemas/Supplier'
|
||||
|
||||
BasicSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data: {}
|
||||
@@ -0,0 +1,46 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: Teacher API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Teachers } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/teachers:
|
||||
get:
|
||||
tags: [Teachers]
|
||||
summary: List teachers
|
||||
parameters:
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: per_page
|
||||
schema: { type: integer, default: 20 }
|
||||
responses:
|
||||
"200": { description: Teachers retrieved }
|
||||
|
||||
/teachers/{id}:
|
||||
get:
|
||||
tags: [Teachers]
|
||||
summary: Get teacher by ID
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Teacher profile }
|
||||
"404": { description: Not found }
|
||||
|
||||
/teachers/{id}/classes:
|
||||
get:
|
||||
tags: [Teachers]
|
||||
summary: Get teacher class assignments
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
"200": { description: Class assignments }
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
openapi: 3.0.3
|
||||
info: { title: User API, version: 1.0.0 }
|
||||
servers: [ { url: https://your-domain.com/api/v1 } ]
|
||||
tags: [ { name: Users } ]
|
||||
security: [ { bearerAuth: [] } ]
|
||||
|
||||
paths:
|
||||
/profile:
|
||||
get:
|
||||
tags: [Users]
|
||||
summary: Get current user profile
|
||||
responses:
|
||||
"200": { description: Profile }
|
||||
"404": { description: Not found }
|
||||
post:
|
||||
tags: [Users]
|
||||
summary: Authenticate and return profile with JWT
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [email, password]
|
||||
properties:
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
example: parent@example.com
|
||||
password:
|
||||
type: string
|
||||
example: StrongPass123
|
||||
example:
|
||||
email: parent@example.com
|
||||
password: StrongPass123
|
||||
responses:
|
||||
"200":
|
||||
description: Login successful
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProfileAuthResponse'
|
||||
"400":
|
||||
description: Missing credentials
|
||||
"401":
|
||||
description: Invalid credentials
|
||||
put:
|
||||
tags: [Users]
|
||||
summary: Update current user profile
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
email: { type: string, format: email }
|
||||
password: { type: string, minLength: 8 }
|
||||
current_password: { type: string }
|
||||
cellphone: { type: string }
|
||||
address_street: { type: string }
|
||||
apt: { type: string }
|
||||
city: { type: string }
|
||||
state: { type: string }
|
||||
zip: { type: string }
|
||||
gender: { type: string }
|
||||
responses:
|
||||
"200": { description: Profile updated }
|
||||
|
||||
components:
|
||||
schemas:
|
||||
ProfileAuthRequest:
|
||||
type: object
|
||||
required: [email, password]
|
||||
properties:
|
||||
email: { type: string, format: email, example: parent@example.com }
|
||||
password: { type: string, example: StrongPass123 }
|
||||
ProfileAuthResponse:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: boolean
|
||||
example: true
|
||||
token:
|
||||
type: string
|
||||
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
|
||||
user:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, example: 17 }
|
||||
name: { type: string, example: "Jane Doe" }
|
||||
email: { type: string, format: email, example: parent@example.com }
|
||||
roles:
|
||||
type: object
|
||||
additionalProperties: { type: boolean }
|
||||
example: { parent: true }
|
||||
Reference in New Issue
Block a user