StudE-Frontend/src/interfaces/Interfaces.tsx

152 lines
2.6 KiB
TypeScript
Raw Normal View History

export interface IconProps {
size: number;
2023-07-03 21:22:31 +08:00
}
export interface ResponsiveIconProps {
size: number;
color: string;
}
export interface RootDrawerParamList {
navigate: any;
}
// Redux Interfaces
export interface LoginState {
Login: { logged_in: boolean };
}
export interface LoggedInUserState {
LoggedInUser: {
value: {
email: string;
id: number;
username: string;
};
};
}
// API Interfaces
export interface RegistrationParams {
email: string;
username: string;
password: string;
2023-07-03 21:22:31 +08:00
first_name: string;
last_name: string;
student_id_number: string;
}
export interface LoginParams {
username: string;
password: string;
}
export interface ActivationParams {
uid: string;
token: string;
}
2023-07-18 17:20:11 +08:00
export interface OptionType {
label: string;
value: string;
}
// Semester
export interface Semester {
id: string;
name: string;
shortname: string;
}
2023-07-17 22:44:50 +08:00
export type Semesters = Array<Semester>;
export type SemesterParams = [boolean, Semesters];
// Year Level
export interface YearLevel {
id: string;
name: string;
shortname: string;
}
export type YearLevels = Array<YearLevel>;
export type YearLevelParams = [boolean, YearLevels];
// Course
export interface Course {
id: string;
name: string;
shortname: string;
}
export type Courses = Array<Course>;
export type CourseParams = [boolean, Courses];
2023-07-06 20:29:04 +08:00
// Subject
export interface Subject {
id: number;
name: string;
code: string;
course: string;
year_level: string;
semester: string;
}
2023-07-18 17:20:11 +08:00
export type Subjects = Array<Subject>;
export type SubjectParams = [boolean, Subjects];
2023-07-27 16:00:31 +08:00
export type avatar = {
uri: string;
type: string;
name: string;
};
2023-07-18 17:20:11 +08:00
// For dropdown menu
2023-07-06 20:29:04 +08:00
export interface OnboardingParams {
year_level: string;
course: string;
semester: string;
}
2023-07-17 15:10:44 +08:00
2023-07-17 18:45:25 +08:00
export interface PatchStudentData {
course?: string | null;
first_name?: string | null;
last_name?: string | null;
semester?: string | null;
subjects?: any[] | null; // To-do, replace 'any' with your actual type
year_level?: string | null;
irregular?: boolean | null;
2023-07-27 16:00:31 +08:00
avatar?: string | null;
2023-07-17 18:45:25 +08:00
}
2023-07-17 15:10:44 +08:00
export interface StudentData {
first_name: string;
last_name: string;
email: string;
avatar: string;
2023-07-17 15:10:44 +08:00
student_id_number: string;
irregular: boolean;
semester: string;
semester_shortname: string;
course: string;
course_shortname: string;
year_level: string;
yearlevel_shortname: string;
subjects: Subject[]; // To-do
2023-07-17 15:10:44 +08:00
username: string;
}
export type UserInfoParams = [boolean, StudentData];
interface Location {
latitude: number;
longtitude: number;
}
export interface StudentStatusParams {
subject?: string;
location?: Location;
active?: boolean;
}