Add Syllabus (Ders Programı) with station filtering and weekly auto-refresh
This commit is contained in:
parent
8acc77e441
commit
d0fd394fbd
10 changed files with 1196 additions and 3 deletions
|
|
@ -142,4 +142,44 @@ export class LocalDatabase {
|
|||
const student = this.cache.students[studentId];
|
||||
return student?.rememberedCredentials || null;
|
||||
}
|
||||
|
||||
public saveSyllabus(
|
||||
studentId: string,
|
||||
weekId: string,
|
||||
weekRange: string,
|
||||
schedule: Record<number, any>
|
||||
): void {
|
||||
const student = this.getStudentStore(studentId);
|
||||
const existingStation = student.syllabus?.selectedStation || null;
|
||||
|
||||
student.syllabus = {
|
||||
weekId,
|
||||
weekRange,
|
||||
selectedStation: existingStation,
|
||||
lastSynced: new Date().toISOString(),
|
||||
schedule
|
||||
};
|
||||
this.save();
|
||||
}
|
||||
|
||||
public setStudentStation(studentId: string, station: string | null): void {
|
||||
const student = this.getStudentStore(studentId);
|
||||
if (!student.syllabus) {
|
||||
student.syllabus = {
|
||||
weekId: '',
|
||||
weekRange: '',
|
||||
selectedStation: station,
|
||||
lastSynced: null,
|
||||
schedule: {}
|
||||
};
|
||||
} else {
|
||||
student.syllabus.selectedStation = station;
|
||||
}
|
||||
this.save();
|
||||
}
|
||||
|
||||
public getSyllabus(studentId: string): any {
|
||||
const student = this.cache.students[studentId];
|
||||
return student?.syllabus || null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue