import { Timestamp } from './common'; import { UserId } from './user'; import { StudentId } from './student'; import { ClassId } from './class'; import { FamilyId } from './family'; import { attendingTypes, absentTypes, sicknesses } from '../constants/attendance'; export declare type AttendanceCategory = "absent" | "attending"; export declare type AttendanceType = AttendingType | AbsentType; /** * @deprecated */ export declare type AttendingTypeV2 = "attending" | "runningLate" | "attendingLate" | "checkedIn" | "checkedInLate" | "checkedOut" | "extendedIn" | "extendedOut" | "homeIn" | "homeOut"; export declare type AttendingType = typeof attendingTypes[number]; export declare type AbsentType = typeof absentTypes[number]; export declare type Sickness = typeof sicknesses[number]; /** * dbRef: schoolData/{sid}/attendance/students/{timestamp}/{studentId} * dbRef: studentData/{sid}/{studentId}/attendance/list/{timestamp} * dbRef: studentData/{sid}/{studentId}/attendance/records/{id} */ export interface Record { category: AttendanceCategory; data: RecordData; extra?: object; id: string; listId?: Timestamp; metadata: RecordMetadata; rDate: Timestamp; rTime: Timestamp; type: AttendanceType; } export interface RecordData { dEnd: Timestamp; dStart: Timestamp; late: boolean | null; message: string | null; temp: number | null; daysReturn?: number | null; sickness?: Sickness | null; ext?: boolean | null; extTime?: Timestamp | null; estTime?: Timestamp | null; } export interface RecordMetadata { busId?: string | null; classId?: string | null; createdBy: UserId; createdAt: Timestamp; fid: string; studentId: string; rIds: { [recordId: string]: boolean; }; updatedBy?: string | null; updatedAt?: Timestamp | null; } /** * dbRef: studentAttendance/{sid}/byDate/{timestamp}/{studentId} * dbRef: studentAttendance/{sid}/byStudent/{studentId}/{timestamp} * @deprecated */ export interface AttendanceV2 { v3: boolean | null; studentId: StudentId; familyId: FamilyId; data: null | { dateEnd: Timestamp | null; dateStart: Timestamp | null; estimatedTime: Timestamp | null; kind: string | null; late: boolean | null; lateByMinutes: number | null; notes: string | null; multiDay: boolean; recordDate: Timestamp; status: AttendanceCategory; totalDaysAbsent: number | null; totalDaysUntilReturn: number | null; type: AttendanceType; temperature: string | null; checkedInTime: Timestamp | null; checkedInBy: UserId | null; checkedOutTime: Timestamp | null; checkedOutBy: UserId | null; }; metadata: { createdAt: Timestamp; createdBy: UserId; classes: null | { [classId: ClassId]: boolean; }; guardians: null | { [userId: UserId]: boolean; }; studentName: null | { firstNameFurigana: string; firstNameKanji: string; firstNameRomaji: string; }; }; recordDate: Timestamp; records: null | { [id: string]: boolean; }; type: AttendanceType; category: AttendanceCategory; }