Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@PrimeTimeTran
Created May 18, 2023 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PrimeTimeTran/489ceb03f001a5bd098967bab3fb276b to your computer and use it in GitHub Desktop.
Save PrimeTimeTran/489ceb03f001a5bd098967bab3fb276b to your computer and use it in GitHub Desktop.
  • src
    • controllers
      • UserController.ts
      • FormController.ts
      • QuestionController.ts
      • ResponseController.ts
    • models
      • User.ts
      • Form.ts
      • Question.ts
      • Response.ts
    • db
      • db.ts
    • mailers
      • SignupMailer.ts
      • SubmissionMailer.ts
    • types
      • CustomTypes.ts
    • index.ts
class User {
id: string;
name: string;
email: string;
}
class Form {
id: string;
title: string;
questions: Question[];
}
class Question {
id: string;
text: string;
type: QuestionType;
options?: string[];
}
enum QuestionType {
Text = 'text',
MultipleChoice = 'multipleChoice',
Checkbox = 'checkbox',
}
class Response {
id: string;
formId: string;
userId: string;
answers: Answer[];
}
class Answer {
questionId: string;
value: string | string[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment