import { BaseController } from "./base-controller"; import type { ClassDTO } from "@dwengo-1/common/interfaces/class"; import type { StudentsResponse } from "./students"; import type { AssignmentsResponse } from "./assignments"; import type { TeacherInvitationDTO } from "@dwengo-1/common/interfaces/teacher-invitation"; export interface ClassesResponse { classes: ClassDTO[] | string[]; } export interface ClassResponse { class: ClassDTO; } export interface TeacherInvitationsResponse { invites: TeacherInvitationDTO[]; } export interface TeacherInvitationResponse { invite: TeacherInvitationDTO; } export class ClassController extends BaseController { constructor() { super("class"); } async getAll(full = true): Promise { return this.get(`/`, { full }); } async getById(id: string): Promise { return this.get(`/${id}`); } async createClass(data: ClassDTO): Promise { return this.post(`/`, data); } async deleteClass(id: string): Promise { return this.delete(`/${id}`); } async getStudents(id: string, full = true): Promise { return this.get(`/${id}/students`, { full }); } // TODO async getTeacherInvitations(id: string, full = true): Promise { return this.get(`/${id}/teacher-invitations`, { full }); } async getAssignments(id: string, full = true): Promise { return this.get(`/${id}/assignments`, { full }); } }