Options
All
  • Public
  • Public/Protected
  • All
Menu

Module routes/form

Index

Functions

  • addAttachmentsToDatabase(formResponse: FormAttachment, job_applicationId: Id): Promise<Responses.Empty>
  • Attempts to add attachments to the database.

    Parameters

    • formResponse: FormAttachment

      The response with the data.

    • job_applicationId: Id

      The job_application id object.

    Returns Promise<Responses.Empty>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • addJobApplicationToDatabase(formResponse: FormJobApplication, student_id: Id): Promise<Responses.Id>
  • Attempts to add a job application to the database.

    Parameters

    • formResponse: FormJobApplication

      The response with the data.

    • student_id: Id

      The student id object.

    Returns Promise<Responses.Id>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • addPersonToDatabase(formResponse: FormPerson): Promise<Responses.Id>
  • Attempts to add a person to the database.

    Parameters

    • formResponse: FormPerson

      The response with the data.

    Returns Promise<Responses.Id>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • addRolesToDatabase(formResponse: FormRoles, job_applicationId: Id): Promise<Responses.Empty>
  • Attempts to add roles to the database.

    Parameters

    • formResponse: FormRoles

      The response with the data.

    • job_applicationId: Id

      The job_application id object.

    Returns Promise<Responses.Empty>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • addSkillsToDatabase(formResponse: FormJobApplicationSkill, job_applicationId: Id): Promise<Responses.Empty>
  • Attempts to add a job application skill to the database.

    Parameters

    • formResponse: FormJobApplicationSkill

      The response with the data.

    • job_applicationId: Id

      The job application id.

    Returns Promise<Responses.Empty>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • addStudentToDatabase(formResponse: FormStudent, personId: Id): Promise<Responses.Id_alumni>
  • Attempts to add a student to the database.

    Parameters

    • formResponse: FormStudent

      The response with the data.

    • personId: Id

      The id of a person.

    Returns Promise<Responses.Id_alumni>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • checkQuestionsExist(questions: FormResponse<Question>[]): boolean
  • Parameters

    • questions: FormResponse<Question>[]

    Returns boolean

  • checkWordInAnswer(question: Question, word: string): Responses.FormResponse<boolean>
  • This function checks if the answer on a certain question contains a word.

    Parameters

    • question: Question

      The question.

    • word: string

      the word we are searching for in the answer.

    Returns Responses.FormResponse<boolean>

    True if the question options contain the word, else false.

  • createForm(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>): Promise<Responses.Empty>
  • Attempts to create a new form in the system.

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

      The Express.js request to extract all required data from.

    Returns Promise<Responses.Empty>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • filterChosenOption(question: Question): Responses.FormResponse<Requests.Option>
  • This function searches the chosen option for a given question.

    Parameters

    • question: Question

      The question.

    Returns Responses.FormResponse<Requests.Option>

    The option that corresponds with the given answer.

  • filterQuestion(form: Form, key: string): Responses.FormResponse<Requests.Question>
  • This function searches a question with a given key in the form.

    Parameters

    • form: Form

      The form with the answers.

    • key: string

      The key of the question.

    Returns Responses.FormResponse<Requests.Question>

    The question that corresponds with the given key.

  • getAlumni(form: Form): Promise<boolean>
  • Parse the form to the email of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<boolean>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getAppliedRoles(form: Form): Promise<string[]>
  • Parse the form to the roles of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string[]>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getBestSkill(form: Form): Promise<string>
  • Parse the form to the best skill this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getBirthName(form: Form): Promise<string>
  • Parse the form to the birth name of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getCV(form: Form): Promise<Responses.FormAttachmentResponse>
  • Parse the form to the cv of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<Responses.FormAttachmentResponse>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getEducationDuration(form: Form): Promise<number | null>
  • Parse the form to the duration of the education of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<number | null>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getEducationLevel(form: Form): Promise<string>
  • Parse the form to the education levels of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getEducationUniversity(form: Form): Promise<string | null>
  • Parse the form to the university of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string | null>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getEducationYear(form: Form): Promise<string | null>
  • Parse the form to the current year of the education of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string | null>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getEducations(form: Form): Promise<string[]>
  • Parse the form to the educations of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string[]>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getEmail(form: Form): Promise<string>
  • Parse the form to the email of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getEnglishLevel(form: Form): Promise<number>
  • Parse the form to the english level of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<number>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getFunFact(form: Form): Promise<string>
  • Parse the form to the fun fact of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getGender(form: Form): Promise<string>
  • Parse the form to the gender of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getLastName(form: Form): Promise<string>
  • Parse the form to the last name of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getMostFluentLanguage(form: Form): Promise<string>
  • Parse the form to the most fluent language of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getMotivation(form: Form): Promise<Responses.FormAttachmentResponse>
  • Parse the form to the motivation of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<Responses.FormAttachmentResponse>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getNickname(form: Form): Promise<string | null>
  • Parse the form to the email of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string | null>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getPhoneNumber(form: Form): Promise<string>
  • Parse the form to the phone number of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getPortfolio(form: Form): Promise<Responses.FormAttachmentResponse>
  • Parse the form to the portfolio of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<Responses.FormAttachmentResponse>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getPronouns(form: Form): Promise<string | null>
  • Parse the form to the pronouns of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string | null>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getResponsibilities(form: Form): Promise<string | null>
  • Parse the form to the responsibilities of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string | null>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • getRouter(): express.Router
  • Gets the router for all /form/ related endpoints.

    Returns express.Router

    An Express.js {@link express.Router} routing all /form/ endpoints.

  • getVolunteerInfo(form: Form): Promise<string>
  • Parse the form to the volunteer info of this student.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<string>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • isStudentCoach(form: Form, hasAlreadyParticipated: boolean): Promise<boolean | null>
  • Parse the form to the choice of being a student coach.

    Parameters

    • form: Form

      The form with the answers.

    • hasAlreadyParticipated: boolean

      true if the student from the job application has already taken part in osoc previous years

    Returns Promise<boolean | null>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • jsonToAttachments(form: Form): Promise<Responses.FormAttachment>
  • Attempts to parse the answers in the form into attachment entities.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<Responses.FormAttachment>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • jsonToJobApplication(form: Form, hasAlreadyTakenPart: boolean): Promise<Responses.FormJobApplication>
  • Attempts to parse the answers in the form into a job application entity.

    Parameters

    • form: Form

      The form with the answers.

    • hasAlreadyTakenPart: boolean

      true if the student has already taken part in osoc in a prev edition

    Returns Promise<Responses.FormJobApplication>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • jsonToPerson(form: Form): Promise<Responses.FormPerson>
  • Attempts to parse the answers in the form into a person entity.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<Responses.FormPerson>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • jsonToRoles(form: Form): Promise<Responses.FormRoles>
  • Attempts to parse the answers in the form into role entities.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<Responses.FormRoles>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • jsonToSkills(form: Form): Promise<Responses.FormJobApplicationSkill>
  • Attempts to parse the answers in the form into job application skills entities.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<Responses.FormJobApplicationSkill>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • jsonToStudent(form: Form): Promise<Responses.FormStudent>
  • Attempts to parse the answers in the form into a student entity.

    Parameters

    • form: Form

      The form with the answers.

    Returns Promise<Responses.FormStudent>

    See the API documentation. Successes are passed using Promise.resolve, failures using Promise.reject.

  • readFile(directoryPart: null | string, file: string): Promise<T.Requests.Form>
  • Parameters

    • directoryPart: null | string
    • file: string

    Returns Promise<T.Requests.Form>

Generated using TypeDoc