recreate project
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Al Rahma Sunday School API – Swagger UI</title>
|
||||
<link rel="stylesheet" href="swagger-ui/swagger-ui.css" />
|
||||
<link rel="stylesheet" href="swagger-ui/swagger-ui-custom.css" />
|
||||
<!-- Swagger UI assets are served locally to comply with CSP. -->
|
||||
<!-- Master spec is referenced at openapi/master.yaml (relative path). -->
|
||||
</head>
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
<script src="swagger-ui/swagger-ui-bundle.js"></script>
|
||||
<script src="swagger-ui/swagger-init.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 }
|
||||
@@ -0,0 +1,451 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Administrator API - Al Rahma Sunday School
|
||||
version: 1.0.0
|
||||
description: >
|
||||
REST API for administrator functionality. These endpoints mirror the admin view features
|
||||
but return JSON responses for API consumers.
|
||||
|
||||
All endpoints require JWT authentication using a Bearer token, unless otherwise noted.
|
||||
|
||||
Standard response format:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "success|error",
|
||||
"message": "string",
|
||||
"data": {}
|
||||
}
|
||||
```
|
||||
|
||||
servers:
|
||||
- url: https://alrahmaisgl.org/api/v1
|
||||
|
||||
security:
|
||||
- BearerAuth: []
|
||||
|
||||
tags:
|
||||
- name: Admin Dashboard
|
||||
description: Summary metrics for admins
|
||||
- name: Absence
|
||||
description: Admin absence/time-off self-service
|
||||
- name: Search
|
||||
description: Tokenized search across users, students, parents, staff and emergency contacts
|
||||
- name: Enrollment
|
||||
description: Enrollment/withdrawal data and status updates
|
||||
- name: Profiles
|
||||
description: Aggregate student and parent profiles for administrator views
|
||||
|
||||
paths:
|
||||
/administrator/dashboard:
|
||||
get:
|
||||
tags: [Admin Dashboard]
|
||||
summary: Get dashboard metrics
|
||||
security:
|
||||
- BearerAuth: []
|
||||
responses:
|
||||
200:
|
||||
description: Metrics retrieved
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AdminDashboardResponse'
|
||||
401:
|
||||
description: Unauthorized
|
||||
|
||||
/administrator/absence:
|
||||
get:
|
||||
tags: [Absence]
|
||||
summary: Get admin absence info and allowed dates
|
||||
security:
|
||||
- BearerAuth: []
|
||||
responses:
|
||||
200:
|
||||
description: Absence info
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AbsenceInfoResponse'
|
||||
post:
|
||||
tags: [Absence]
|
||||
summary: Submit absence days for current admin
|
||||
security:
|
||||
- BearerAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SubmitAbsenceRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Absence saved
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SubmitAbsenceResponse'
|
||||
422:
|
||||
description: Validation error
|
||||
|
||||
/administrator/search:
|
||||
get:
|
||||
tags: [Search]
|
||||
summary: Tokenized search across entities
|
||||
description: >
|
||||
Splits the query into tokens and matches them across multiple columns; phone-like tokens
|
||||
also match common US formats.
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: q
|
||||
in: query
|
||||
required: true
|
||||
schema: { type: string, example: "ahmed 4105551234" }
|
||||
responses:
|
||||
200:
|
||||
description: Search results
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SearchResponse'
|
||||
|
||||
/administrator/enrollment-withdrawal/data:
|
||||
get:
|
||||
tags: [Enrollment]
|
||||
summary: Data for the Enrollment/Withdrawal admin page
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: schoolYear
|
||||
in: query
|
||||
schema: { type: string, example: "2024-2025" }
|
||||
responses:
|
||||
200:
|
||||
description: Data payload for UI
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EnrollmentWithdrawalDataResponse'
|
||||
|
||||
/administrator/enrollment-withdrawal/update:
|
||||
post:
|
||||
tags: [Enrollment]
|
||||
summary: Batch update enrollment statuses
|
||||
description: >
|
||||
Updates students' enrollment statuses and computes refunds when applicable.
|
||||
security:
|
||||
- BearerAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateEnrollmentStatusesRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Update results
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateEnrollmentStatusesResponse'
|
||||
422:
|
||||
description: Validation error
|
||||
|
||||
/administrator/students:
|
||||
get:
|
||||
tags: [Profiles]
|
||||
summary: Aggregated student profiles
|
||||
security:
|
||||
- BearerAuth: []
|
||||
responses:
|
||||
200:
|
||||
description: Student profiles
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/StudentProfilesResponse'
|
||||
|
||||
/administrator/parents:
|
||||
get:
|
||||
tags: [Profiles]
|
||||
summary: Parent profiles with recent invoice balances
|
||||
security:
|
||||
- BearerAuth: []
|
||||
responses:
|
||||
200:
|
||||
description: Parent profiles
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ParentProfilesResponse'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
description: >
|
||||
Include your token in the Authorization header.
|
||||
Example:
|
||||
```
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...
|
||||
```
|
||||
|
||||
schemas:
|
||||
BasicSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data: { nullable: true }
|
||||
|
||||
AdminDashboardResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
counts:
|
||||
type: object
|
||||
properties:
|
||||
students: { type: integer, example: 240 }
|
||||
teachers: { type: integer, example: 36 }
|
||||
teacherAssistants: { type: integer, example: 12 }
|
||||
admins: { type: integer, example: 5 }
|
||||
parents: { type: integer, example: 180 }
|
||||
recentActivities:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
login_time: { type: string, format: date-time }
|
||||
email: { type: string, format: email }
|
||||
meta:
|
||||
type: object
|
||||
properties:
|
||||
schoolYear: { type: string, example: "2024-2025" }
|
||||
semester: { type: string, example: "Fall" }
|
||||
|
||||
AbsenceInfoResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
admin_name: { type: string }
|
||||
semester: { type: string }
|
||||
school_year: { type: string }
|
||||
existing:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
user_id: { type: integer }
|
||||
date: { type: string, format: date }
|
||||
status: { type: string, enum: [present, absent, late] }
|
||||
reason: { type: string, nullable: true }
|
||||
semester: { type: string }
|
||||
school_year: { type: string }
|
||||
available_dates:
|
||||
type: array
|
||||
items: { type: string, format: date }
|
||||
|
||||
SubmitAbsenceRequest:
|
||||
type: object
|
||||
required: [dates, reason]
|
||||
properties:
|
||||
dates:
|
||||
type: array
|
||||
items: { type: string, format: date }
|
||||
example: ["2025-09-14", "2025-10-05"]
|
||||
reason_type:
|
||||
type: string
|
||||
example: vacation
|
||||
reason:
|
||||
type: string
|
||||
example: Visiting family
|
||||
|
||||
SubmitAbsenceResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
saved: { type: integer, example: 2 }
|
||||
invalid:
|
||||
type: array
|
||||
items: { type: string, format: date }
|
||||
saved_dates:
|
||||
type: array
|
||||
items: { type: string, format: date }
|
||||
|
||||
SearchResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
users:
|
||||
type: array
|
||||
items: { type: object, additionalProperties: true }
|
||||
students:
|
||||
type: array
|
||||
items: { type: object, additionalProperties: true }
|
||||
parents:
|
||||
type: array
|
||||
items: { type: object, additionalProperties: true }
|
||||
staff:
|
||||
type: array
|
||||
items: { type: object, additionalProperties: true }
|
||||
emergency_contacts:
|
||||
type: array
|
||||
items: { type: object, additionalProperties: true }
|
||||
total: { type: integer }
|
||||
|
||||
EnrollmentWithdrawalDataResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
students:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
properties:
|
||||
id: { type: integer }
|
||||
student_id: { type: integer }
|
||||
parent_id: { type: integer }
|
||||
parent_label: { type: string }
|
||||
enrollment_status: { type: string }
|
||||
class_section: { type: string }
|
||||
is_new: { type: integer, example: 0 }
|
||||
new_student: { type: string, example: "No" }
|
||||
registration_date_order: { type: string, example: "2025-09-01" }
|
||||
classes:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
class_section_name: { type: string }
|
||||
school_year: { type: string, nullable: true }
|
||||
semester: { type: string, nullable: true }
|
||||
semester: { type: string }
|
||||
school_year: { type: string }
|
||||
schoolYears:
|
||||
type: array
|
||||
items: { type: string }
|
||||
|
||||
UpdateEnrollmentStatusesRequest:
|
||||
type: object
|
||||
required: [enrollment_status]
|
||||
properties:
|
||||
enrollment_status:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
enum: [
|
||||
"admission under review",
|
||||
"payment pending",
|
||||
"enrolled",
|
||||
"withdraw under review",
|
||||
"refund pending",
|
||||
"withdrawn",
|
||||
"denied",
|
||||
"waitlist"
|
||||
]
|
||||
example:
|
||||
"101": "payment pending"
|
||||
"102": "enrolled"
|
||||
|
||||
UpdateEnrollmentStatusesResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
errors:
|
||||
type: array
|
||||
items: { type: string }
|
||||
groupsByParentStatus:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
student_name: { type: string }
|
||||
|
||||
StudentProfilesResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
students:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
properties:
|
||||
id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
parent_firstname: { type: string }
|
||||
parent_lastname: { type: string }
|
||||
parent_email: { type: string, format: email }
|
||||
parent_phone: { type: string }
|
||||
emergency_name: { type: string, nullable: true }
|
||||
emergency_relationship: { type: string, nullable: true }
|
||||
emergency_phone: { type: string, nullable: true }
|
||||
allergies: { type: string, nullable: true }
|
||||
medical_conditions: { type: string, nullable: true }
|
||||
class_section_name: { type: string }
|
||||
|
||||
ParentProfilesResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
parents:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
school_id: { type: string }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
email: { type: string, format: email }
|
||||
cellphone: { type: string }
|
||||
gender: { type: string, nullable: true }
|
||||
created_at: { type: string, format: date-time }
|
||||
school_year: { type: string }
|
||||
paid_amount: { type: number }
|
||||
balance: { type: number }
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Inventory API - Al Rahma Sunday School
|
||||
version: 1.0.0
|
||||
description: Manage inventory items and movements.
|
||||
servers:
|
||||
- url: https://alrahmaisgl.org/api/v1
|
||||
security:
|
||||
- BearerAuth: []
|
||||
tags:
|
||||
- name: Inventory
|
||||
description: Items and movements
|
||||
|
||||
paths:
|
||||
/inventory:
|
||||
get:
|
||||
tags: [Inventory]
|
||||
summary: List inventory items
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema: { type: integer, example: 1 }
|
||||
- name: per_page
|
||||
in: query
|
||||
schema: { type: integer, example: 20 }
|
||||
- name: type
|
||||
in: query
|
||||
schema: { type: string, enum: [classroom, book, office, kitchen] }
|
||||
- name: school_year
|
||||
in: query
|
||||
schema: { type: string }
|
||||
- name: semester
|
||||
in: query
|
||||
schema: { type: string }
|
||||
responses:
|
||||
200:
|
||||
description: Paginated items
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedInventoryResponse'
|
||||
post:
|
||||
tags: [Inventory]
|
||||
summary: Create inventory item
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateInventoryItemRequest'
|
||||
responses:
|
||||
201:
|
||||
description: Inventory item created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InventoryItemResponse'
|
||||
|
||||
/inventory/{id}:
|
||||
get:
|
||||
tags: [Inventory]
|
||||
summary: Get inventory item
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Item
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InventoryItemResponse'
|
||||
404: { description: Not found }
|
||||
put:
|
||||
tags: [Inventory]
|
||||
summary: Update inventory item
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateInventoryItemRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Updated item
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InventoryItemResponse'
|
||||
delete:
|
||||
tags: [Inventory]
|
||||
summary: Delete inventory item
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Deleted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
/inventory/movements:
|
||||
get:
|
||||
tags: [Inventory]
|
||||
summary: List inventory movements
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema: { type: integer, example: 1 }
|
||||
- name: per_page
|
||||
in: query
|
||||
schema: { type: integer, example: 20 }
|
||||
- name: item_id
|
||||
in: query
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Paginated movements
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedMovementsResponse'
|
||||
post:
|
||||
tags: [Inventory]
|
||||
summary: Create inventory movement (adjust quantity)
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [item_id, qty_change, movement_type]
|
||||
properties:
|
||||
item_id: { type: integer }
|
||||
qty_change: { type: integer, description: "positive for add, negative for remove" }
|
||||
movement_type: { type: string, enum: [issue, return, purchase, adjustment, correction] }
|
||||
reason: { type: string }
|
||||
note: { type: string }
|
||||
teacher_id: { type: integer }
|
||||
student_id: { type: integer }
|
||||
class_section_id: { type: integer }
|
||||
responses:
|
||||
201:
|
||||
description: Movement created and item quantity updated
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
movement: { $ref: '#/components/schemas/Movement' }
|
||||
item: { $ref: '#/components/schemas/InventoryItem' }
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
|
||||
schemas:
|
||||
BasicSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data: {}
|
||||
|
||||
InventoryItem:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
name: { type: string }
|
||||
type: { type: string }
|
||||
category_id: { type: integer, nullable: true }
|
||||
quantity: { type: integer }
|
||||
good_qty: { type: integer }
|
||||
condition: { type: string }
|
||||
notes: { type: string, nullable: true }
|
||||
school_year: { type: string }
|
||||
semester: { type: string }
|
||||
|
||||
Movement:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
item_id: { type: integer }
|
||||
change: { type: integer }
|
||||
reason: { type: string }
|
||||
created_at: { type: string, format: date-time }
|
||||
|
||||
PaginatedInventoryResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items: { $ref: '#/components/schemas/InventoryItem' }
|
||||
pagination:
|
||||
type: object
|
||||
properties:
|
||||
current_page: { type: integer }
|
||||
per_page: { type: integer }
|
||||
total: { type: integer }
|
||||
total_pages: { type: integer }
|
||||
categories:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
name: { type: string }
|
||||
|
||||
PaginatedMovementsResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items: { $ref: '#/components/schemas/Movement' }
|
||||
pagination:
|
||||
type: object
|
||||
properties:
|
||||
current_page: { type: integer }
|
||||
per_page: { type: integer }
|
||||
total: { type: integer }
|
||||
total_pages: { type: integer }
|
||||
|
||||
InventoryItemResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data: { $ref: '#/components/schemas/InventoryItem' }
|
||||
|
||||
CreateInventoryItemRequest:
|
||||
type: object
|
||||
required: [name, type]
|
||||
properties:
|
||||
name: { type: string }
|
||||
type: { type: string, enum: [classroom, book, office, kitchen] }
|
||||
category_id: { type: integer, nullable: true }
|
||||
quantity: { type: integer, example: 0 }
|
||||
good_qty: { type: integer, example: 0 }
|
||||
condition: { type: string, example: good }
|
||||
school_year: { type: string }
|
||||
semester: { type: string }
|
||||
|
||||
UpdateInventoryItemRequest:
|
||||
type: object
|
||||
properties:
|
||||
name: { type: string }
|
||||
category_id: { type: integer }
|
||||
quantity: { type: integer }
|
||||
good_qty: { type: integer }
|
||||
condition: { type: string }
|
||||
notes: { type: string }
|
||||
@@ -0,0 +1,839 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Parent API - Al Rahma Sunday School
|
||||
version: 1.1.0
|
||||
description: >
|
||||
REST API for parent-related functionality in the Al Rahma Sunday School system.
|
||||
All endpoints require JWT authentication using a Bearer token, unless otherwise noted.
|
||||
Each response follows the standard format:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "success|error",
|
||||
"message": "string",
|
||||
"data": {}
|
||||
}
|
||||
```
|
||||
|
||||
servers:
|
||||
- url: https://alrahmaisgl.org/api/v1
|
||||
|
||||
security:
|
||||
- BearerAuth: []
|
||||
|
||||
tags:
|
||||
- name: Parents
|
||||
description: Manage parent profiles and accounts
|
||||
- name: Students
|
||||
description: Access and manage parent’s student data
|
||||
- name: Attendance
|
||||
description: View attendance history for a parent's children
|
||||
- name: Enrollment
|
||||
description: Manage enrollments and student registration
|
||||
- name: Payments
|
||||
description: Retrieve invoices and payment details
|
||||
- name: Events
|
||||
description: Manage student participation in school events
|
||||
|
||||
paths:
|
||||
/parents:
|
||||
get:
|
||||
tags: [Parents]
|
||||
summary: List all parents (admin use)
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema: { type: integer, example: 1 }
|
||||
- name: per_page
|
||||
in: query
|
||||
schema: { type: integer, example: 20 }
|
||||
responses:
|
||||
200:
|
||||
description: Paginated list of parents
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedParentsResponse'
|
||||
401:
|
||||
description: Unauthorized
|
||||
|
||||
/parents/{id}:
|
||||
get:
|
||||
tags: [Parents]
|
||||
summary: Get parent details by ID
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Parent details
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Parent'
|
||||
404:
|
||||
description: Parent not found
|
||||
401:
|
||||
description: Unauthorized
|
||||
|
||||
/parents/{id}/profile:
|
||||
get:
|
||||
tags: [Parents]
|
||||
summary: Get parent profile
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Parent profile details
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Parent'
|
||||
put:
|
||||
tags: [Parents]
|
||||
summary: Update parent profile
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ParentUpdateRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Profile updated successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
/parents/{id}/students:
|
||||
get:
|
||||
tags: [Students]
|
||||
summary: Get all students for a parent
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Student list with details
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/StudentsResponse'
|
||||
post:
|
||||
tags: [Students]
|
||||
summary: Register a new student for this parent
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateStudentRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Student created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
/parents/{id}/students/{studentId}:
|
||||
put:
|
||||
tags: [Students]
|
||||
summary: Update a student's info
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
- name: studentId
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateStudentRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Student updated
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
delete:
|
||||
tags: [Students]
|
||||
summary: Delete a student
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
- name: studentId
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Student deleted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
/parents/{id}/attendance:
|
||||
get:
|
||||
tags: [Attendance]
|
||||
summary: Get student attendance records
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
- name: school_year
|
||||
in: query
|
||||
schema: { type: string, example: "2024-2025" }
|
||||
responses:
|
||||
200:
|
||||
description: Attendance records retrieved
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AttendanceList'
|
||||
examples:
|
||||
sample:
|
||||
value:
|
||||
status: success
|
||||
message: Attendance data retrieved successfully
|
||||
data:
|
||||
- firstname: Ali
|
||||
lastname: Ahmad
|
||||
date: "2024-10-06"
|
||||
status: present
|
||||
reason: null
|
||||
- firstname: Aisha
|
||||
lastname: Ahmad
|
||||
date: "2024-10-13"
|
||||
status: absent
|
||||
reason: Sick
|
||||
|
||||
/parents/{id}/payments:
|
||||
get:
|
||||
tags: [Payments]
|
||||
summary: Retrieve invoices/payments for parent
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Payment history
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InvoiceList'
|
||||
examples:
|
||||
sample:
|
||||
value:
|
||||
status: success
|
||||
message: Payments retrieved successfully
|
||||
data:
|
||||
- id: 101
|
||||
invoice_number: INV-2025-0001
|
||||
parent_id: 55
|
||||
amount: 550
|
||||
status: unpaid
|
||||
created_at: "2025-08-20 12:00:00"
|
||||
|
||||
/parents/{id}/enrollments:
|
||||
get:
|
||||
tags: [Enrollment]
|
||||
summary: Get enrollment data for parent’s students
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
- name: school_year
|
||||
in: query
|
||||
schema: { type: string, example: "2024-2025" }
|
||||
responses:
|
||||
200:
|
||||
description: Enrollment info
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EnrollmentResponse'
|
||||
|
||||
/parents/{id}/enroll-classes:
|
||||
get:
|
||||
tags: [Enrollment]
|
||||
summary: Get data for the enroll classes page
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
- name: school_year
|
||||
in: query
|
||||
schema: { type: string, example: "2024-2025" }
|
||||
responses:
|
||||
200:
|
||||
description: Enroll classes data
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ParentEnrollClassesData'
|
||||
post:
|
||||
tags: [Enrollment]
|
||||
summary: Update enrollments (enroll/withdraw)
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateParentEnrollmentsRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Enrollment updates processed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateParentEnrollmentsResponse'
|
||||
|
||||
/parents/{id}/emergency-contacts:
|
||||
get:
|
||||
tags: [Parents]
|
||||
summary: List emergency contacts for parent
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Emergency contacts
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EmergencyContactsList'
|
||||
post:
|
||||
tags: [Parents]
|
||||
summary: Create or update an emergency contact
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/SaveEmergencyContactRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Saved
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
/parents/{id}/authorized-users:
|
||||
get:
|
||||
tags: [Parents]
|
||||
summary: List authorized users (second parents/guardians)
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Authorized users
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AuthorizedUsersList'
|
||||
post:
|
||||
tags: [Parents]
|
||||
summary: Add an authorized user (pending)
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/AddAuthorizedUserRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
/parents/{id}/enroll:
|
||||
post:
|
||||
tags: [Enrollment]
|
||||
summary: Enroll one or more students
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
student_ids:
|
||||
type: array
|
||||
items: { type: integer }
|
||||
example: [5, 6]
|
||||
responses:
|
||||
200:
|
||||
description: Enrollment submitted successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
/parents/{id}/events:
|
||||
get:
|
||||
tags: [Events]
|
||||
summary: Get events and participation data
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Events and participation data
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/EventParticipationResponse'
|
||||
examples:
|
||||
sample:
|
||||
value:
|
||||
status: success
|
||||
message: Event participation data retrieved
|
||||
data:
|
||||
events:
|
||||
- id: 1
|
||||
name: Field Trip
|
||||
amount: 25
|
||||
start_date: "2025-10-20"
|
||||
end_date: "2025-10-20"
|
||||
charges:
|
||||
"12:1":
|
||||
student_id: 12
|
||||
event_id: 1
|
||||
participation: yes
|
||||
charged: 25
|
||||
date: "2025-09-30 10:00:00"
|
||||
|
||||
/parents/{id}/events/update:
|
||||
post:
|
||||
tags: [Events]
|
||||
summary: Update student event participation
|
||||
security:
|
||||
- BearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
participation:
|
||||
type: object
|
||||
example:
|
||||
"3:1": "yes"
|
||||
"3:2": "no"
|
||||
responses:
|
||||
200:
|
||||
description: Participation updated successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/BasicSuccess'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
description: >
|
||||
Enter your JSON Web Token here.
|
||||
Example:
|
||||
```
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...
|
||||
```
|
||||
|
||||
schemas:
|
||||
BasicSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string, example: "Operation completed successfully" }
|
||||
data: { nullable: true }
|
||||
|
||||
Parent:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
email: { type: string, format: email }
|
||||
cellphone: { type: string }
|
||||
address_street: { type: string }
|
||||
city: { type: string }
|
||||
state: { type: string }
|
||||
zip: { type: string }
|
||||
|
||||
ParentUpdateRequest:
|
||||
type: object
|
||||
properties:
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
cellphone: { type: string }
|
||||
address_street: { type: string }
|
||||
city: { type: string }
|
||||
state: { type: string }
|
||||
zip: { type: string }
|
||||
|
||||
PaginatedParentsResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
page: { type: integer }
|
||||
per_page: { type: integer }
|
||||
total: { type: integer }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Parent'
|
||||
|
||||
StudentsResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
gender: { type: string }
|
||||
dob: { type: string }
|
||||
current_class:
|
||||
type: object
|
||||
properties:
|
||||
class_name: { type: string }
|
||||
section_name: { type: string }
|
||||
medical_conditions:
|
||||
type: array
|
||||
items: { type: string }
|
||||
allergies:
|
||||
type: array
|
||||
items: { type: string }
|
||||
|
||||
AttendanceList:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
date: { type: string, format: date }
|
||||
status: { type: string, enum: [present, absent, late] }
|
||||
reason: { type: string, nullable: true }
|
||||
|
||||
InvoiceList:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
invoice_number: { type: string }
|
||||
parent_id: { type: integer }
|
||||
amount: { type: number }
|
||||
status: { type: string }
|
||||
created_at: { type: string }
|
||||
|
||||
EnrollmentResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
enrollment:
|
||||
type: object
|
||||
properties:
|
||||
enrollment_status: { type: string }
|
||||
admission_status: { type: string, nullable: true }
|
||||
|
||||
EventParticipationResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
events:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
name: { type: string }
|
||||
amount: { type: number }
|
||||
start_date: { type: string }
|
||||
end_date: { type: string }
|
||||
charges:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
properties:
|
||||
student_id: { type: integer }
|
||||
event_id: { type: integer }
|
||||
participation: { type: string, enum: [yes, no] }
|
||||
charged: { type: number }
|
||||
date: { type: string, format: date-time }
|
||||
|
||||
CreateStudentRequest:
|
||||
type: object
|
||||
properties:
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
dob: { type: string, format: date }
|
||||
age: { type: integer }
|
||||
gender: { type: string }
|
||||
registration_grade: { type: string }
|
||||
photo_consent: { type: integer, enum: [0,1] }
|
||||
rfid_tag: { type: string }
|
||||
is_new: { type: integer, enum: [0,1], default: 1 }
|
||||
|
||||
UpdateStudentRequest:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/CreateStudentRequest'
|
||||
|
||||
EmergencyContactsList:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
parent_id: { type: integer }
|
||||
emergency_contact_name: { type: string }
|
||||
cellphone: { type: string }
|
||||
email: { type: string }
|
||||
relation: { type: string }
|
||||
|
||||
SaveEmergencyContactRequest:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, nullable: true }
|
||||
emergency_contact_name: { type: string }
|
||||
cellphone: { type: string }
|
||||
email: { type: string, nullable: true }
|
||||
relation: { type: string, nullable: true }
|
||||
|
||||
AuthorizedUsersList:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
user_id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
email: { type: string }
|
||||
phone_number: { type: string }
|
||||
relation_to_user: { type: string }
|
||||
status: { type: string }
|
||||
|
||||
AddAuthorizedUserRequest:
|
||||
type: object
|
||||
required: [firstname, lastname, email, phone_number]
|
||||
properties:
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
email: { type: string }
|
||||
phone_number: { type: string }
|
||||
relation_to_user: { type: string }
|
||||
|
||||
ParentEnrollClassesData:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
students:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
firstname: { type: string }
|
||||
lastname: { type: string }
|
||||
class_section: { type: string }
|
||||
admission_status: { type: string, nullable: true }
|
||||
enrollment_status: { type: string }
|
||||
disable_enroll: { type: boolean }
|
||||
schoolYears:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
school_year: { type: string }
|
||||
selectedYear: { type: string }
|
||||
isEditable: { type: boolean }
|
||||
withdrawalDeadline: { type: string, format: date }
|
||||
lastDayOfRegistration: { type: string, format: date }
|
||||
schoolStartDate: { type: string, format: date }
|
||||
|
||||
UpdateParentEnrollmentsRequest:
|
||||
type: object
|
||||
properties:
|
||||
enroll:
|
||||
type: array
|
||||
items: { type: integer }
|
||||
example: [101, 102]
|
||||
withdraw:
|
||||
type: array
|
||||
items: { type: integer }
|
||||
example: [103]
|
||||
|
||||
UpdateParentEnrollmentsResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
enrolled:
|
||||
type: array
|
||||
items: { type: integer }
|
||||
withdrawn:
|
||||
type: array
|
||||
items: { type: integer }
|
||||
messages:
|
||||
type: array
|
||||
items: { type: string }
|
||||
@@ -0,0 +1,177 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Refund API - Al Rahma Sunday School
|
||||
version: 1.0.0
|
||||
description: Refund request and processing endpoints.
|
||||
servers:
|
||||
- url: https://alrahmaisgl.org/api/v1
|
||||
security:
|
||||
- BearerAuth: []
|
||||
tags:
|
||||
- name: Refunds
|
||||
description: Manage refund requests
|
||||
|
||||
paths:
|
||||
/refunds:
|
||||
get:
|
||||
tags: [Refunds]
|
||||
summary: List refunds
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema: { type: integer, example: 1 }
|
||||
- name: per_page
|
||||
in: query
|
||||
schema: { type: integer, example: 20 }
|
||||
- name: parent_id
|
||||
in: query
|
||||
schema: { type: integer }
|
||||
- name: status
|
||||
in: query
|
||||
schema: { type: string, example: pending }
|
||||
responses:
|
||||
200:
|
||||
description: Paginated refunds
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedRefundsResponse'
|
||||
post:
|
||||
tags: [Refunds]
|
||||
summary: Create refund request
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateRefundRequest'
|
||||
responses:
|
||||
201:
|
||||
description: Refund created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RefundResponse'
|
||||
|
||||
/refunds/{id}:
|
||||
get:
|
||||
tags: [Refunds]
|
||||
summary: Get refund by ID
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Refund
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RefundResponse'
|
||||
404:
|
||||
description: Not found
|
||||
put:
|
||||
tags: [Refunds]
|
||||
summary: Update refund
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateRefundRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Updated refund
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RefundResponse'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
|
||||
schemas:
|
||||
BasicSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data: {}
|
||||
|
||||
Refund:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
parent_id: { type: integer }
|
||||
invoice_id: { type: integer }
|
||||
refund_amount: { type: number }
|
||||
reason: { type: string }
|
||||
request: { type: string, nullable: true }
|
||||
status: { type: string, example: pending }
|
||||
requested_at: { type: string, format: date-time }
|
||||
approved_at: { type: string, format: date-time, nullable: true }
|
||||
refunded_at: { type: string, format: date-time, nullable: true }
|
||||
approved_by: { type: integer, nullable: true }
|
||||
refund_paid_amount: { type: number, nullable: true }
|
||||
refund_method: { type: string, nullable: true }
|
||||
check_nbr: { type: string, nullable: true }
|
||||
note: { type: string, nullable: true }
|
||||
school_year: { type: string }
|
||||
semester: { type: string }
|
||||
|
||||
PaginatedRefundsResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items: { $ref: '#/components/schemas/Refund' }
|
||||
pagination:
|
||||
type: object
|
||||
properties:
|
||||
current_page: { type: integer }
|
||||
per_page: { type: integer }
|
||||
total: { type: integer }
|
||||
total_pages: { type: integer }
|
||||
|
||||
RefundResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
$ref: '#/components/schemas/Refund'
|
||||
|
||||
CreateRefundRequest:
|
||||
type: object
|
||||
required: [parent_id, invoice_id, refund_amount, reason]
|
||||
properties:
|
||||
parent_id: { type: integer }
|
||||
invoice_id: { type: integer }
|
||||
refund_amount: { type: number }
|
||||
reason: { type: string }
|
||||
request: { type: string, nullable: true }
|
||||
|
||||
UpdateRefundRequest:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, enum: [pending, approved, refunded, rejected] }
|
||||
refund_paid_amount: { type: number }
|
||||
refund_method: { type: string }
|
||||
check_nbr: { type: string }
|
||||
note: { type: string }
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Reimbursement API - Al Rahma Sunday School
|
||||
version: 1.0.0
|
||||
description: Staff reimbursements management.
|
||||
servers:
|
||||
- url: https://alrahmaisgl.org/api/v1
|
||||
security:
|
||||
- BearerAuth: []
|
||||
tags:
|
||||
- name: Reimbursements
|
||||
description: Manage reimbursements
|
||||
|
||||
paths:
|
||||
/reimbursements:
|
||||
get:
|
||||
tags: [Reimbursements]
|
||||
summary: List reimbursements
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
schema: { type: integer, example: 1 }
|
||||
- name: per_page
|
||||
in: query
|
||||
schema: { type: integer, example: 20 }
|
||||
- name: status
|
||||
in: query
|
||||
schema: { type: string, example: pending }
|
||||
- name: reimbursed_to
|
||||
in: query
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Paginated reimbursements
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PaginatedReimbursementsResponse'
|
||||
post:
|
||||
tags: [Reimbursements]
|
||||
summary: Create reimbursement
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateReimbursementRequest'
|
||||
responses:
|
||||
201:
|
||||
description: Reimbursement created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ReimbursementResponse'
|
||||
|
||||
/reimbursements/{id}:
|
||||
get:
|
||||
tags: [Reimbursements]
|
||||
summary: Get reimbursement by ID
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
responses:
|
||||
200:
|
||||
description: Reimbursement
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ReimbursementResponse'
|
||||
404: { description: Not found }
|
||||
put:
|
||||
tags: [Reimbursements]
|
||||
summary: Update reimbursement
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: integer }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UpdateReimbursementRequest'
|
||||
responses:
|
||||
200:
|
||||
description: Updated reimbursement
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ReimbursementResponse'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
|
||||
schemas:
|
||||
BasicSuccess:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: "success" }
|
||||
message: { type: string }
|
||||
data: {}
|
||||
|
||||
Reimbursement:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer }
|
||||
amount: { type: number }
|
||||
reimbursed_to: { type: integer }
|
||||
description: { type: string }
|
||||
expense_id: { type: integer }
|
||||
added_by: { type: integer }
|
||||
status: { type: string, example: pending }
|
||||
school_year: { type: string }
|
||||
semester: { type: string }
|
||||
reimbursement_method: { type: string, nullable: true }
|
||||
check_number: { type: string, nullable: true }
|
||||
|
||||
PaginatedReimbursementsResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items: { $ref: '#/components/schemas/Reimbursement' }
|
||||
pagination:
|
||||
type: object
|
||||
properties:
|
||||
current_page: { type: integer }
|
||||
per_page: { type: integer }
|
||||
total: { type: integer }
|
||||
total_pages: { type: integer }
|
||||
|
||||
ReimbursementResponse:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string }
|
||||
message: { type: string }
|
||||
data: { $ref: '#/components/schemas/Reimbursement' }
|
||||
|
||||
CreateReimbursementRequest:
|
||||
type: object
|
||||
required: [amount, reimbursed_to, description, expense_id]
|
||||
properties:
|
||||
amount: { type: number }
|
||||
reimbursed_to: { type: integer }
|
||||
description: { type: string }
|
||||
expense_id: { type: integer }
|
||||
status: { type: string, example: pending }
|
||||
|
||||
UpdateReimbursementRequest:
|
||||
type: object
|
||||
properties:
|
||||
status: { type: string, example: approved }
|
||||
reimbursement_method: { type: string }
|
||||
check_number: { type: string }
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Al Rahma Sunday School API – ReDoc</title>
|
||||
<style>
|
||||
body { margin: 0; padding: 0; }
|
||||
redoc { height: 100vh; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- ReDoc will load from CDN at view time and render master.yaml -->
|
||||
<redoc spec-url="openapi/master.yaml"></redoc>
|
||||
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
window.onload = () => {
|
||||
window.ui = SwaggerUIBundle({
|
||||
url: 'openapi/master.yaml',
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
presets: [SwaggerUIBundle.presets.apis],
|
||||
layout: 'BaseLayout',
|
||||
});
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#swagger-ui {
|
||||
height: 100%;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user