Borrowing-TrackerBackend/equipment_tracker/schema.yml

1796 lines
45 KiB
YAML
Raw Permalink Normal View History

2023-11-09 19:52:03 +08:00
openapi: 3.0.3
info:
title: Equipment Tracker Backend
2023-11-09 19:52:03 +08:00
version: 1.0.0
description: A Project
2023-11-09 19:52:03 +08:00
paths:
2023-12-22 14:12:10 +08:00
/api/v1/accounts/clearance/:
get:
operationId: api_v1_accounts_clearance_retrieve
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Clearance'
description: ''
2023-11-09 19:52:03 +08:00
/api/v1/accounts/jwt/create/:
post:
operationId: api_v1_accounts_jwt_create_create
description: |-
Takes a set of user credentials and returns an access and refresh JSON web
token pair to prove the authentication of those credentials.
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TokenObtainPair'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/TokenObtainPair'
multipart/form-data:
schema:
$ref: '#/components/schemas/TokenObtainPair'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TokenObtainPair'
description: ''
/api/v1/accounts/jwt/refresh/:
post:
operationId: api_v1_accounts_jwt_refresh_create
description: |-
Takes a refresh type JSON web token and returns an access type JSON web
token if the refresh token is valid.
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TokenRefresh'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/TokenRefresh'
multipart/form-data:
schema:
$ref: '#/components/schemas/TokenRefresh'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TokenRefresh'
description: ''
/api/v1/accounts/jwt/verify/:
post:
operationId: api_v1_accounts_jwt_verify_create
description: |-
Takes a token and indicates if it is valid. This view provides no
information about a token's fitness for a particular use.
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TokenVerify'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/TokenVerify'
multipart/form-data:
schema:
$ref: '#/components/schemas/TokenVerify'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TokenVerify'
description: ''
/api/v1/accounts/teachers/:
get:
operationId: api_v1_accounts_teachers_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CustomUser'
description: ''
/api/v1/accounts/technicians/:
get:
operationId: api_v1_accounts_technicians_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CustomUser'
description: ''
2023-11-09 19:52:03 +08:00
/api/v1/accounts/users/:
get:
operationId: api_v1_accounts_users_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CustomUser'
description: ''
post:
operationId: api_v1_accounts_users_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserRegistration'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/UserRegistration'
multipart/form-data:
schema:
$ref: '#/components/schemas/UserRegistration'
required: true
security:
- jwtAuth: []
- {}
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/UserRegistration'
description: ''
/api/v1/accounts/users/{id}/:
get:
operationId: api_v1_accounts_users_retrieve
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this user.
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CustomUser'
description: ''
put:
operationId: api_v1_accounts_users_update
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this user.
required: true
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CustomUser'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/CustomUser'
multipart/form-data:
schema:
$ref: '#/components/schemas/CustomUser'
required: true
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CustomUser'
description: ''
patch:
operationId: api_v1_accounts_users_partial_update
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this user.
required: true
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedCustomUser'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedCustomUser'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedCustomUser'
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CustomUser'
description: ''
delete:
operationId: api_v1_accounts_users_destroy
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this user.
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'204':
description: No response body
/api/v1/accounts/users/activation/:
post:
operationId: api_v1_accounts_users_activation_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Activation'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Activation'
multipart/form-data:
schema:
$ref: '#/components/schemas/Activation'
required: true
security:
- jwtAuth: []
- {}
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Activation'
description: ''
/api/v1/accounts/users/me/:
get:
operationId: api_v1_accounts_users_me_retrieve
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CustomUser'
description: ''
put:
operationId: api_v1_accounts_users_me_update
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CustomUser'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/CustomUser'
multipart/form-data:
schema:
$ref: '#/components/schemas/CustomUser'
required: true
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CustomUser'
description: ''
patch:
operationId: api_v1_accounts_users_me_partial_update
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedCustomUser'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedCustomUser'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedCustomUser'
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CustomUser'
description: ''
delete:
operationId: api_v1_accounts_users_me_destroy
tags:
- api
security:
- jwtAuth: []
responses:
'204':
description: No response body
/api/v1/accounts/users/resend_activation/:
post:
operationId: api_v1_accounts_users_resend_activation_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailReset'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/SendEmailReset'
multipart/form-data:
schema:
$ref: '#/components/schemas/SendEmailReset'
required: true
security:
- jwtAuth: []
- {}
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailReset'
description: ''
/api/v1/accounts/users/reset_password/:
post:
operationId: api_v1_accounts_users_reset_password_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailReset'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/SendEmailReset'
multipart/form-data:
schema:
$ref: '#/components/schemas/SendEmailReset'
required: true
security:
- jwtAuth: []
- {}
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailReset'
description: ''
/api/v1/accounts/users/reset_password_confirm/:
post:
operationId: api_v1_accounts_users_reset_password_confirm_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PasswordResetConfirm'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PasswordResetConfirm'
multipart/form-data:
schema:
$ref: '#/components/schemas/PasswordResetConfirm'
required: true
security:
- jwtAuth: []
- {}
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PasswordResetConfirm'
description: ''
/api/v1/accounts/users/reset_username/:
post:
operationId: api_v1_accounts_users_reset_username_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailReset'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/SendEmailReset'
multipart/form-data:
schema:
$ref: '#/components/schemas/SendEmailReset'
required: true
security:
- jwtAuth: []
- {}
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SendEmailReset'
description: ''
/api/v1/accounts/users/reset_username_confirm/:
post:
operationId: api_v1_accounts_users_reset_username_confirm_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UsernameResetConfirm'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/UsernameResetConfirm'
multipart/form-data:
schema:
$ref: '#/components/schemas/UsernameResetConfirm'
required: true
security:
- jwtAuth: []
- {}
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/UsernameResetConfirm'
description: ''
/api/v1/accounts/users/set_password/:
post:
operationId: api_v1_accounts_users_set_password_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SetPassword'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/SetPassword'
multipart/form-data:
schema:
$ref: '#/components/schemas/SetPassword'
required: true
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SetPassword'
description: ''
/api/v1/accounts/users/set_username/:
post:
operationId: api_v1_accounts_users_set_username_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SetUsername'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/SetUsername'
multipart/form-data:
schema:
$ref: '#/components/schemas/SetUsername'
required: true
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SetUsername'
description: ''
2023-12-09 00:59:17 +08:00
/api/v1/breakages/:
get:
operationId: api_v1_breakages_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/BreakageReport'
description: ''
/api/v1/breakages/{id}/:
get:
operationId: api_v1_breakages_retrieve
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this breakage report.
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/BreakageReport'
description: ''
2023-11-12 21:50:39 +08:00
/api/v1/equipments/equipment_instances/:
get:
operationId: api_v1_equipments_equipment_instances_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/EquipmentInstance'
description: ''
post:
operationId: api_v1_equipments_equipment_instances_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EquipmentInstance'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/EquipmentInstance'
multipart/form-data:
schema:
$ref: '#/components/schemas/EquipmentInstance'
required: true
security:
- jwtAuth: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/EquipmentInstance'
description: ''
/api/v1/equipments/equipment_instances/{equipment_id}/logs/:
get:
operationId: api_v1_equipments_equipment_instances_logs_list_2
parameters:
- in: path
name: equipment_id
schema:
type: integer
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/EquipmentInstanceLog'
description: ''
/api/v1/equipments/equipment_instances/{id}/:
get:
operationId: api_v1_equipments_equipment_instances_retrieve
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this equipment instance.
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/EquipmentInstance'
description: ''
put:
operationId: api_v1_equipments_equipment_instances_update
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this equipment instance.
required: true
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EquipmentInstance'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/EquipmentInstance'
multipart/form-data:
schema:
$ref: '#/components/schemas/EquipmentInstance'
required: true
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/EquipmentInstance'
description: ''
patch:
operationId: api_v1_equipments_equipment_instances_partial_update
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this equipment instance.
required: true
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedEquipmentInstance'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedEquipmentInstance'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedEquipmentInstance'
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/EquipmentInstance'
description: ''
delete:
operationId: api_v1_equipments_equipment_instances_destroy
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this equipment instance.
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'204':
description: No response body
/api/v1/equipments/equipment_instances/available:
get:
operationId: api_v1_equipments_equipment_instances_available_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/EquipmentInstance'
description: ''
2023-11-12 21:50:39 +08:00
/api/v1/equipments/equipment_instances/latest:
get:
operationId: api_v1_equipments_equipment_instances_latest_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/EquipmentInstance'
description: ''
/api/v1/equipments/equipment_instances/logs:
get:
operationId: api_v1_equipments_equipment_instances_logs_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/EquipmentInstanceLogs'
description: ''
/api/v1/equipments/equipments/:
get:
operationId: api_v1_equipments_equipments_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Equipment'
description: ''
post:
operationId: api_v1_equipments_equipments_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Equipment'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Equipment'
multipart/form-data:
schema:
$ref: '#/components/schemas/Equipment'
required: true
security:
- jwtAuth: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/Equipment'
description: ''
/api/v1/equipments/equipments/{equipment_id}/logs/:
get:
operationId: api_v1_equipments_equipments_logs_list_2
parameters:
- in: path
name: equipment_id
schema:
type: integer
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/EquipmentLog'
description: ''
/api/v1/equipments/equipments/{id}/:
get:
operationId: api_v1_equipments_equipments_retrieve
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this equipment.
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Equipment'
description: ''
put:
operationId: api_v1_equipments_equipments_update
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this equipment.
required: true
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Equipment'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Equipment'
multipart/form-data:
schema:
$ref: '#/components/schemas/Equipment'
required: true
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Equipment'
description: ''
patch:
operationId: api_v1_equipments_equipments_partial_update
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this equipment.
required: true
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedEquipment'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedEquipment'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedEquipment'
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Equipment'
description: ''
delete:
operationId: api_v1_equipments_equipments_destroy
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this equipment.
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'204':
description: No response body
/api/v1/equipments/equipments/latest:
get:
operationId: api_v1_equipments_equipments_latest_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Equipment'
description: ''
/api/v1/equipments/equipments/logs:
get:
operationId: api_v1_equipments_equipments_logs_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/EquipmentLogs'
description: ''
/api/v1/transactions/:
get:
operationId: api_v1_transactions_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Transaction'
description: ''
post:
operationId: api_v1_transactions_create
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Transaction'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Transaction'
multipart/form-data:
schema:
$ref: '#/components/schemas/Transaction'
required: true
security:
- jwtAuth: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/Transaction'
description: ''
/api/v1/transactions/{id}/:
get:
operationId: api_v1_transactions_retrieve
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this transaction.
required: true
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Transaction'
description: ''
2023-12-16 15:00:13 +08:00
patch:
operationId: api_v1_transactions_partial_update
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this transaction.
required: true
tags:
- api
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedTransaction'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedTransaction'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedTransaction'
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Transaction'
description: ''
2023-12-22 14:12:10 +08:00
/api/v1/transactions/student/:
get:
operationId: api_v1_transactions_student_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Transaction'
description: ''
2023-12-22 14:12:10 +08:00
/api/v1/transactions/teacher/:
get:
operationId: api_v1_transactions_teacher_list
tags:
- api
security:
- jwtAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Transaction'
2023-12-16 15:00:13 +08:00
description: ''
2023-11-09 19:52:03 +08:00
components:
schemas:
Activation:
type: object
properties:
uid:
type: string
token:
type: string
required:
- token
- uid
BlankEnum:
enum:
- ''
2023-12-09 00:59:17 +08:00
BreakageReport:
type: object
properties:
id:
type: integer
readOnly: true
transaction:
type: integer
equipments:
type: array
items:
type: integer
resolved:
type: boolean
readOnly: true
timestamp:
type: string
format: date-time
readOnly: true
required:
- equipments
- id
- resolved
- timestamp
- transaction
2023-12-03 00:43:50 +08:00
CategoryEnum:
enum:
- Glassware
- Miscellaneous
2023-12-03 00:43:50 +08:00
type: string
description: |-
* `Glassware` - Glassware
* `Miscellaneous` - Miscellaneous
2023-12-22 14:12:10 +08:00
Clearance:
type: object
properties:
cleared:
type: string
uncleared_transactions:
type: integer
2023-12-22 14:12:10 +08:00
required:
- cleared
- uncleared_transactions
CourseEnum:
enum:
- BS Chemistry
- BS Food Technology
- BS Applied Physics
- BS Environmental Science
type: string
description: |-
* `BS Chemistry` - BS Chemistry
* `BS Food Technology` - BS Food Technology
* `BS Applied Physics` - BS Applied Physics
* `BS Environmental Science` - BS Environmental Science
2023-11-09 19:52:03 +08:00
CustomUser:
type: object
properties:
id:
type: integer
readOnly: true
2023-11-09 19:52:03 +08:00
username:
type: string
readOnly: true
description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
only.
email:
type: string
format: email
2024-01-24 22:38:59 +08:00
readOnly: true
2023-11-09 19:52:03 +08:00
title: Email address
first_name:
type: string
maxLength: 100
course:
nullable: true
oneOf:
- $ref: '#/components/schemas/CourseEnum'
2024-01-24 22:38:59 +08:00
- $ref: '#/components/schemas/BlankEnum'
- $ref: '#/components/schemas/NullEnum'
section:
type: string
nullable: true
2023-11-09 19:52:03 +08:00
last_name:
type: string
maxLength: 100
is_teacher:
type: boolean
2024-01-24 22:38:59 +08:00
readOnly: true
is_technician:
type: boolean
2024-01-24 22:38:59 +08:00
readOnly: true
2023-11-09 19:52:03 +08:00
required:
2024-01-24 22:38:59 +08:00
- course
- email
2023-11-09 19:52:03 +08:00
- first_name
- id
2024-01-24 22:38:59 +08:00
- is_teacher
- is_technician
2023-11-09 19:52:03 +08:00
- last_name
2024-01-24 22:38:59 +08:00
- section
2023-11-09 19:52:03 +08:00
- username
2023-11-12 21:50:39 +08:00
Equipment:
type: object
properties:
id:
type: integer
readOnly: true
name:
type: string
description:
type: string
2023-12-16 15:00:13 +08:00
maxLength: 512
2023-12-03 00:43:50 +08:00
category:
$ref: '#/components/schemas/CategoryEnum'
2023-11-12 21:50:39 +08:00
last_updated:
type: string
format: date-time
readOnly: true
last_updated_by:
type: string
readOnly: true
date_added:
type: string
format: date-time
readOnly: true
required:
- date_added
- id
- last_updated
- last_updated_by
- name
EquipmentInstance:
type: object
properties:
id:
type: integer
readOnly: true
equipment:
type: integer
2023-12-03 00:43:50 +08:00
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
2023-11-12 21:50:39 +08:00
status:
$ref: '#/components/schemas/StatusEnum'
2023-11-12 21:50:39 +08:00
remarks:
type: string
2024-01-07 20:41:14 +08:00
nullable: true
2023-11-12 21:50:39 +08:00
last_updated:
type: string
format: date-time
readOnly: true
date_added:
type: string
format: date-time
readOnly: true
required:
2023-12-03 00:43:50 +08:00
- category
2023-11-12 21:50:39 +08:00
- date_added
- equipment
2023-12-03 00:43:50 +08:00
- equipment_name
2023-11-12 21:50:39 +08:00
- id
- last_updated
- status
EquipmentInstanceLog:
type: object
properties:
id:
type: integer
readOnly: true
equipment:
type: integer
2023-12-03 00:43:50 +08:00
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
2023-11-12 21:50:39 +08:00
status:
type: string
remarks:
type: string
last_updated:
type: string
format: date-time
readOnly: true
date_added:
type: string
format: date-time
readOnly: true
last_updated_by:
type: string
readOnly: true
history:
type: array
items:
type: object
additionalProperties: {}
required:
2023-12-03 00:43:50 +08:00
- category
2023-11-12 21:50:39 +08:00
- date_added
- equipment
2023-12-03 00:43:50 +08:00
- equipment_name
2023-11-12 21:50:39 +08:00
- history
- id
- last_updated
- last_updated_by
- remarks
- status
EquipmentInstanceLogs:
type: object
properties:
history_id:
type: integer
readOnly: true
id:
type: integer
readOnly: true
equipment:
type: integer
2023-12-03 00:43:50 +08:00
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
2023-11-12 21:50:39 +08:00
status:
allOf:
- $ref: '#/components/schemas/StatusEnum'
readOnly: true
remarks:
type: string
readOnly: true
2023-12-03 00:43:50 +08:00
nullable: true
2023-11-12 21:50:39 +08:00
history_date:
type: string
format: date-time
readOnly: true
history_user:
type: string
readOnly: true
required:
2023-12-03 00:43:50 +08:00
- category
- equipment
2023-12-03 00:43:50 +08:00
- equipment_name
2023-11-12 21:50:39 +08:00
- history_date
- history_id
- history_user
- id
2023-11-12 21:50:39 +08:00
- remarks
- status
EquipmentLog:
type: object
properties:
id:
type: integer
readOnly: true
name:
type: string
description:
type: string
2023-12-03 00:43:50 +08:00
category:
$ref: '#/components/schemas/CategoryEnum'
2023-11-12 21:50:39 +08:00
last_updated:
type: string
format: date-time
readOnly: true
date_added:
type: string
format: date-time
readOnly: true
last_updated_by:
type: string
readOnly: true
history:
type: array
items:
type: object
additionalProperties: {}
required:
- date_added
- history
- id
- last_updated
- last_updated_by
- name
EquipmentLogs:
type: object
properties:
history_id:
type: integer
readOnly: true
id:
type: integer
readOnly: true
2023-11-12 21:50:39 +08:00
name:
type: string
readOnly: true
description:
type: string
readOnly: true
2023-12-03 00:43:50 +08:00
nullable: true
category:
$ref: '#/components/schemas/CategoryEnum'
2023-11-12 21:50:39 +08:00
history_date:
type: string
format: date-time
readOnly: true
history_user:
type: string
readOnly: true
required:
- description
- history_date
- history_id
- history_user
- id
2023-11-12 21:50:39 +08:00
- name
NullEnum:
enum:
- null
2023-11-09 19:52:03 +08:00
PasswordResetConfirm:
type: object
properties:
uid:
type: string
token:
type: string
new_password:
type: string
required:
- new_password
- token
- uid
PatchedCustomUser:
type: object
properties:
id:
type: integer
readOnly: true
2023-11-09 19:52:03 +08:00
username:
type: string
readOnly: true
description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
only.
email:
type: string
format: email
2024-01-24 22:38:59 +08:00
readOnly: true
2023-11-09 19:52:03 +08:00
title: Email address
first_name:
type: string
maxLength: 100
course:
nullable: true
oneOf:
- $ref: '#/components/schemas/CourseEnum'
2024-01-24 22:38:59 +08:00
- $ref: '#/components/schemas/BlankEnum'
- $ref: '#/components/schemas/NullEnum'
section:
type: string
nullable: true
2023-11-09 19:52:03 +08:00
last_name:
type: string
maxLength: 100
is_teacher:
type: boolean
2024-01-24 22:38:59 +08:00
readOnly: true
is_technician:
type: boolean
2024-01-24 22:38:59 +08:00
readOnly: true
2023-11-12 21:50:39 +08:00
PatchedEquipment:
type: object
properties:
id:
type: integer
readOnly: true
name:
type: string
description:
type: string
2023-12-16 15:00:13 +08:00
maxLength: 512
2023-12-03 00:43:50 +08:00
category:
$ref: '#/components/schemas/CategoryEnum'
2023-11-12 21:50:39 +08:00
last_updated:
type: string
format: date-time
readOnly: true
last_updated_by:
type: string
readOnly: true
date_added:
type: string
format: date-time
readOnly: true
PatchedEquipmentInstance:
type: object
properties:
id:
type: integer
readOnly: true
equipment:
type: integer
2023-12-03 00:43:50 +08:00
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
2023-11-12 21:50:39 +08:00
status:
$ref: '#/components/schemas/StatusEnum'
2023-11-12 21:50:39 +08:00
remarks:
type: string
2024-01-07 20:41:14 +08:00
nullable: true
2023-11-12 21:50:39 +08:00
last_updated:
type: string
format: date-time
readOnly: true
date_added:
type: string
format: date-time
readOnly: true
2023-12-16 15:00:13 +08:00
PatchedTransaction:
type: object
properties:
id:
type: integer
readOnly: true
borrower:
type: integer
teacher:
type: integer
subject:
type: string
2023-12-16 15:00:13 +08:00
equipments:
type: array
items:
type: integer
remarks:
type: string
nullable: true
2023-12-16 15:00:13 +08:00
transaction_status:
$ref: '#/components/schemas/TransactionStatusEnum'
additional_members:
type: string
nullable: true
consumables:
type: string
nullable: true
2023-12-16 15:00:13 +08:00
timestamp:
type: string
format: date-time
readOnly: true
2023-11-09 19:52:03 +08:00
SendEmailReset:
type: object
properties:
email:
type: string
format: email
required:
- email
SetPassword:
type: object
properties:
new_password:
type: string
current_password:
type: string
required:
- current_password
- new_password
SetUsername:
type: object
properties:
current_password:
type: string
new_username:
type: string
title: Username
description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
only.
pattern: ^[\w.@+-]+$
maxLength: 150
required:
- current_password
- new_username
2023-11-12 21:50:39 +08:00
StatusEnum:
enum:
2023-12-16 15:00:13 +08:00
- Available
- Pending
- Broken
- Borrowed
2023-11-12 21:50:39 +08:00
type: string
2023-12-03 00:43:50 +08:00
description: |-
2023-12-16 15:00:13 +08:00
* `Available` - Available
* `Pending` - Pending
* `Broken` - Broken
* `Borrowed` - Borrowed
2023-11-09 19:52:03 +08:00
TokenObtainPair:
type: object
properties:
username:
type: string
writeOnly: true
password:
type: string
writeOnly: true
access:
type: string
readOnly: true
refresh:
type: string
readOnly: true
required:
- access
- password
- refresh
- username
TokenRefresh:
type: object
properties:
access:
type: string
readOnly: true
refresh:
type: string
writeOnly: true
required:
- access
- refresh
TokenVerify:
type: object
properties:
token:
type: string
writeOnly: true
required:
- token
Transaction:
type: object
properties:
id:
type: integer
readOnly: true
borrower:
type: integer
teacher:
2023-12-16 15:00:13 +08:00
type: integer
subject:
type: string
equipments:
type: array
items:
type: integer
remarks:
type: string
nullable: true
transaction_status:
$ref: '#/components/schemas/TransactionStatusEnum'
additional_members:
type: string
nullable: true
consumables:
type: string
nullable: true
timestamp:
type: string
format: date-time
readOnly: true
required:
2023-12-16 15:00:13 +08:00
- borrower
- equipments
- id
- subject
2023-12-16 15:00:13 +08:00
- teacher
- timestamp
- transaction_status
TransactionStatusEnum:
enum:
- Pending Approval
- Approved
- Rejected
- Cancelled
- Borrowed
- 'Returned: Pending Checking'
- 'With Breakages: Pending Resolution'
- Finalized
type: string
description: |-
* `Pending Approval` - Pending Approval
* `Approved` - Approved
* `Rejected` - Rejected
* `Cancelled` - Cancelled
* `Borrowed` - Borrowed
* `Returned: Pending Checking` - Returned: Pending Checking
* `With Breakages: Pending Resolution` - With Breakages: Pending Resolution
* `Finalized` - Finalized
2023-11-09 19:52:03 +08:00
UserRegistration:
type: object
properties:
username:
type: string
email:
type: string
format: email
password:
type: string
writeOnly: true
course:
nullable: true
oneOf:
- $ref: '#/components/schemas/CourseEnum'
- $ref: '#/components/schemas/BlankEnum'
- $ref: '#/components/schemas/NullEnum'
section:
2023-11-09 19:52:03 +08:00
type: string
nullable: true
first_name:
type: string
maxLength: 100
last_name:
type: string
maxLength: 100
required:
- course
2023-11-09 19:52:03 +08:00
- email
- first_name
- last_name
- password
- section
2023-11-09 19:52:03 +08:00
- username
UsernameResetConfirm:
type: object
properties:
new_username:
type: string
title: Username
description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
only.
pattern: ^[\w.@+-]+$
maxLength: 150
required:
- new_username
securitySchemes:
jwtAuth:
type: http
scheme: bearer
bearerFormat: JWT