diff --git a/src/api/models.ts b/src/api/models.ts index a981005..d5990f1 100644 --- a/src/api/models.ts +++ b/src/api/models.ts @@ -5,6 +5,9 @@ import type { CountryIsoCodes, UkCounties } from "../utils/general" // User Models // ----------------------------------------------------------------------------- +type _UserTeacher = Omit +type _UserStudent = Omit + export type User = Model< number, { @@ -17,41 +20,41 @@ export type User = Model< is_active: boolean date_joined: Date requesting_to_join_class?: Class["id"] - teacher?: Omit - student?: Omit + teacher?: _UserTeacher + student?: _UserStudent } > export type TeacherUser = Fields & { email: string last_name: string - teacher: NonNullable + teacher: _UserTeacher student?: undefined } export type SchoolTeacherUser = TeacherUser & { - teacher: Omit + teacher: _UserTeacher } export type AdminSchoolTeacherUser = SchoolTeacherUser & { - teacher: Omit + teacher: _UserTeacher } export type NonAdminSchoolTeacherUser = SchoolTeacherUser & { - teacher: Omit + teacher: _UserTeacher } export type NonSchoolTeacherUser = TeacherUser & { - teacher: Omit + teacher: _UserTeacher } export type StudentUser = Fields & { email?: undefined last_name?: undefined teacher?: undefined - student: NonNullable + student: _UserStudent } export type IndependentUser = Fields & {