Skip to content

Commit

Permalink
added age field to applicationData
Browse files Browse the repository at this point in the history
  • Loading branch information
Anupama1912 committed Jul 22, 2024
1 parent 26d9c3d commit 534f6b9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 41 deletions.
3 changes: 3 additions & 0 deletions docs/src/swagger-output.json
Original file line number Diff line number Diff line change
Expand Up @@ -4670,6 +4670,9 @@
"dateOfBirth": {
"type": "string"
},
"age": {
"type": "number"
},
"jobTitle": {
"type": "string"
},
Expand Down
43 changes: 3 additions & 40 deletions services/expo/src/utils/validationHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,6 @@ export const getEligiblePrizes = async (users: any[], req: express.Request) => {
});
return dbPrizes;
}
case "Horizons 2024": {
const { tracks, challenges } = prizeConfig.hexathons["Horizons 2024"];

const generalDBPrizes = await prisma.category.findMany({
where: {
name: {
in: tracks.concat(challenges),
},
},
});
return generalDBPrizes;
}

default: {
return [];
Expand Down Expand Up @@ -404,7 +392,9 @@ export const validatePrizes = async (prizes: any[], req: express.Request) => {

return { error: false };
}

default: {
return { error: false };
}
case "HackGT X": {
if (
prizeNames.filter(prize => prizeConfig.hexathons["HackGT X"].generalPrizes.includes(prize))
Expand Down Expand Up @@ -444,33 +434,6 @@ export const validatePrizes = async (prizes: any[], req: express.Request) => {
}
return { error: false };
}

case "Horizons 2024": {
if (
prizeNames.filter(prize => prizeConfig.hexathons["Horizons 2024"].tracks.includes(prize))
.length === 0
) {
return {
error: true,
message: "You must submit to at least one track.",
};
}

if (
prizeNames.filter(prize => prizeConfig.hexathons["Horizons 2024"].tracks.includes(prize))
.length > 1
) {
return {
error: true,
message: "You can only submit to at most one track.",
};
}
return { error: false };
}

default: {
return { error: false };
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion services/hexathons/src/models/hexathon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Hexathon extends mongoose.Document {
endDate: Date;
emailHeaderImage?: string;
coverImage?: string;
isDev?: boolean;
isDev?: boolean; // ??? should not have ?
}

const hexathonSchema = new Schema<Hexathon>({
Expand Down
4 changes: 4 additions & 0 deletions services/registration/src/models/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface Application extends mongoose.Document {
applicationData: {
adult?: boolean;
dateOfBirth?: string;
age?: number;
jobTitle?: string;
company?: string;
school?: string;
Expand Down Expand Up @@ -121,6 +122,9 @@ const applicationSchema = new Schema<Application>(
dateOfBirth: {
type: String,
},
age: {
type: Number,
},
jobTitle: {
type: String,
},
Expand Down

0 comments on commit 534f6b9

Please sign in to comment.