2.2 KiB
2.2 KiB
Changelog
[2025-12-01] - Student Data Import Implementation Initial Release
- Added new
studentstable schema with fields:id,order_number,cial_code,nif_nie_passport,registration_number,file_number,first_name,last_name,full_name,birth_date,gender,study_group,created_at,updated_at. - Added indexes on
cial_code,nif_nie_passport,(last_name, first_name),birth_date,gender,study_group. - Added
assigned_to_studentforeign key column totabletsandnon_loanable_devicestables. - Added
student_idforeign key toloanstable. - Implemented CSV import script (
scripts/import_students.py) for ISO-8859-1 (Latin-1) encoded CSV files with automatic UTF-8 handling, name field splitting, date conversion (DD/MM/YYYY → YYYY-MM-DD), discard "Estudio" field, duplicate checking, progress reporting, and dry-run support. - Created database migration script (
scripts/migrate_database.py) with backup, schema creation, index creation, foreign key addition, and consistency verification. - Updated Flask application (
app.py):- Added new routes:
/students,/add_student,/student/<id>,/edit_student/<id>,/delete_student/<id>,/import_students. - Modified loan routes to optionally associate tablet loans with students.
- Added student model definitions and relationships.
- Added indexes and validation for new student fields.
- Added new routes:
- Added Jinja2 front‑end templates:
templates/students.html– list/search/student details with filters and pagination.templates/add_student.html– form for adding new students.templates/edit_student.html– form for editing existing students.templates/student_detail.html– view student details including loan and device history.templates/import_students.html– CSV import interface with instructions.- Updated
base.htmlto include Students navigation link. - Updated
loan_tablet.htmlwith student selection dropdown.
- Updated
requirements.txtto include Flask, Flask-Babel, python-dotenv, pytest, pytest-cov, waitress. - Created documentation file
docs/DATABASE_SCHEMA_SPECIFICATION.mdwith detailed schema definition, import rules, and migration path.