BeKultur/src/types/index.ts

120 lines
3.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export type AssignmentStatus =
| 'completed'
| 'next-week'
| 'due-soon'
| 'active'
| 'overdue'
| 'future';
export interface Assignment {
id: string; // SHA-256 deterministic hash
subject: string; // e.g. "AYT Kimya" (Turkish original)
type: string; // e.g. "Yayın" (Turkish original)
unit: string;
topic: string;
startDate: string; // raw string e.g. "20.10.2026"
endDate: string; // raw string e.g. "26.10.2026"
parsedStartDate: string | null; // ISO "2026-10-20"
parsedEndDate: string | null; // ISO "2026-10-26"
description: string; // original Turkish text
detectedCheckDate: string | null; // e.g. "26-30 Ekim"
status: AssignmentStatus;
completed: boolean;
completedAt: string | null;
excluded?: boolean; // disincluded by user
page?: number;
}
export interface SubjectStat {
subject: string;
total: number;
completed: number;
active: number;
percentage: number;
}
export interface DashboardStats {
total: number;
completed: number;
active: number;
checkedNextWeek: number;
dueSoon: number;
overdue: number;
excludedCount: number;
completionRate: number;
bySubject: Record<string, SubjectStat>;
}
// ----------------------------------------------------
// Syllabus (Ders Programı) Types
// ----------------------------------------------------
export interface Lesson {
period: string; // e.g. "1. Ders"
periodNumber: number; // e.g. 1
subject: string; // e.g. "TYT Kimya"
teacher: string; // e.g. "ÜLKÜ ESEN"
teacherPhoto: string | null; // image url
startTime: string; // "09:30"
endTime: string; // "10:05"
time: string; // "09:30 - 10:05"
station: string | null; // "İst1", "İst2", ..., null for whole-class
day: number; // 1 = Pazartesi ... 5 = Cuma
dayName: string; // "Pazartesi" ... "Cuma"
}
export interface SyllabusStore {
weekId: string; // e.g. "2026-W43"
weekRange: string; // e.g. "19.10.2026 - 23.10.2026"
selectedStation: string | null; // e.g. "İst-4" or null/all
advisoryTeacher?: string | null; // e.g. "CAN TÜRKOĞLU"
lastSynced: string | null;
schedule: Record<number, Lesson[]>; // day (1..5) -> raw lessons
}
// ----------------------------------------------------
// Private Lessons (Özel Ders & İstek) Types
// ----------------------------------------------------
export interface PrivateLesson {
id: string; // deterministic ID or hash
subject: string; // e.g. "Coğrafya", "Danışmanlık"
teacherName: string; // e.g. "SEVDA KILIÇOĞLU"
teacherPhoto: string; // photo URL
date: string; // e.g. "26.10.2026"
parsedDate: string; // e.g. "2026-10-26"
isUpcoming: boolean; // true if border-success / active upcoming
}
export interface PrivateLessonFormMeta {
studentName: string;
schoolName: string;
className: string;
photoUrl?: string;
ogrenciDonemId: string;
okulId: string;
sinifId: string;
courses: Array<{ id: string; name: string }>;
}
export interface PrivateLessonsStore {
lastSynced: string;
lessons: PrivateLesson[];
formMeta?: PrivateLessonFormMeta;
detectedAdvisor?: string;
}
export interface StudentStore {
studentId: string;
lastSynced: string | null;
rememberedCredentials?: {
studentId: string;
password: string;
};
assignments: Record<string, Assignment>;
syllabus?: SyllabusStore;
advisoryTeacher?: string | null;
privateLessons?: PrivateLessonsStore;
}
export interface DatabaseSchema {
students: Record<string, StudentStore>;
}