mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 19:59:37 +00:00
types: announcement consent & more detailed activity point typings
This commit is contained in:
parent
bfbad3559b
commit
10830190c8
1 changed files with 21 additions and 5 deletions
26
src/types.ts
26
src/types.ts
|
|
@ -112,15 +112,15 @@ export interface GetActivityOptions {
|
|||
|
||||
export interface ActivityPoint {
|
||||
id: number;
|
||||
type: string;
|
||||
polarity: "positive" | "blank" | "negative" | (string & {});
|
||||
type: "detention" | "notice" | "attendance_event" | "question" | "event" | "behaviour"
|
||||
polarity: "positive" | "blank" | "negative" | null;
|
||||
reason: string;
|
||||
score: number;
|
||||
timestamp: string;
|
||||
timestamp_custom_time: string | null;
|
||||
style: {
|
||||
border_color: string | null;
|
||||
custom_class: string | null;
|
||||
custom_class: "notice-color" | "colour-orange" | "colour-blue" | "colour-purple" | "colour-green" | null;
|
||||
};
|
||||
pupil_name: string;
|
||||
lesson_name: string | null;
|
||||
|
|
@ -364,6 +364,22 @@ export type DetentionsResponse = ClassChartsResponse<
|
|||
DetentionsMeta
|
||||
>;
|
||||
|
||||
export interface AnnouncementConsent {
|
||||
consent_given: "yes" | "no"
|
||||
comment: string | null
|
||||
parent_name: string
|
||||
}
|
||||
|
||||
export interface AnnouncementPupilConsent {
|
||||
pupil: {
|
||||
id: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
}
|
||||
can_change_consent: boolean
|
||||
consent: AnnouncementConsent | null
|
||||
}
|
||||
|
||||
export interface Announcement {
|
||||
id: number;
|
||||
title: string;
|
||||
|
|
@ -386,8 +402,8 @@ export interface Announcement {
|
|||
priority_pinned: "yes" | "no";
|
||||
requires_consent: "yes" | "no";
|
||||
can_change_consent: boolean;
|
||||
consent: unknown | null;
|
||||
pupil_consents: unknown[];
|
||||
consent: AnnouncementConsent | null;
|
||||
pupil_consents: AnnouncementPupilConsent[];
|
||||
}
|
||||
|
||||
export type AnnouncementsResponse = ClassChartsResponse<Announcement[], []>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue