Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fa72839
Consolidating GE model for api
matt-franklin225 Nov 12, 2025
4e16140
Merge branch 'main' into extract-common-course-data-models
matt-franklin225 Nov 19, 2025
8dc21de
Grades schema simplified with extends
matt-franklin225 Feb 13, 2026
41774f2
refactoring instructors.ts with base schemas
matt-franklin225 Feb 13, 2026
1acfdd9
Unifying geCategoryToColumn declarations
matt-franklin225 Feb 13, 2026
c091eb7
ge categories consolidation
matt-franklin225 Feb 13, 2026
6877588
fixed missed geCategories import
matt-franklin225 Feb 13, 2026
ddb487a
possible schema import error fix
matt-franklin225 Feb 15, 2026
b78291a
undid schema -> data pipeline imports
matt-franklin225 Feb 15, 2026
01406ec
fixed other schema import issue
matt-franklin225 Feb 15, 2026
0f71f91
take, cursor, skip consolidated
matt-franklin225 Feb 16, 2026
261b464
response bases created
matt-franklin225 Feb 16, 2026
c3e5a67
response bases implemented
matt-franklin225 Feb 16, 2026
0249add
const issue removed from search-modifiers
matt-franklin225 Feb 16, 2026
7f15dc4
response functions named instead of arrows
matt-franklin225 Feb 17, 2026
81386d9
migrating and streamlining response schemas
matt-franklin225 Feb 17, 2026
c0c8aa6
ok issue fixed
matt-franklin225 Feb 18, 2026
8e6fdf4
Merge branch 'main' into extract-common-course-data-models to avoid c…
matt-franklin225 Feb 20, 2026
cd004cd
unneeded geCategoryToColumn export removed
matt-franklin225 Feb 20, 2026
41d6eef
Merge branch 'main' into extract-common-course-data-models
matt-franklin225 Feb 24, 2026
fbaddff
responses simplified for dining
matt-franklin225 Mar 4, 2026
5e5b37c
Merge branch 'main' into extract-common-course-data-models
matt-franklin225 Mar 4, 2026
7799ba3
isCursor made optional field for response200
matt-franklin225 Mar 5, 2026
c508495
library-traffic responses updated
matt-franklin225 Mar 5, 2026
1eb4f01
refactor: date range 404 comment
sanskarm7 Mar 6, 2026
041795e
refactor: ugrad req 404 comment
sanskarm7 Mar 6, 2026
3f0d885
refactor: programs route desc rename
sanskarm7 Mar 6, 2026
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
20 changes: 6 additions & 14 deletions apps/api/src/rest/routes/ap-exams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import {
apExamsQuerySchema,
apExamsResponseSchema,
coursesGrantedTreeSchema,
errorSchema,
responseSchema,
response200,
response404,
response500,
} from "$schema";
import { APExamsService } from "$services";
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
Expand All @@ -25,18 +26,9 @@ const apExamsRoute = createRoute({
"Get AP exam data: mappings from College Board exam names to UCI Catalogue names and course credit for each exam score.",
request: { query: apExamsQuerySchema },
responses: {
200: {
content: { "application/json": { schema: responseSchema(apExamsResponseSchema) } },
description: "Successful operation",
},
404: {
content: { "application/json": { schema: errorSchema } },
description: "AP Exam mapping not found",
},
500: {
content: { "application/json": { schema: errorSchema } },
description: "Server error occurred",
},
200: response200(apExamsResponseSchema),
404: response404("AP Exam mapping not found"),
500: response500(),
},
});

Expand Down
45 changes: 14 additions & 31 deletions apps/api/src/rest/routes/calendar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { defaultHook } from "$hooks";
import { productionCache } from "$middleware";
import { calendarQuerySchema, calendarTermSchema, errorSchema, responseSchema } from "$schema";
import {
calendarQuerySchema,
calendarTermSchema,
response200,
response404,
response422,
response500,
} from "$schema";
import { CalendarService } from "$services";
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
import { database } from "@packages/db";
Expand All @@ -16,24 +23,10 @@ const calendarTermRoute = createRoute({
request: { query: calendarQuerySchema },
description: "Retrieves key dates for the provided term.",
responses: {
200: {
content: {
"application/json": { schema: responseSchema(calendarTermSchema) },
},
description: "Successful operation",
},
404: {
content: { "application/json": { schema: errorSchema } },
description: "Term not found",
},
422: {
content: { "application/json": { schema: errorSchema } },
description: "Parameters failed validation",
},
500: {
content: { "application/json": { schema: errorSchema } },
description: "Server error occurred",
},
200: response200(calendarTermSchema),
404: response404("Term not found"),
422: response422(),
500: response500(),
},
});

Expand All @@ -45,18 +38,8 @@ const allCalendarTermsRoute = createRoute({
path: "/all",
description: "Retrieves all data for all terms that are currently available.",
responses: {
200: {
content: {
"application/json": {
schema: responseSchema(calendarTermSchema.array()),
},
},
description: "Successful operation",
},
500: {
content: { "application/json": { schema: errorSchema } },
description: "Server error occurred",
},
200: response200(calendarTermSchema.array()),
500: response500(),
},
});

Expand Down
24 changes: 6 additions & 18 deletions apps/api/src/rest/routes/catalogue.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { defaultHook } from "$hooks";
import { productionCache } from "$middleware";
import {
errorSchema,
responseSchema,
response200,
response404,
response500,
sampleProgramsQuerySchema,
sampleProgramsResponseSchema,
} from "$schema";
Expand All @@ -21,22 +22,9 @@ const sampleProgramsRoute = createRoute({
description: "List sample programs in UCI's current catalogue.",
request: { query: sampleProgramsQuerySchema },
responses: {
200: {
content: {
"application/json": {
schema: responseSchema(sampleProgramsResponseSchema),
},
},
description: "Successful operation",
},
404: {
content: { "application/json": { schema: errorSchema } },
description: "Sample program data not found",
},
500: {
content: { "application/json": { schema: errorSchema } },
description: "Server error occurred",
},
200: response200(sampleProgramsResponseSchema),
404: response404("Sample program data not found"),
500: response500(),
},
});

Expand Down
78 changes: 17 additions & 61 deletions apps/api/src/rest/routes/courses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {
coursesByCursorQuerySchema,
coursesPathSchema,
coursesQuerySchema,
cursorResponseSchema,
errorSchema,
prerequisiteSchema,
prerequisiteTreeSchema,
responseSchema,
response200,
response404,
response422,
response500,
} from "$schema";
import { CoursesService } from "$services";
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
Expand All @@ -31,20 +32,9 @@ const batchCoursesRoute = createRoute({
request: { query: batchCoursesQuerySchema },
description: "Retrieves courses with the IDs provided",
responses: {
200: {
content: {
"application/json": { schema: responseSchema(courseSchema.array()) },
},
description: "Successful operation",
},
422: {
content: { "application/json": { schema: errorSchema } },
description: "Parameters failed validation",
},
500: {
content: { "application/json": { schema: errorSchema } },
description: "Server error occurred",
},
200: response200(courseSchema.array()),
422: response422(),
500: response500(),
},
});

Expand All @@ -57,22 +47,10 @@ const courseByIdRoute = createRoute({
request: { params: coursesPathSchema },
description: "Retrieves a course by its ID.",
responses: {
200: {
content: { "application/json": { schema: responseSchema(courseSchema) } },
description: "Successful operation",
},
404: {
content: { "application/json": { schema: errorSchema } },
description: "Course not found",
},
422: {
content: { "application/json": { schema: errorSchema } },
description: "Parameters failed validation",
},
500: {
content: { "application/json": { schema: errorSchema } },
description: "Server error occurred",
},
200: response200(courseSchema),
404: response404("Course not found"),
422: response422(),
500: response500(),
},
});

Expand All @@ -85,20 +63,9 @@ const coursesByFiltersRoute = createRoute({
request: { query: coursesQuerySchema },
description: "Retrieves courses matching the given filters.",
responses: {
200: {
content: {
"application/json": { schema: responseSchema(courseSchema.array()) },
},
description: "Successful operation",
},
422: {
content: { "application/json": { schema: errorSchema } },
description: "Parameters failed validation",
},
500: {
content: { "application/json": { schema: errorSchema } },
description: "Server error occurred",
},
200: response200(courseSchema.array()),
422: response422(),
500: response500(),
},
});

Expand All @@ -111,20 +78,9 @@ const coursesByCursorRoute = createRoute({
request: { query: coursesByCursorQuerySchema },
description: "Retrieves courses matching the given filters with cursor-based pagination.",
responses: {
200: {
content: {
"application/json": { schema: cursorResponseSchema(courseSchema.array()) },
},
description: "Successful operation",
},
422: {
content: { "application/json": { schema: errorSchema } },
description: "Parameters failed validation",
},
500: {
content: { "application/json": { schema: errorSchema } },
description: "Server error occurred",
},
200: response200(courseSchema.array(), { isCursor: true }),
422: response422(),
500: response500(),
},
});

Expand Down
Loading