168 lines
4.5 KiB
YAML
168 lines
4.5 KiB
YAML
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 }
|
|
|