- Security: Fixed RUSTSEC-2023-0071 via aws_lc_rs - API: Fixed empty 200 body parsing and check-in typing - Tutors: Added is_active flag, safe deletion with 409 conflict checks, and admin toggle UI - Rooms: Migrated room layouts from pixel to grid scale, added additive layout validators - UI: Improved RoomCanvas with dynamic sizing, interactive editing, snap-to-grid - App: Replaced static SeatMap component with dynamic RoomCanvas across live and checkin views
254 lines
5.5 KiB
SQL
254 lines
5.5 KiB
SQL
-- Demo Seed Data
|
|
-- Tutor/Admin Account (Password: admin)
|
|
INSERT OR IGNORE INTO tutors (id, name, email, password_hash, is_superadmin)
|
|
VALUES (1, 'Demo Admin', 'admin@tutortool.com', '$2b$12$ted9u9ZsxbjhnWvTYsijMul138qhIKQG1RVsY8wGA3RFKZl8EaAsm', 1);
|
|
|
|
-- Courses
|
|
INSERT OR IGNORE INTO courses (id, name, semester)
|
|
VALUES (1, 'Demo Course 101', 'Summer 2026');
|
|
|
|
-- Link Tutor to Course
|
|
INSERT OR IGNORE INTO tutor_courses (tutor_id, course_id)
|
|
VALUES (1, 1);
|
|
|
|
-- Rooms
|
|
INSERT OR IGNORE INTO rooms (id, name, layout_json)
|
|
VALUES (1, 'Room A (Small)', '[
|
|
{
|
|
"id": "T1",
|
|
"label": "T1",
|
|
"x": 2.25,
|
|
"y": 3.75,
|
|
"width": 5.0,
|
|
"height": 1.75,
|
|
"type": "table"
|
|
},
|
|
{
|
|
"id": "T2",
|
|
"label": "T2",
|
|
"x": 11.75,
|
|
"y": 3.75,
|
|
"width": 5.0,
|
|
"height": 1.75,
|
|
"type": "table"
|
|
},
|
|
{
|
|
"id": "T3",
|
|
"label": "T3",
|
|
"x": 2.25,
|
|
"y": 8.0,
|
|
"width": 5.0,
|
|
"height": 1.75,
|
|
"type": "table"
|
|
},
|
|
{
|
|
"id": "T4",
|
|
"label": "T4",
|
|
"x": 11.75,
|
|
"y": 8.0,
|
|
"width": 5.0,
|
|
"height": 1.75,
|
|
"type": "table"
|
|
},
|
|
{
|
|
"id": "T1-1",
|
|
"label": "1",
|
|
"x": 3.65,
|
|
"y": 3.2,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T1-2",
|
|
"label": "2",
|
|
"x": 5.85,
|
|
"y": 3.2,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T1-3",
|
|
"label": "3",
|
|
"x": 3.65,
|
|
"y": 6.05,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T1-4",
|
|
"label": "4",
|
|
"x": 5.85,
|
|
"y": 6.05,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T1-5",
|
|
"label": "5",
|
|
"x": 7.9,
|
|
"y": 4.62,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T2-1",
|
|
"label": "1",
|
|
"x": 13.15,
|
|
"y": 3.2,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T2-2",
|
|
"label": "2",
|
|
"x": 15.35,
|
|
"y": 3.2,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T2-3",
|
|
"label": "3",
|
|
"x": 13.15,
|
|
"y": 6.05,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T2-4",
|
|
"label": "4",
|
|
"x": 15.35,
|
|
"y": 6.05,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T2-5",
|
|
"label": "5",
|
|
"x": 17.4,
|
|
"y": 4.62,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T3-1",
|
|
"label": "1",
|
|
"x": 3.65,
|
|
"y": 7.45,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T3-2",
|
|
"label": "2",
|
|
"x": 5.85,
|
|
"y": 7.45,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T3-3",
|
|
"label": "3",
|
|
"x": 3.65,
|
|
"y": 10.3,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T3-4",
|
|
"label": "4",
|
|
"x": 5.85,
|
|
"y": 10.3,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T3-5",
|
|
"label": "5",
|
|
"x": 7.9,
|
|
"y": 8.88,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T4-1",
|
|
"label": "1",
|
|
"x": 13.15,
|
|
"y": 7.45,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T4-2",
|
|
"label": "2",
|
|
"x": 15.35,
|
|
"y": 7.45,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T4-3",
|
|
"label": "3",
|
|
"x": 13.15,
|
|
"y": 10.3,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T4-4",
|
|
"label": "4",
|
|
"x": 15.35,
|
|
"y": 10.3,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
},
|
|
{
|
|
"id": "T4-5",
|
|
"label": "5",
|
|
"x": 17.4,
|
|
"y": 8.88,
|
|
"width": 0.9,
|
|
"height": 0.9,
|
|
"type": "seat"
|
|
}
|
|
]');
|
|
|
|
-- Students
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (1, 1, 'Alice Smith');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (2, 1, 'Bob Jones');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (3, 1, 'Charlie Brown');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (4, 1, 'David Wilson');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (5, 1, 'Eve Taylor');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (6, 1, 'Frank Miller');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (7, 1, 'Grace Lee');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (8, 1, 'Heidi Davis');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (9, 1, 'Ivan Garcia');
|
|
INSERT OR IGNORE INTO students (id, course_id, name) VALUES (10, 1, 'Judy Martinez');
|
|
|
|
-- Session (Today)
|
|
INSERT OR IGNORE INTO sessions (id, course_id, week_nr, date)
|
|
VALUES (1, 1, 1, date('now'));
|
|
|
|
-- Slot (Active Demo Slot)
|
|
INSERT OR IGNORE INTO slots (id, session_id, room_id, tutor_id, start_time, end_time, status, code)
|
|
VALUES (1, 1, 1, 1, '08:00', '18:00', 'open', 'demo123');
|