Created
July 8, 2025 13:04
-
-
Save emmanuelekopimo/fd75aad608cdb4b64d519e0a330a797b to your computer and use it in GitHub Desktop.
All the types and response formats to the client for the schedule side
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface UserDetails { | |
| uid: string; | |
| username: string; | |
| displayName: string; | |
| } | |
| interface MinAgendaItem { | |
| id: string; | |
| name: string; | |
| } | |
| interface ScheduleReminder { | |
| id: string; | |
| minutes: number; | |
| } | |
| interface CommitHash { | |
| hash: string; | |
| Timestamp: string; | |
| } | |
| interface UserComment { | |
| user: UserDetails; | |
| content: string; | |
| } | |
| interface ScheduleUpdate { | |
| id: string; | |
| date: string; | |
| time: string; | |
| type: "info" | "reminder" | "critical"; | |
| content: string; | |
| comments: UserComment[]; | |
| } | |
| interface SchedulePeriod { | |
| id: string; | |
| start_time: string; | |
| end_time: string; | |
| day: number; | |
| date: string; | |
| type: "one-time" | "weekly" | "monthly"; | |
| location: string; | |
| campus_id: string; | |
| location_id: string; | |
| onsite: boolean; | |
| } | |
| // Types for schedule items | |
| export interface TimetableItem { | |
| id: string; | |
| uid: string; | |
| author: string; | |
| visibility: "public" | "private"; | |
| description: string; | |
| cover_pic: string; | |
| tag: string; | |
| name: string; | |
| modified: string; | |
| agendas: string[]; | |
| updates: ScheduleUpdate[]; | |
| username: string; | |
| created: string; | |
| commit_hash: CommitHash; | |
| collaborators: UserDetails[]; | |
| invited: UserDetails[]; | |
| unjoined_agendas: MinAgendaItem[]; | |
| } | |
| export interface AgendaItem { | |
| id: string; | |
| uid: string; | |
| visibility: "public" | "private"; | |
| name: string; | |
| code: string; | |
| description: string; | |
| cover_pic: string; | |
| periods: SchedulePeriod[]; | |
| updates: ScheduleUpdate[]; | |
| tag: string; | |
| author: string; | |
| username: string; | |
| created: string; | |
| commit_hash: CommitHash; | |
| collaborators: UserDetails[]; | |
| invited: UserDetails[]; | |
| } | |
| export interface UserTimetableItem { | |
| id: string; | |
| is_muted: boolean; | |
| muted_agendas: string[]; | |
| custom_update_reminders: ScheduleReminder[]; | |
| custom_cover_pic: string; | |
| commit_hash: CommitHash; | |
| } | |
| export interface UserAgendaItem { | |
| id: string; | |
| is_muted: string; | |
| muted_periods: string; | |
| color: number; | |
| custom_update_reminders: ScheduleReminder[]; | |
| custom_period_reminders: ScheduleReminder[]; | |
| custom_cover_pic: string; | |
| commit_hash: CommitHash; | |
| } | |
| export interface ScheduleResponse { | |
| success: boolean; | |
| message: { | |
| joined_agendas: UserAgendaItem[]; | |
| joined_timetables: UserTimetableItem[]; | |
| owned_timetables: UserTimetableItem[]; | |
| owned_agendas: UserAgendaItem[]; | |
| timetables: TimetableItem[]; | |
| agendas: AgendaItem[]; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
done, review and merge PR