@@ -68,9 +68,223 @@ const router = express.Router();
6868 */
6969router . get ( "/" , getAllApplications ) ;
7070
71+ /**
72+ * @openapi
73+ * /admin/application/{id}:
74+ * get:
75+ * summary: Get application by ID
76+ * description: Admin endpoint to retrieve a specific application by its ID
77+ * tags: [Admin - Applications]
78+ * parameters:
79+ * - in: path
80+ * name: id
81+ * required: true
82+ * schema:
83+ * type: string
84+ * description: The application ID
85+ * responses:
86+ * 200:
87+ * description: Application successfully retrieved
88+ * content:
89+ * application/json:
90+ * schema:
91+ * $ref: "#/components/schemas/Application"
92+ * 404:
93+ * description: Application not found
94+ * 403:
95+ * description: Admin access required
96+ */
7197router . get ( "/:id" , getApplicationById ) ;
98+
99+ /**
100+ * @openapi
101+ * /admin/application:
102+ * post:
103+ * summary: Create a new application
104+ * description: Admin endpoint to create a new application
105+ * tags: [Admin - Applications]
106+ * requestBody:
107+ * required: true
108+ * content:
109+ * multipart/form-data:
110+ * schema:
111+ * type: object
112+ * properties:
113+ * userId:
114+ * type: string
115+ * gender:
116+ * type: string
117+ * pronous:
118+ * type: string
119+ * age:
120+ * type: integer
121+ * ethnicity:
122+ * type: string
123+ * gradYear:
124+ * type: integer
125+ * phoneNumber:
126+ * type: string
127+ * school:
128+ * type: string
129+ * city:
130+ * type: string
131+ * state:
132+ * type: string
133+ * country:
134+ * type: string
135+ * educationLevel:
136+ * type: string
137+ * major:
138+ * type: string
139+ * diet:
140+ * type: string
141+ * shirtSize:
142+ * type: string
143+ * sleep:
144+ * type: boolean
145+ * github:
146+ * type: string
147+ * linkedin:
148+ * type: string
149+ * portfolio:
150+ * type: string
151+ * whyBostonhacks:
152+ * type: string
153+ * applicationYear:
154+ * type: integer
155+ * resume:
156+ * type: string
157+ * format: binary
158+ * description: Resume file (PDF, DOC, DOCX, max 10MB)
159+ *
160+ * responses:
161+ * 201:
162+ * description: Application successfully created
163+ * content:
164+ * application/json:
165+ * schema:
166+ * $ref: "#/components/schemas/Application"
167+ * 400:
168+ * description: Invalid input data
169+ * 403:
170+ * description: Admin access required
171+ */
72172router . post ( "/" , createApplication ) ;
173+
174+ /**
175+ * @openapi
176+ * /admin/application/{id}:
177+ * put:
178+ * summary: Update an application
179+ * description: Admin endpoint to update an existing application. Almost all fields are updatable with this.
180+ * tags: [Admin - Applications]
181+ * parameters:
182+ * - in: path
183+ * name: id
184+ * required: true
185+ * schema:
186+ * type: string
187+ * description: The application ID
188+ * requestBody:
189+ * required: true
190+ * content:
191+ * multipart/form-data:
192+ * schema:
193+ * type: object
194+ * properties:
195+ * userId:
196+ * type: string
197+ * gender:
198+ * type: string
199+ * pronous:
200+ * type: string
201+ * age:
202+ * type: integer
203+ * ethnicity:
204+ * type: string
205+ * gradYear:
206+ * type: integer
207+ * phoneNumber:
208+ * type: string
209+ * school:
210+ * type: string
211+ * city:
212+ * type: string
213+ * state:
214+ * type: string
215+ * country:
216+ * type: string
217+ * educationLevel:
218+ * type: string
219+ * major:
220+ * type: string
221+ * diet:
222+ * type: string
223+ * shirtSize:
224+ * type: string
225+ * sleep:
226+ * type: boolean
227+ * github:
228+ * type: string
229+ * linkedin:
230+ * type: string
231+ * portfolio:
232+ * type: string
233+ * whyBostonhacks:
234+ * type: string
235+ * applicationYear:
236+ * type: integer
237+ * resume:
238+ * type: string
239+ * format: binary
240+ * description: Resume file (PDF, DOC, DOCX, max 10MB)
241+ *
242+ * responses:
243+ * 200:
244+ * description: Application successfully updated
245+ * content:
246+ * application/json:
247+ * schema:
248+ * $ref: "#/components/schemas/Application"
249+ * 400:
250+ * description: Invalid input data
251+ * 404:
252+ * description: Application not found
253+ * 403:
254+ * description: Admin access required
255+ */
73256router . put ( "/:id" , updateApplication ) ;
257+
258+ /**
259+ * @openapi
260+ * /admin/application/{id}:
261+ * delete:
262+ * summary: Delete an application
263+ * description: Admin endpoint to delete an application
264+ * tags: [Admin - Applications]
265+ * parameters:
266+ * - in: path
267+ * name: id
268+ * required: true
269+ * schema:
270+ * type: string
271+ * description: The application ID
272+ * responses:
273+ * 200:
274+ * description: Application successfully deleted
275+ * content:
276+ * application/json:
277+ * schema:
278+ * type: object
279+ * properties:
280+ * message:
281+ * type: string
282+ * example: "Application deleted successfully"
283+ * 404:
284+ * description: Application not found
285+ * 403:
286+ * description: Admin access required
287+ */
74288router . delete ( "/:id" , deleteApplication ) ;
75289
76290export default router ;
0 commit comments