Technical Journal — Multi-Teacher Task Completion
Area
Admin > Academic > Tasks
Change
Redesigned task completion logic to support multiple teachers per task.
Implementation Notes
- Introduced per-teacher completion instead of a single task-level “done” flag.
- Added an explicit assignment/pivot model (e.g.
task_assignments) linking:- task_id
- teacher_id
- done_at (nullable) or status enum
- Enforced unique (task_id, teacher_id) at database level.
Business Logic
- A task is considered done only when all assigned teachers have marked their own assignment as done.
- Overall task status is derived at query time.
- Adding a teacher creates a new pending assignment.
- Removing a teacher removes (or soft-deletes) their assignment.
UI Updates
- Admin task list shows derived status.
- Task detail shows:
- list of assigned teachers
- per-teacher done / not done
- optional completion time
Technical Journal — Student Photo Upload (Admin)
Area
Admin > Academic > Students
Change
Added ability for Admin to upload and manage a photo for each student.
Implementation Notes
- Each student has exactly one photo.
- Files stored on Cloudflare R2.
- On upload, generate multiple optimized variants:
- Thumbnail (for list view)
- Large preview (for modal view)
- Optional original (not used in UI)
Stored Metadata
- R2 keys for thumbnail and large image
- mime_type
- file_size
- width / height
- uploaded_at
UI Updates
- Students list shows a small thumbnail column.
- Clicking thumbnail opens a modal with the large optimized image.
- Replace and delete actions supported.
Constraints
- Images only (jpg/jpeg/png/webp).
- Backend validation enforced.
- Old R2 objects cleaned up on replace/delete.
Technical Journal — Customers: Class Sessions View (“Số buổi học”)
Area
Customers
Change
Designed a new Customers feature allowing parents to see:
- how many classes their child has attended
- how many classes remain
Data Source
- Reuses Admin > Academic > Enrollments logic.
- No duplicated calculations or stored counters.
UI Structure
- Entry point added to Customers Dashboard (per student).
- Student-specific page shows:
- attended count
- remaining count
- total sessions (if available)
- Attended sessions list:
- date
- day of week
- optional time
- newest first
Copy / Wording
- Feature name uses natural parent-style wording:
- “Số buổi học” or “Buổi học của con”
- Avoided administrative terms.
Authorization
- Customers can only see their own children.
- Enforced at backend.
Technical Journal — Customers Language Refinement
Area
Customers UI
Change
Refined feature naming and empty-state wording to sound natural and conversational for parents.
Examples
- No sessions yet: “Con chưa đi học buổi nào.”
- No remaining sessions: “Con đã học hết số buổi trong gói.”
- No enrollment: “Hiện chưa có gói học nào.”
Notes
- Vietnamese copy adjusted multiple times to remove formal/system-like tone.
- Final wording chosen to match how teachers talk to parents in real life.
Technical Journal — Task & Enrollment Data Reuse
Area
Admin + Customers
Change
Standardized approach of reusing Admin logic for Customer-facing features.
Details
- Customers features read from the same models and queries as Admin.
- Derived data (task status, remaining sessions) is computed, not stored.
- Authorization layers added instead of duplicating logic.
Technical Journal — Image & Performance Considerations
Area
Media handling
Change
Explicitly designed image loading strategy for Admin tables and modals.
Details
- Tables load thumbnail only.
- Modals load large optimized image.
- Originals never loaded in UI.
- R2 object lifecycle handled on replace/delete.
