mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 11:58:13 +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 {
|
export interface ActivityPoint {
|
||||||
id: number;
|
id: number;
|
||||||
type: string;
|
type: "detention" | "notice" | "attendance_event" | "question" | "event" | "behaviour"
|
||||||
polarity: "positive" | "blank" | "negative" | (string & {});
|
polarity: "positive" | "blank" | "negative" | null;
|
||||||
reason: string;
|
reason: string;
|
||||||
score: number;
|
score: number;
|
||||||
timestamp: string;
|
timestamp: string;
|
||||||
timestamp_custom_time: string | null;
|
timestamp_custom_time: string | null;
|
||||||
style: {
|
style: {
|
||||||
border_color: string | null;
|
border_color: string | null;
|
||||||
custom_class: string | null;
|
custom_class: "notice-color" | "colour-orange" | "colour-blue" | "colour-purple" | "colour-green" | null;
|
||||||
};
|
};
|
||||||
pupil_name: string;
|
pupil_name: string;
|
||||||
lesson_name: string | null;
|
lesson_name: string | null;
|
||||||
|
|
@ -364,6 +364,22 @@ export type DetentionsResponse = ClassChartsResponse<
|
||||||
DetentionsMeta
|
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 {
|
export interface Announcement {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
|
|
@ -386,8 +402,8 @@ export interface Announcement {
|
||||||
priority_pinned: "yes" | "no";
|
priority_pinned: "yes" | "no";
|
||||||
requires_consent: "yes" | "no";
|
requires_consent: "yes" | "no";
|
||||||
can_change_consent: boolean;
|
can_change_consent: boolean;
|
||||||
consent: unknown | null;
|
consent: AnnouncementConsent | null;
|
||||||
pupil_consents: unknown[];
|
pupil_consents: AnnouncementPupilConsent[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AnnouncementsResponse = ClassChartsResponse<Announcement[], []>;
|
export type AnnouncementsResponse = ClassChartsResponse<Announcement[], []>;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue