2023-08-07 14:55:44 +08:00
|
|
|
import * as Location from "expo-location";
|
2023-08-15 14:15:33 +08:00
|
|
|
import { GetStudentStatus } from "../components/Api/Api";
|
2023-09-06 18:13:43 +08:00
|
|
|
import { Float } from "react-native/Libraries/Types/CodegenTypes";
|
2023-08-07 14:55:44 +08:00
|
|
|
|
2023-07-03 16:18:39 +08:00
|
|
|
export interface IconProps {
|
|
|
|
size: number;
|
2023-07-03 21:22:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ResponsiveIconProps {
|
|
|
|
size: number;
|
2023-07-03 16:18:39 +08:00
|
|
|
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
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface RegistrationType {
|
2023-07-03 16:18:39 +08:00
|
|
|
email: string;
|
|
|
|
username: string;
|
|
|
|
password: string;
|
2023-07-03 21:22:31 +08:00
|
|
|
first_name: string;
|
|
|
|
last_name: string;
|
|
|
|
student_id_number: string;
|
2023-07-03 16:18:39 +08:00
|
|
|
}
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface LoginType {
|
2023-07-03 16:18:39 +08:00
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
}
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface ActivationType {
|
2023-07-03 16:18:39 +08:00
|
|
|
uid: string;
|
|
|
|
token: string;
|
|
|
|
}
|
2023-07-06 17:19:19 +08:00
|
|
|
|
2023-07-18 17:20:11 +08:00
|
|
|
export interface OptionType {
|
|
|
|
label: string;
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
2023-07-18 00:33:02 +08:00
|
|
|
// Semester
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface SemesterType {
|
2023-07-06 17:19:19 +08:00
|
|
|
id: string;
|
|
|
|
name: string;
|
|
|
|
shortname: string;
|
|
|
|
}
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export type SemestersType = Array<SemesterType>;
|
2023-07-17 22:44:50 +08:00
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export type SemesterReturnType = [boolean, SemestersType];
|
2023-07-17 15:57:23 +08:00
|
|
|
|
2023-07-18 00:33:02 +08:00
|
|
|
// Year Level
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface YearLevelType {
|
2023-07-06 17:19:19 +08:00
|
|
|
id: string;
|
|
|
|
name: string;
|
|
|
|
shortname: string;
|
|
|
|
}
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export type YearLevelsType = Array<YearLevelType>;
|
2023-07-17 15:57:23 +08:00
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export type YearLevelReturnType = [boolean, YearLevelsType];
|
2023-07-18 00:33:02 +08:00
|
|
|
|
|
|
|
// Course
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface CourseType {
|
2023-07-06 17:19:19 +08:00
|
|
|
id: string;
|
|
|
|
name: string;
|
|
|
|
shortname: string;
|
|
|
|
}
|
2023-08-14 23:29:53 +08:00
|
|
|
export type CoursesType = Array<CourseType>;
|
|
|
|
export type CourseReturnType = [boolean, CoursesType];
|
2023-07-06 20:29:04 +08:00
|
|
|
|
2023-07-18 00:33:02 +08:00
|
|
|
// Subject
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface SubjectType {
|
2023-07-27 00:01:44 +08:00
|
|
|
id: number;
|
2023-07-18 00:33:02 +08:00
|
|
|
name: string;
|
|
|
|
code: string;
|
2023-07-27 00:01:44 +08:00
|
|
|
course: string;
|
|
|
|
year_level: string;
|
|
|
|
semester: string;
|
2023-07-18 00:33:02 +08:00
|
|
|
}
|
2023-07-18 17:20:11 +08:00
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export type SubjectsType = Array<SubjectType>;
|
|
|
|
export type SubjectsReturnType = [boolean, SubjectsType];
|
2023-07-17 15:57:23 +08:00
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export type AvatarType = {
|
2023-07-27 16:00:31 +08:00
|
|
|
uri: string;
|
|
|
|
type: string;
|
|
|
|
name: string;
|
|
|
|
};
|
2023-07-18 17:20:11 +08:00
|
|
|
// For dropdown menu
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface OnboardingType {
|
2023-07-06 20:29:04 +08:00
|
|
|
year_level: string;
|
|
|
|
course: string;
|
|
|
|
semester: string;
|
|
|
|
}
|
2023-07-17 15:10:44 +08:00
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface PatchUserInfoType {
|
|
|
|
course?: string;
|
|
|
|
first_name?: string;
|
|
|
|
last_name?: string;
|
|
|
|
semester?: string;
|
|
|
|
subjects?: string[];
|
|
|
|
year_level?: string;
|
|
|
|
irregular?: boolean;
|
|
|
|
avatar?: string;
|
2023-07-17 18:45:25 +08:00
|
|
|
}
|
|
|
|
|
2023-08-10 17:23:12 +08:00
|
|
|
interface Location {
|
2023-09-06 18:13:43 +08:00
|
|
|
latitude: Float;
|
|
|
|
longitude: Float;
|
2023-08-10 17:23:12 +08:00
|
|
|
}
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface StudentStatusType {
|
2023-08-10 17:23:12 +08:00
|
|
|
user?: string;
|
|
|
|
subject?: string;
|
|
|
|
location?: Location;
|
|
|
|
landmark?: string | null;
|
|
|
|
active?: boolean;
|
|
|
|
}
|
|
|
|
|
2023-09-06 18:13:43 +08:00
|
|
|
export interface StudentStatusFilterType {
|
|
|
|
active: boolean;
|
|
|
|
distance: number;
|
|
|
|
landmark: string | null;
|
|
|
|
location: Location;
|
|
|
|
study_group?: string;
|
|
|
|
subject: string;
|
|
|
|
user: string;
|
|
|
|
}
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export type StudentStatusReturnType = [boolean, StudentStatusType];
|
2023-08-10 17:23:12 +08:00
|
|
|
|
2023-09-06 18:13:43 +08:00
|
|
|
export type StudentStatusListType = Array<StudentStatusFilterType>;
|
2023-08-15 14:15:33 +08:00
|
|
|
export type StudentStatusListReturnType = [boolean, StudentStatusListType];
|
|
|
|
|
2023-08-10 17:23:12 +08:00
|
|
|
export type LocationType = Location.LocationObject;
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export interface UserInfoType {
|
2023-07-17 15:10:44 +08:00
|
|
|
first_name: string;
|
|
|
|
last_name: string;
|
2023-07-18 00:33:02 +08:00
|
|
|
email: string;
|
|
|
|
avatar: string;
|
2023-07-17 15:10:44 +08:00
|
|
|
student_id_number: string;
|
2023-07-27 00:01:44 +08:00
|
|
|
irregular: boolean;
|
2023-07-18 00:33:02 +08:00
|
|
|
semester: string;
|
|
|
|
semester_shortname: string;
|
|
|
|
course: string;
|
|
|
|
course_shortname: string;
|
|
|
|
year_level: string;
|
|
|
|
yearlevel_shortname: string;
|
2023-08-10 17:23:12 +08:00
|
|
|
subjects: string[];
|
2023-07-17 15:10:44 +08:00
|
|
|
username: string;
|
|
|
|
}
|
|
|
|
|
2023-08-14 23:29:53 +08:00
|
|
|
export type UserInfoReturnType = [boolean, UserInfoType];
|