Note that where 400 indicates multiple errors, a relevant error message will be returned by the backend. Types can be found in types.ts. This documentation will sometimes use the type definition instead of a type name, for ease of reading.
403 - No access to route, based on role stored in JWT.
403 - Cannot access page in current state.
302 - Redirects to Microsoft Auth sign in
200 - Clears JWT cookie from browser (signs out)
400 - Microsoft auth error, user has no shortcode, or user has no entry year.
403 - Not a Computing student.
500 - State mismatch or Microsoft auth error - was logged internally.
200 - Succesful log in. Sets JWT cookie and returns JSON.
type Reponse = {
user_is: 'parent' | 'fresher';
done_survey: boolean;
};
200 - Mainly a testing route. Decodes JWT & returns JSON.
type Response = {
shortcode: string;
user_is: 'parent' | 'fresher';
doneSurvey: boolean;
};
{
name: string,
jmc: boolean
gender: 'male' | 'female' | 'other' | 'n/a',
interests: Interests,
aboutMe: string | null,
socials: string[] | null
}
400 - Invalid body, already completed survey, or student.
200 - Updates these details for the user.
{
shortcode: string;
}
400 - Invalid body, already married, attempted to propose to self or invalid person, already proposed to max (3) number, already proposed to person.
200 - Proposes to shortcode
.
{
shortcode: string;
}
400 - Invalid body or proposal does not exist.
200 - Revokes proposal to shortcode
.
{
shortcode: string;
}
400 - Invalid body or proposal does not exist.
200 - Accepts proposal from shortcode
.
200 - Returns array of proposals.
{
proposal: string;
proposee: string;
}
[];
200 - Returns user details.
{
shortcode: string;
jmc: boolean;
role: "parent" | "fresher";
completedSurvey: boolean;
name: string | null;
gender: "male" | "female" | "other" | "n/a" | null;
interests: Interests | null;
socials: string[] | null;
aboutMe: string | null;
}
400 - User does not have a family.
200 - Returns family.
{
parents: [
parent1: Student
parent2: Student
],
kids: Student[]
}
200 - Returns JSON with current state.
{
state: 'parents_open' | 'parents_close' | 'freshers_open' | 'closed';
}
{
state: 'parents_open' | 'parents_close' | 'freshers_open' | 'closed';
}
400 - Invalid body.
200 - Updated state.
200 - Returns array of all families in the format the allocator wants.
{
_id: number,
parents: {
proposerId: AllocatorParent
proposeeId: AllocatorParent
}
kids: AllocatorFresher[]
hasFemale: boolean,
hasJmc: boolean
}[]
200 - Returns array of all freshers who aren't in a family.
AllocatorFresher = {
_id: string,
student: AllocatorStudent
interests: Interests
family: number | undefined
}[]
{
fresher: string,
family: number
}
200 - Successfully allocated students to families.
400 - Invalid body.
200 - Returns various stats about the families and freshers.
{
families: number, // num of marriages
all_parents: number, // non-freshers who signed in at least once
registered_parents: number, // non-freshers who completed the survey
all_freshers: number, // all freshers, due to the seed file
registered_freshers: number // freshers who completed the survey
}
200 Returns all families. This differs from the allocation routes, as it uses our sensible types.
{
id: number,
parents: Student[],
kids: Student[]
}[]