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-09-09 20:45:29 +08:00
|
|
|
export interface LocationType {
|
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-09-20 19:36:06 +08:00
|
|
|
subject: string;
|
|
|
|
location: LocationType;
|
|
|
|
landmark: string | null;
|
|
|
|
active: boolean;
|
2023-09-28 21:03:04 +08:00
|
|
|
study_group: string;
|
2023-09-20 19:36:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface StudentStatusPatchType {
|
2023-08-10 17:23:12 +08:00
|
|
|
subject?: string;
|
2023-09-09 20:45:29 +08:00
|
|
|
location?: LocationType;
|
2023-08-10 17:23:12 +08:00
|
|
|
landmark?: string | null;
|
|
|
|
active?: boolean;
|
2023-09-28 21:03:04 +08:00
|
|
|
study_group?: string;
|
2023-08-10 17:23:12 +08:00
|
|
|
}
|
|
|
|
|
2023-09-06 18:13:43 +08:00
|
|
|
export interface StudentStatusFilterType {
|
|
|
|
active: boolean;
|
|
|
|
distance: number;
|
|
|
|
landmark: string | null;
|
2023-09-09 20:45:29 +08:00
|
|
|
location: LocationType;
|
2023-09-06 18:13:43 +08:00
|
|
|
study_group?: string;
|
|
|
|
subject: string;
|
|
|
|
user: string;
|
2023-09-09 20:45:29 +08:00
|
|
|
weight?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface StudentStatusFilterTypeFlattened {
|
|
|
|
active: boolean;
|
|
|
|
distance: number;
|
|
|
|
landmark: string | null;
|
|
|
|
latitude: Float;
|
|
|
|
longitude: Float;
|
|
|
|
study_group?: string;
|
|
|
|
subject: string;
|
|
|
|
user: string;
|
|
|
|
weight?: number;
|
2023-09-06 18:13:43 +08:00
|
|
|
}
|
|
|
|
|
2023-09-24 21:02:34 +08:00
|
|
|
export interface StudyGroupType {
|
|
|
|
name: string;
|
2023-09-28 21:03:04 +08:00
|
|
|
students: string[];
|
2023-09-24 21:02:34 +08:00
|
|
|
distance: number;
|
|
|
|
landmark: string | null;
|
|
|
|
location: LocationType;
|
|
|
|
subject: string;
|
|
|
|
radius: number;
|
|
|
|
}
|
2023-09-26 20:29:21 +08:00
|
|
|
|
|
|
|
export interface StudyGroupCreateType {
|
|
|
|
name: string;
|
|
|
|
location: LocationType;
|
|
|
|
subject: string;
|
|
|
|
}
|
|
|
|
|
2023-09-24 21:02:34 +08:00
|
|
|
export type StudyGroupReturnType = [boolean, StudyGroupType[]];
|
|
|
|
|
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-09-09 20:45:29 +08:00
|
|
|
export type RawLocationType = Location.LocationObject;
|
2023-08-10 17:23:12 +08:00
|
|
|
|
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];
|
2023-09-09 20:45:29 +08:00
|
|
|
|
|
|
|
export type subjectUserMapType = {
|
|
|
|
subject: string;
|
|
|
|
users: string[];
|
|
|
|
latitude: Float;
|
|
|
|
longitude: Float;
|
|
|
|
radius: Float;
|
|
|
|
};
|