This repository has been archived on 2025-12-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
DEAD-fps-attendance-nextjs/utils/db.ts
T
2025-06-26 13:09:12 -04:00

25 lines
526 B
TypeScript

import Dexie from 'dexie';
export interface Teacher { id: string; name: string }
export interface AttendanceRecord {
id: string;
teacherId: string;
timestamp: number;
type: 'in' | 'out';
}
export class AppDB extends Dexie {
teachers!: Dexie.Table<Teacher, string>;
records!: Dexie.Table<AttendanceRecord, string>;
constructor() {
super('AttendanceDB');
this.version(1).stores({
teachers: 'id, name',
records: 'id, teacherId, timestamp, type',
});
}
}
export const db = new AppDB();