Skip to content

Commit

Permalink
chore: update prisma
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunSHamilton committed Dec 12, 2024
1 parent 3a02c22 commit 95834cf
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
77 changes: 77 additions & 0 deletions prisma/api-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,77 @@ export interface paths {
patch?: never;
trace?: never;
};
"/submit-quiz-attempt": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** Format: objectid */
challengeId: string;
quizId: string;
};
};
};
responses: {
/** @description Default Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": Record<string, never>;
};
};
/** @description Default Response */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
/** @enum {string} */
type: "error";
/** @enum {string} */
message: "That does not appear to be a valid quiz attempt submission.";
};
};
};
/** @description Default Response */
default: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
/** @enum {string} */
message: "flash.generic-error";
/** @enum {string} */
type: "danger";
};
};
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/donate/update-stripe-card": {
parameters: {
query?: never;
Expand Down Expand Up @@ -2678,6 +2749,12 @@ export interface paths {
examTimeInSeconds: number;
};
}[];
quizAttempts: {
/** Format: objectid */
challengeId: string;
quizId: string;
timestamp: number;
}[];
completedChallengeCount: number;
currentChallengeId: string;
email: string;
Expand Down
29 changes: 29 additions & 0 deletions prisma/json-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
"$ref": "#/definitions/CompletedExam"
}
},
"quizAttempts": {
"type": "array",
"originalType": "QuizAttempt",
"items": {
"$ref": "#/definitions/QuizAttempt"
}
},
"currentChallengeId": {
"type": [
"string",
Expand Down Expand Up @@ -1121,6 +1128,28 @@
"lastSavedDate"
]
},
"QuizAttempt": {
"type": "object",
"properties": {
"challengeId": {
"type": "string",
"originalType": "String"
},
"quizId": {
"type": "string",
"originalType": "String"
},
"timestamp": {
"type": "number",
"originalType": "Float"
}
},
"required": [
"challengeId",
"quizId",
"timestamp"
]
},
"EnvQuestionSet": {
"type": "object",
"properties": {
Expand Down
7 changes: 7 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,20 @@ type SavedChallenge {
lastSavedDate Float
}

type QuizAttempt {
challengeId String
quizId String
timestamp Float
}

/// Corresponds to the `user` collection.
model user {
id String @id @default(auto()) @map("_id") @db.ObjectId
about String
acceptedPrivacyTerms Boolean
completedChallenges CompletedChallenge[]
completedExams CompletedExam[] // Undefined
quizAttempts QuizAttempt[] // Undefined
currentChallengeId String?
donationEmails String[] // Undefined | String[] (only possible for built in Types like String)
email String
Expand Down

0 comments on commit 95834cf

Please sign in to comment.