Commits
2026-09-16
✨ feat: the class×course instance is the academic anchor (K-12 remodel)Ahmet Kaan Gümüş · ae84034
✨ feat: the class×course instance is the academic anchor (K-12 remodel)
`course` was a school-wide singleton: enrollment, exams, sessions,
roll-call and homework all keyed on it, so two class sections teaching the same
course shared one roster, one exam set and one timetable. This moves the
academic anchor to `class_course` — the per-class instance — and rebuilds
the academic model around Turkish K-12.
Schema (migrations/school/20260916000001_k12_remodel.sql): `class_course`
becomes an instance (ders_saati, counts_toward_karne, enrollment_count,
class_course_teacher); enrollment re-keys to (class_course, app_user);
exam carries class_course + term (+ exam_audience for shared exams);
course_session / session_attendance / homework re-key; `class_member` is a
soft-leave history table (uuid PK, joined_at/left_at, partial unique index
on the live stint); `academic_year` sits above `term`; `class_group` links
a year, not a term; new `course_membership` (clubs/study), `karne_snapshot`;
settings gain branches/excuse_kinds/absence limits/timezone; profile gains
branch. Drops/recreates the identity-changing tables (pre-customer; the
migration resets every counter on a kept table that pointed at a dropped
one).
Layers: domain/db/service/web rewritten to the instance seam, with
`ensure_instance_teacher` gating instance writes (D10), the report card computed per
instance and weighted by ders_saati, an absence report, `/instances`
and `/academic-years` nests, and `/classes/{id}/instances`. Capacity and
the seat-claim 409 are gone; detach sweeps the whole instance subtree and
unlinks its blob keys.
Gates: cargo check --all-targets, SQLX_OFFLINE check (cache regenerated),
doc_sync, spec_bounds, limits_completeness, clippy -D warnings all green;
cargo nextest run 1370/1370.2026-09-12
🚧 wip: class-pump/meals/homework production fixes + T5 test-port continuationAhmet Kaan Gümüş · 35683acBrowse files
🗃️ fix: macro-legal binds/decodes + Send-general closures (repair round, 1564→0)Ahmet Kaan Gümüş · 83c3ce5Browse files
2026-09-11
🧹 chore: split subject and term into domain/db/service layersAhmet Kaan Gümüş · 6533a0a
🧹 chore: split subject and term into domain/db/service layers
domain/subject.rs keeps SubjectId/SubjectName/SubjectDescription/Subject + getters
and the pure validation tests; domain/term.rs keeps TermId/TermName/gone_error/
archived_error/ref_move/Term + getters.
db/subject.rs: create (cap::touch_and_create), read, list_by_ids, list_for_course,
update (FieldUpdate), delete (guarded transaction). db/term.rs: create, read,
list_all, update (ordered range guard), delete (refcount-guarded), archive,
unarchive, stamp. Persistence race tests ride along byte-identical.
service/subject.rs: pass-throughs + the moved id resolvers in_course/must_exist
(was web::subjects helpers). service/term.rs: pass-throughs + require_open
(was Term::require_open), resolve (was web::terms::resolve_term), require_writable
(the archived-refusal gate update/delete handlers inlined), delete's linked-409
mapping (was web::terms).
Web: subjects.rs/terms.rs handlers call service only; the archived gate stays
ordered before the range pre-flight by calling service::term::require_writable
between read and write. Callers re-pointed crate-wide: web/courses.rs,
web/classes.rs, web/homework.rs, web/exams/{mod,questions}.rs, web/bank_questions.rs,
db/{course,exam,exam_attempt,exam_question}.rs (tests + doc links),
service/{course,exam_attempt}.rs, domain/{class_group,bank_question,homework,
homework_file,homework_result,homework_submission}.rs (tests + doc links),
tests/regress_course_{child_orphans,delete}.rs.
Purity verdicts: domain/{timestamp,monotonic_id,text_fold,role}.rs have zero
production query execution (text_fold's only .query( is inside a #[cfg(test)]
folding test) — they stay domain-only, no db/service modules.
cargo check --all-targets 0 warnings; cargo test --lib 577 passed 0 failed;
integration: 13 subject/term/question/homework route tests green.