2023-04-16 20:47:40 +01:00
|
|
|
/**
|
2023-04-29 23:34:36 +01:00
|
|
|
* Helper type to define response from ClassCharts
|
2023-04-16 20:47:40 +01:00
|
|
|
*/
|
2023-05-04 11:55:55 +01:00
|
|
|
export type ClassChartsResponse<Data, Meta> = {
|
2023-11-29 00:03:56 +00:00
|
|
|
data: Data;
|
|
|
|
|
meta: Meta;
|
|
|
|
|
error?: string;
|
|
|
|
|
success: number;
|
2023-04-07 13:47:08 +01:00
|
|
|
};
|
|
|
|
|
|
2021-10-28 20:40:04 +01:00
|
|
|
export interface Student {
|
2023-11-29 00:03:56 +00:00
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
first_name: string;
|
|
|
|
|
last_name: string;
|
|
|
|
|
avatar_url: string;
|
|
|
|
|
display_behaviour: boolean;
|
|
|
|
|
display_parent_behaviour: boolean;
|
|
|
|
|
display_homework: boolean;
|
|
|
|
|
display_rewards: boolean;
|
|
|
|
|
display_detentions: boolean;
|
|
|
|
|
display_report_cards: boolean;
|
|
|
|
|
display_classes: boolean;
|
|
|
|
|
display_announcements: boolean;
|
|
|
|
|
display_attendance: boolean;
|
|
|
|
|
display_attendance_type: string;
|
|
|
|
|
display_attendance_percentage: boolean;
|
|
|
|
|
display_activity: boolean;
|
|
|
|
|
display_mental_health: boolean;
|
|
|
|
|
display_timetable: boolean;
|
|
|
|
|
is_disabled: boolean;
|
|
|
|
|
display_two_way_communications: boolean;
|
|
|
|
|
display_absences: boolean;
|
|
|
|
|
can_upload_attachments: boolean | null;
|
|
|
|
|
display_event_badges: boolean;
|
|
|
|
|
display_avatars: boolean;
|
|
|
|
|
display_concern_submission: boolean;
|
|
|
|
|
display_custom_fields: boolean;
|
|
|
|
|
pupil_concerns_help_text: string;
|
|
|
|
|
allow_pupils_add_timetable_notes: boolean;
|
|
|
|
|
announcements_count: number;
|
|
|
|
|
messages_count: number;
|
|
|
|
|
pusher_channel_name: string;
|
|
|
|
|
has_birthday: boolean;
|
|
|
|
|
has_new_survey: boolean;
|
|
|
|
|
survey_id: number | null;
|
|
|
|
|
detention_alias_plural_uc: string;
|
2021-10-28 16:51:07 +01:00
|
|
|
}
|
2023-04-16 20:47:40 +01:00
|
|
|
export interface GetStudentInfoData {
|
2023-11-29 00:03:56 +00:00
|
|
|
user: Student;
|
2023-04-07 13:47:08 +01:00
|
|
|
}
|
|
|
|
|
|
2023-04-16 20:47:40 +01:00
|
|
|
export interface GetStudentInfoMeta {
|
2023-11-29 00:03:56 +00:00
|
|
|
version: string;
|
2023-04-07 13:47:08 +01:00
|
|
|
}
|
|
|
|
|
export type GetStudentInfoResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
GetStudentInfoData,
|
|
|
|
|
GetStudentInfoMeta
|
2023-04-07 13:47:08 +01:00
|
|
|
>;
|
|
|
|
|
|
2022-02-06 11:13:23 +00:00
|
|
|
export interface GetBehaviourOptions {
|
2023-11-29 00:03:56 +00:00
|
|
|
/**
|
|
|
|
|
* From date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
from?: string;
|
|
|
|
|
/**
|
|
|
|
|
* To date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
to?: string;
|
2021-10-28 20:40:04 +01:00
|
|
|
}
|
2023-04-07 13:47:08 +01:00
|
|
|
|
2022-02-06 11:13:23 +00:00
|
|
|
export interface BehaviourTimelinePoint {
|
2023-11-29 00:03:56 +00:00
|
|
|
positive: number;
|
|
|
|
|
negative: number;
|
|
|
|
|
name: string;
|
|
|
|
|
start: string;
|
|
|
|
|
end: string;
|
2021-10-28 20:40:04 +01:00
|
|
|
}
|
2023-04-16 20:47:40 +01:00
|
|
|
export interface BehaviourResponseData {
|
2024-01-10 10:57:33 +00:00
|
|
|
timeline: BehaviourTimelinePoint[];
|
2023-11-29 00:03:56 +00:00
|
|
|
positive_reasons: Record<string, number>;
|
|
|
|
|
negative_reasons: Record<string, number>;
|
2024-01-10 10:57:33 +00:00
|
|
|
other_positive: string[];
|
|
|
|
|
other_negative: string[];
|
|
|
|
|
other_positive_count: Record<string, number>[];
|
|
|
|
|
other_negative_count: Record<string, number>[];
|
2021-10-28 20:40:04 +01:00
|
|
|
}
|
2023-04-16 20:47:40 +01:00
|
|
|
export interface BehaviourResponseMeta {
|
2023-11-29 00:03:56 +00:00
|
|
|
start_date: string;
|
|
|
|
|
end_date: string;
|
|
|
|
|
step_size: string;
|
2023-04-07 13:47:08 +01:00
|
|
|
}
|
|
|
|
|
export type BehaviourResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
BehaviourResponseData,
|
|
|
|
|
BehaviourResponseMeta
|
2023-04-07 13:47:08 +01:00
|
|
|
>;
|
|
|
|
|
|
2022-02-06 11:13:23 +00:00
|
|
|
export interface GetActivityOptions {
|
2023-11-29 00:03:56 +00:00
|
|
|
/**
|
|
|
|
|
* From date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
from?: string;
|
|
|
|
|
/**
|
|
|
|
|
* To date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
to?: string;
|
|
|
|
|
/**
|
|
|
|
|
* ID of the last activityPoint (used in pagination)
|
|
|
|
|
*/
|
|
|
|
|
last_id?: string;
|
2021-10-28 20:40:04 +01:00
|
|
|
}
|
2023-04-07 13:47:08 +01:00
|
|
|
|
2022-02-06 11:13:23 +00:00
|
|
|
export interface ActivityPoint {
|
2023-11-29 00:03:56 +00:00
|
|
|
id: number;
|
|
|
|
|
type: string;
|
2024-05-28 13:39:04 +01:00
|
|
|
polarity: "positive" | "blank" | "negative" | (string & {});
|
2023-11-29 00:03:56 +00:00
|
|
|
reason: string;
|
|
|
|
|
score: number;
|
|
|
|
|
timestamp: string;
|
|
|
|
|
timestamp_custom_time: string | null;
|
|
|
|
|
style: {
|
|
|
|
|
border_color: string | null;
|
|
|
|
|
custom_class: string | null;
|
|
|
|
|
};
|
|
|
|
|
pupil_name: string;
|
|
|
|
|
lesson_name: string | null;
|
2024-05-28 13:33:56 +01:00
|
|
|
teacher_name: string | null;
|
2023-11-29 00:03:56 +00:00
|
|
|
room_name: string | null;
|
|
|
|
|
note: string | null;
|
|
|
|
|
_can_delete: boolean;
|
2024-05-28 13:33:56 +01:00
|
|
|
badges: string;
|
2023-11-29 00:03:56 +00:00
|
|
|
detention_date: string | null;
|
|
|
|
|
detention_time: string | null;
|
|
|
|
|
detention_location: string | null;
|
|
|
|
|
detention_type: string | null;
|
2021-10-28 20:40:04 +01:00
|
|
|
}
|
2024-01-10 10:57:33 +00:00
|
|
|
export type ActivityResponseData = ActivityPoint[];
|
2023-04-07 13:47:08 +01:00
|
|
|
interface ActivityResponseMeta {
|
2023-11-29 00:03:56 +00:00
|
|
|
start_date: string;
|
|
|
|
|
end_date: string;
|
|
|
|
|
last_id: number | boolean;
|
|
|
|
|
step_size: string;
|
|
|
|
|
detention_alias_uc: string;
|
2023-04-07 13:47:08 +01:00
|
|
|
}
|
|
|
|
|
export type ActivityResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
ActivityResponseData,
|
|
|
|
|
ActivityResponseMeta
|
2023-04-07 13:47:08 +01:00
|
|
|
>;
|
|
|
|
|
|
2022-01-31 22:32:29 +00:00
|
|
|
export type DisplayDate = "due_date" | "issue_date";
|
2021-10-28 20:40:04 +01:00
|
|
|
export interface GetHomeworkOptions {
|
2023-11-29 00:03:56 +00:00
|
|
|
/**
|
|
|
|
|
* Way to sort homeworks
|
|
|
|
|
*
|
|
|
|
|
* Used to sort homeworks by when they are due or when they were issued
|
|
|
|
|
* @default "issue_date"
|
|
|
|
|
*/
|
|
|
|
|
displayDate?: DisplayDate;
|
|
|
|
|
/**
|
|
|
|
|
* From date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
from?: string;
|
|
|
|
|
/**
|
|
|
|
|
* To date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
to?: string;
|
2021-10-28 20:40:04 +01:00
|
|
|
}
|
2024-05-28 14:07:55 +01:00
|
|
|
|
|
|
|
|
export interface TeacherValidatedHomeworkAttachment {
|
2023-11-29 00:03:56 +00:00
|
|
|
id: number;
|
|
|
|
|
file_name: string;
|
|
|
|
|
file: string;
|
|
|
|
|
validated_file: string;
|
2022-01-31 22:44:31 +00:00
|
|
|
}
|
2024-05-28 14:07:55 +01:00
|
|
|
|
|
|
|
|
export interface TeacherValidatedHomeworkLink {
|
2024-05-28 13:39:04 +01:00
|
|
|
link: string;
|
|
|
|
|
validated_link: string;
|
2024-05-28 13:33:56 +01:00
|
|
|
}
|
2024-05-28 14:07:55 +01:00
|
|
|
|
2024-05-28 13:33:56 +01:00
|
|
|
export interface StudentHomeworkAttachment {
|
2024-05-28 13:39:04 +01:00
|
|
|
id: number;
|
|
|
|
|
file_name: string;
|
|
|
|
|
file: string;
|
|
|
|
|
validated_file: string;
|
|
|
|
|
teacher_note: string;
|
|
|
|
|
teacher_homework_attachments: unknown[];
|
|
|
|
|
can_delete: boolean;
|
2024-05-28 13:33:56 +01:00
|
|
|
}
|
2021-10-28 16:51:07 +01:00
|
|
|
export interface Homework {
|
2023-11-29 00:03:56 +00:00
|
|
|
lesson: string;
|
|
|
|
|
subject: string;
|
|
|
|
|
teacher: string;
|
|
|
|
|
homework_type: string;
|
|
|
|
|
id: number;
|
|
|
|
|
title: string;
|
|
|
|
|
meta_title: string;
|
|
|
|
|
description: string;
|
|
|
|
|
issue_date: string;
|
|
|
|
|
due_date: string;
|
|
|
|
|
completion_time_unit: string;
|
|
|
|
|
completion_time_value: string;
|
|
|
|
|
publish_time: string;
|
|
|
|
|
status: {
|
|
|
|
|
id: number;
|
|
|
|
|
state: "not_completed" | "late" | "completed" | null;
|
|
|
|
|
mark: unknown | null;
|
|
|
|
|
mark_relative: number;
|
|
|
|
|
ticked: "yes" | "no";
|
|
|
|
|
allow_attachments: boolean;
|
2024-05-28 13:39:04 +01:00
|
|
|
allow_marking_completed: boolean;
|
2023-11-29 00:03:56 +00:00
|
|
|
first_seen_date: string | null;
|
|
|
|
|
last_seen_date: string | null;
|
2024-05-28 13:39:04 +01:00
|
|
|
attachments: StudentHomeworkAttachment[];
|
2023-11-29 00:03:56 +00:00
|
|
|
has_feedback: boolean;
|
|
|
|
|
};
|
2024-05-28 14:07:55 +01:00
|
|
|
validated_links: TeacherValidatedHomeworkLink[];
|
|
|
|
|
validated_attachments: TeacherValidatedHomeworkAttachment[];
|
2021-10-28 16:51:07 +01:00
|
|
|
}
|
2024-01-10 10:57:33 +00:00
|
|
|
export type HomeworksResponseData = Homework[];
|
2023-04-16 20:47:40 +01:00
|
|
|
export interface HomeworksResponseMeta {
|
2023-11-29 00:03:56 +00:00
|
|
|
start_date: string;
|
|
|
|
|
end_date: string;
|
|
|
|
|
display_type: DisplayDate;
|
|
|
|
|
max_files_allowed: number;
|
|
|
|
|
allowed_file_types: string[];
|
|
|
|
|
this_week_due_count: number;
|
|
|
|
|
this_week_outstanding_count: number;
|
|
|
|
|
this_week_completed_count: number;
|
|
|
|
|
allow_attachments: boolean;
|
|
|
|
|
display_marks: boolean;
|
2023-04-07 13:47:08 +01:00
|
|
|
}
|
|
|
|
|
export type HomeworksResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
HomeworksResponseData,
|
|
|
|
|
HomeworksResponseMeta
|
2023-04-07 13:47:08 +01:00
|
|
|
>;
|
|
|
|
|
|
2021-10-28 20:40:04 +01:00
|
|
|
export interface GetLessonsOptions {
|
2023-11-29 00:03:56 +00:00
|
|
|
/**
|
|
|
|
|
* Date to get lessons for, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
date: string;
|
2021-10-28 20:40:04 +01:00
|
|
|
}
|
|
|
|
|
export interface Lesson {
|
2023-11-29 00:03:56 +00:00
|
|
|
teacher_name: string;
|
2024-05-28 13:33:56 +01:00
|
|
|
teacher_id: string;
|
2023-11-29 00:03:56 +00:00
|
|
|
lesson_name: string;
|
|
|
|
|
subject_name: string;
|
|
|
|
|
is_alternative_lesson: boolean;
|
|
|
|
|
period_name: string;
|
|
|
|
|
period_number: string;
|
|
|
|
|
room_name: string;
|
|
|
|
|
date: string;
|
|
|
|
|
start_time: string;
|
|
|
|
|
end_time: string;
|
|
|
|
|
key: number;
|
|
|
|
|
note_abstract: string;
|
|
|
|
|
note: string;
|
|
|
|
|
pupil_note_abstract: string;
|
|
|
|
|
pupil_note: string;
|
|
|
|
|
pupil_note_raw: string;
|
2021-10-28 20:40:04 +01:00
|
|
|
}
|
2023-04-16 20:47:40 +01:00
|
|
|
export type LessonsResponseData = Lesson[];
|
2023-04-07 13:47:08 +01:00
|
|
|
interface PeriodMeta {
|
2023-11-29 00:03:56 +00:00
|
|
|
number: string;
|
|
|
|
|
start_time: string;
|
|
|
|
|
end_time: string;
|
2023-04-07 13:47:08 +01:00
|
|
|
}
|
2023-04-16 20:47:40 +01:00
|
|
|
export interface LessonsResponseMeta {
|
2023-11-29 00:03:56 +00:00
|
|
|
dates: string[];
|
|
|
|
|
timetable_dates: string[];
|
|
|
|
|
periods: PeriodMeta[];
|
|
|
|
|
start_time: string;
|
|
|
|
|
end_time: string;
|
2023-04-07 13:47:08 +01:00
|
|
|
}
|
|
|
|
|
export type LessonsResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
LessonsResponseData,
|
|
|
|
|
LessonsResponseMeta
|
2023-04-07 13:47:08 +01:00
|
|
|
>;
|
|
|
|
|
|
2022-01-31 23:13:05 +00:00
|
|
|
export interface LessonPupilBehaviour {
|
2023-11-29 00:03:56 +00:00
|
|
|
reason: string;
|
|
|
|
|
score: number;
|
|
|
|
|
icon: string;
|
|
|
|
|
polarity: string;
|
|
|
|
|
timestamp: string;
|
|
|
|
|
teacher: {
|
|
|
|
|
title: string;
|
|
|
|
|
first_name: string;
|
|
|
|
|
last_name: string;
|
|
|
|
|
};
|
2022-01-31 23:13:05 +00:00
|
|
|
}
|
|
|
|
|
export interface PupilEvent {
|
2023-11-29 00:03:56 +00:00
|
|
|
timestamp: string;
|
|
|
|
|
lesson_pupil_behaviour: LessonPupilBehaviour;
|
|
|
|
|
event: {
|
|
|
|
|
label: string;
|
|
|
|
|
};
|
2022-01-31 23:13:05 +00:00
|
|
|
}
|
|
|
|
|
export interface Badge {
|
2023-11-29 00:03:56 +00:00
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
icon: string;
|
|
|
|
|
colour: string;
|
|
|
|
|
created_date: string;
|
2024-05-28 13:33:56 +01:00
|
|
|
pupil_badges: { pupil_event: PupilEvent }[];
|
2023-11-29 00:03:56 +00:00
|
|
|
icon_url: string;
|
2022-01-31 23:13:05 +00:00
|
|
|
}
|
2024-01-10 10:57:33 +00:00
|
|
|
export type BadgesResponseData = Badge[];
|
2023-04-16 20:47:40 +01:00
|
|
|
export type BadgesResponseMeta = [];
|
2023-04-07 13:47:08 +01:00
|
|
|
export type BadgesResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
BadgesResponseData,
|
|
|
|
|
BadgesResponseMeta
|
2023-04-07 13:47:08 +01:00
|
|
|
>;
|
2022-02-06 10:32:35 +00:00
|
|
|
|
|
|
|
|
export interface Detention {
|
2023-11-29 00:03:56 +00:00
|
|
|
id: number;
|
|
|
|
|
attended: "yes" | "no" | "upscaled" | "pending";
|
|
|
|
|
date: string | null;
|
|
|
|
|
length: number | null;
|
|
|
|
|
location: string | null;
|
|
|
|
|
notes: string | null;
|
|
|
|
|
time: string | null;
|
|
|
|
|
pupil: {
|
|
|
|
|
id: number;
|
|
|
|
|
first_name: string;
|
|
|
|
|
last_name: string;
|
|
|
|
|
school: {
|
|
|
|
|
opt_notes_names: "yes" | "no";
|
|
|
|
|
opt_notes_comments: "yes" | "no";
|
|
|
|
|
opt_notes_comments_pupils: "yes" | "no";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
lesson: {
|
|
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
subject: {
|
|
|
|
|
id: number;
|
|
|
|
|
name: string;
|
2024-05-28 13:33:56 +01:00
|
|
|
} | null;
|
2023-11-29 00:03:56 +00:00
|
|
|
} | null;
|
|
|
|
|
lesson_pupil_behaviour: {
|
|
|
|
|
reason: string;
|
|
|
|
|
};
|
|
|
|
|
teacher: {
|
|
|
|
|
id: number;
|
|
|
|
|
first_name: string;
|
|
|
|
|
last_name: string;
|
|
|
|
|
title: string;
|
|
|
|
|
} | null;
|
|
|
|
|
detention_type: {
|
|
|
|
|
name: string;
|
|
|
|
|
};
|
2022-02-06 10:32:35 +00:00
|
|
|
}
|
2023-09-18 20:46:50 +01:00
|
|
|
|
2024-01-10 10:57:33 +00:00
|
|
|
export type DetentionsData = Detention[];
|
2023-09-18 20:46:50 +01:00
|
|
|
|
|
|
|
|
export interface DetentionsMeta {
|
2023-11-29 00:03:56 +00:00
|
|
|
detention_alias_plural: string;
|
2023-09-18 20:46:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type DetentionsResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
DetentionsData,
|
|
|
|
|
DetentionsMeta
|
2023-09-18 20:46:50 +01:00
|
|
|
>;
|
2022-02-06 15:14:48 +00:00
|
|
|
|
2022-02-06 15:45:28 +00:00
|
|
|
export interface Announcement {
|
2023-11-29 00:03:56 +00:00
|
|
|
id: number;
|
|
|
|
|
title: string;
|
|
|
|
|
description: string | null;
|
|
|
|
|
school_name: string;
|
|
|
|
|
teacher_name: string;
|
|
|
|
|
school_logo: string | null;
|
|
|
|
|
sticky: "yes" | "no";
|
|
|
|
|
state: string | null;
|
|
|
|
|
timestamp: string;
|
2024-01-10 10:57:33 +00:00
|
|
|
attachments: {
|
2023-11-29 00:03:56 +00:00
|
|
|
filename: string;
|
|
|
|
|
url: string;
|
2024-01-10 10:57:33 +00:00
|
|
|
}[];
|
|
|
|
|
for_pupils: unknown[];
|
2023-11-29 00:03:56 +00:00
|
|
|
comment_visibility: string;
|
|
|
|
|
allow_comments: "yes" | "no";
|
|
|
|
|
allow_reactions: "yes" | "no";
|
|
|
|
|
allow_consent: "yes" | "no";
|
|
|
|
|
priority_pinned: "yes" | "no";
|
|
|
|
|
requires_consent: "yes" | "no";
|
|
|
|
|
can_change_consent: boolean;
|
|
|
|
|
consent: unknown | null;
|
2024-01-10 10:57:33 +00:00
|
|
|
pupil_consents: unknown[];
|
2022-02-06 15:14:48 +00:00
|
|
|
}
|
|
|
|
|
|
2024-05-28 13:39:04 +01:00
|
|
|
export type AnnouncementsResponse = ClassChartsResponse<Announcement[], []>;
|
2022-03-12 11:34:56 +00:00
|
|
|
|
|
|
|
|
export interface Pupil extends Student {
|
2023-11-29 00:03:56 +00:00
|
|
|
school_name: string;
|
|
|
|
|
school_logo: string;
|
|
|
|
|
timezone: string;
|
|
|
|
|
display_covid_tests: boolean;
|
|
|
|
|
can_record_covid_tests: boolean;
|
|
|
|
|
detention_yes_count: number;
|
|
|
|
|
detention_no_count: number;
|
|
|
|
|
detention_pending_count: number;
|
|
|
|
|
detention_upscaled_count: number;
|
|
|
|
|
homework_todo_count: number;
|
|
|
|
|
homework_late_count: number;
|
|
|
|
|
homework_not_completed_count: number;
|
|
|
|
|
homework_excused_count: number;
|
|
|
|
|
homework_completed_count: number;
|
|
|
|
|
homework_submitted_count: number;
|
|
|
|
|
announcements_count: number;
|
|
|
|
|
messages_count: number;
|
2022-03-12 11:34:56 +00:00
|
|
|
}
|
2024-01-10 10:57:33 +00:00
|
|
|
export type GetPupilsResponse = Pupil[];
|
2022-04-02 12:11:04 +01:00
|
|
|
|
|
|
|
|
export interface GetFullActivityOptions {
|
2023-11-29 00:03:56 +00:00
|
|
|
/**
|
|
|
|
|
* From date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
from: string;
|
|
|
|
|
/**
|
|
|
|
|
* To date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
to: string;
|
2022-05-24 22:52:57 +01:00
|
|
|
}
|
2022-05-25 18:18:31 +01:00
|
|
|
|
2022-06-24 13:15:13 +01:00
|
|
|
export interface GetAttendanceOptions {
|
2023-11-29 00:03:56 +00:00
|
|
|
/**
|
|
|
|
|
* From date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
from: string;
|
|
|
|
|
/**
|
|
|
|
|
* To date, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
to: string;
|
2022-06-24 13:15:13 +01:00
|
|
|
}
|
|
|
|
|
|
2023-09-15 19:02:16 +01:00
|
|
|
export interface AttendancePeriod {
|
2023-11-29 00:03:56 +00:00
|
|
|
code: string;
|
2024-05-28 13:39:04 +01:00
|
|
|
status: "present" | "ignore" | (string & {});
|
2023-11-29 00:03:56 +00:00
|
|
|
late_minutes: number | string;
|
|
|
|
|
lesson_name?: string;
|
|
|
|
|
room_name?: string;
|
2022-05-25 18:18:31 +01:00
|
|
|
}
|
2023-09-15 19:02:16 +01:00
|
|
|
|
|
|
|
|
export interface AttendanceMeta {
|
2024-01-10 10:57:33 +00:00
|
|
|
dates: string[];
|
|
|
|
|
sessions: string[];
|
2023-11-29 00:03:56 +00:00
|
|
|
start_date: string;
|
|
|
|
|
end_date: string;
|
|
|
|
|
percentage: string;
|
|
|
|
|
percentage_singe_august: string;
|
2023-09-15 19:02:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type AttendanceData = Record<string, Record<string, AttendancePeriod>>;
|
|
|
|
|
|
|
|
|
|
export type AttendanceResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
AttendanceData,
|
|
|
|
|
AttendanceMeta
|
2023-09-15 19:02:16 +01:00
|
|
|
>;
|
2023-09-18 20:46:50 +01:00
|
|
|
|
|
|
|
|
export type RewardsData = {
|
2023-11-29 00:03:56 +00:00
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
description: string;
|
|
|
|
|
photo: string;
|
|
|
|
|
price: number;
|
|
|
|
|
stock_control: boolean;
|
|
|
|
|
stock: number;
|
|
|
|
|
can_purchase: boolean;
|
|
|
|
|
unable_to_purchase_reason: string;
|
|
|
|
|
once_per_pupil: boolean;
|
|
|
|
|
purchased: boolean;
|
|
|
|
|
purchased_count: string | number;
|
|
|
|
|
price_balance_difference: number;
|
2023-09-18 20:46:50 +01:00
|
|
|
}[];
|
|
|
|
|
|
|
|
|
|
export interface RewardsMeta {
|
2023-11-29 00:03:56 +00:00
|
|
|
pupil_score_balance: number;
|
2023-09-18 20:46:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type RewardsResponse = ClassChartsResponse<RewardsData, RewardsMeta>;
|
|
|
|
|
|
|
|
|
|
export interface RewardPurchaseData {
|
2023-11-29 00:03:56 +00:00
|
|
|
single_purchase: "yes" | "no";
|
|
|
|
|
order_id: number;
|
|
|
|
|
balance: number;
|
2023-09-18 20:46:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type RewardPurchaseResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
RewardPurchaseData,
|
|
|
|
|
[]
|
2023-09-18 20:46:50 +01:00
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
export interface PupilFieldsData {
|
2023-11-29 00:03:56 +00:00
|
|
|
note: string;
|
2024-01-10 10:57:33 +00:00
|
|
|
fields: {
|
2023-11-29 00:03:56 +00:00
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
graphic: string;
|
|
|
|
|
value: string;
|
2024-01-10 10:57:33 +00:00
|
|
|
}[];
|
2023-09-18 20:46:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type PupilFieldsResponse = ClassChartsResponse<PupilFieldsData, []>;
|
2023-09-24 21:17:15 +01:00
|
|
|
|
2023-10-08 21:02:01 +01:00
|
|
|
export type ChangePasswordResponse = ClassChartsResponse<[], []>;
|
|
|
|
|
|
2023-09-24 21:17:15 +01:00
|
|
|
export interface GetStudentCodeOptions {
|
2023-11-29 00:03:56 +00:00
|
|
|
/**
|
|
|
|
|
* Date of birth, in format YYYY-MM-DD
|
|
|
|
|
*/
|
|
|
|
|
dateOfBirth: string;
|
2023-09-24 21:17:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface GetStudentCodeResponseData {
|
2023-11-29 00:03:56 +00:00
|
|
|
code: string;
|
2023-09-24 21:17:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type GetStudentCodeResponseMeta = [];
|
|
|
|
|
export type GetStudentCodeResponse = ClassChartsResponse<
|
2023-11-29 00:03:56 +00:00
|
|
|
GetStudentCodeResponseData,
|
|
|
|
|
GetStudentCodeResponseMeta
|
2023-09-24 21:17:15 +01:00
|
|
|
>;
|