Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 214 additions & 0 deletions app/routes/Admin/AdminApplication.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,223 @@ const router = express.Router();
*/
router.get("/", getAllApplications);

/**
* @openapi
* /admin/application/{id}:
* get:
* summary: Get application by ID
* description: Admin endpoint to retrieve a specific application by its ID
* tags: [Admin - Applications]
* parameters:
* - in: path
* name: id
* required: true
* schema:
* type: string
* description: The application ID
* responses:
* 200:
* description: Application successfully retrieved
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/Application"
* 404:
* description: Application not found
* 403:
* description: Admin access required
*/
router.get("/:id", getApplicationById);

/**
* @openapi
* /admin/application:
* post:
* summary: Create a new application
* description: Admin endpoint to create a new application
* tags: [Admin - Applications]
* requestBody:
* required: true
* content:
* multipart/form-data:
* schema:
* type: object
* properties:
* userId:
* type: string
* gender:
* type: string
* pronous:
* type: string
* age:
* type: integer
* ethnicity:
* type: string
* gradYear:
* type: integer
* phoneNumber:
* type: string
* school:
* type: string
* city:
* type: string
* state:
* type: string
* country:
* type: string
* educationLevel:
* type: string
* major:
* type: string
* diet:
* type: string
* shirtSize:
* type: string
* sleep:
* type: boolean
* github:
* type: string
* linkedin:
* type: string
* portfolio:
* type: string
* whyBostonhacks:
* type: string
* applicationYear:
* type: integer
* resume:
* type: string
* format: binary
* description: Resume file (PDF, DOC, DOCX, max 10MB)
*
* responses:
* 201:
* description: Application successfully created
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/Application"
* 400:
* description: Invalid input data
* 403:
* description: Admin access required
*/
router.post("/", createApplication);

/**
* @openapi
* /admin/application/{id}:
* put:
* summary: Update an application
* description: Admin endpoint to update an existing application. Almost all fields are updatable with this.
* tags: [Admin - Applications]
* parameters:
* - in: path
* name: id
* required: true
* schema:
* type: string
* description: The application ID
* requestBody:
* required: true
* content:
* multipart/form-data:
* schema:
* type: object
* properties:
* userId:
* type: string
* gender:
* type: string
* pronous:
* type: string
* age:
* type: integer
* ethnicity:
* type: string
* gradYear:
* type: integer
* phoneNumber:
* type: string
* school:
* type: string
* city:
* type: string
* state:
* type: string
* country:
* type: string
* educationLevel:
* type: string
* major:
* type: string
* diet:
* type: string
* shirtSize:
* type: string
* sleep:
* type: boolean
* github:
* type: string
* linkedin:
* type: string
* portfolio:
* type: string
* whyBostonhacks:
* type: string
* applicationYear:
* type: integer
* resume:
* type: string
* format: binary
* description: Resume file (PDF, DOC, DOCX, max 10MB)
*
* responses:
* 200:
* description: Application successfully updated
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/Application"
* 400:
* description: Invalid input data
* 404:
* description: Application not found
* 403:
* description: Admin access required
*/
router.put("/:id", updateApplication);

/**
* @openapi
* /admin/application/{id}:
* delete:
* summary: Delete an application
* description: Admin endpoint to delete an application
* tags: [Admin - Applications]
* parameters:
* - in: path
* name: id
* required: true
* schema:
* type: string
* description: The application ID
* responses:
* 200:
* description: Application successfully deleted
* content:
* application/json:
* schema:
* type: object
* properties:
* message:
* type: string
* example: "Application deleted successfully"
* 404:
* description: Application not found
* 403:
* description: Admin access required
*/
router.delete("/:id", deleteApplication);

export default router;