hezarfen_backend
Clone
https://git.tahinli.com/archive/hezarfen_backend.git
0 watching0 forksRust8.3 MiB6d68754Ahmet Kaan Gümüş2 months ago566 commits
| 1 | //! A class section: a named set of students the school manages as one, so a |
| 2 | //! course attach enrolls the whole set at once. The membership and the |
| 3 | //! attachments live in their own tables (`class_member`, `class_course`) and are |
| 4 | //! counted on this row — a class may only be deleted at zero on both, the same |
| 5 | //! stored guard shape courses and terms use. |
| 6 | //! |
| 7 | //! A class belongs to an academic year ([`crate::domain::academic_year`]), not |
| 8 | //! to a term: the section keeps the same roster all year and the term is a |
| 9 | //! grading slice inside it. It claims a reference on its year before the link |
| 10 | //! is written; the reference is its *own* column |
| 11 | //! ([`crate::constant::ACADEMIC_YEAR_CLASS_COUNT_FIELD`]) rather than the |
| 12 | //! courses' own count, so a class's share is never confused with another |
| 13 | //! roster's. |
| 14 | //! |
| 15 | //! The queries live in [`crate::db::class_group`]; the archived-year guard and |
| 16 | //! the route-facing wrappers in [`crate::service::class_group`] — this file is |
| 17 | //! the row shape, its newtypes and getters. |
| 18 | |
| 19 | use crateMAX_CLASS_NAME_LEN; |
| 20 | use crateAcademicYearId; |
| 21 | use crateGradeLevel; |
| 22 | use cratenext_uuid; |
| 23 | use crateUserId; |
| 24 | use crateValidationError; |
| 25 | use cratevalidate_required; |
| 26 | |
| 27 | |
| 28 | |
| 29 | ; |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | ; |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | /// One class. `creator` is who made it; the two refcounts behind the delete |
| 69 | /// guard are database-side columns only, so no whole-row save can clobber one |
| 70 | /// (see [`crate::db::cap`]). |
| 71 | /// |
| 72 | /// `teacher` is the section's homeroom teacher: optional, not |
| 73 | /// refcounted, and merely a label pointing at a teacher-or-higher account — the |
| 74 | /// web layer holds that bar, and a demotion sweeps the column |
| 75 | /// ([`crate::db::class_group::unassign_everywhere`]). |
| 76 | /// |
| 77 | /// `grade_level` is the section's rung on the shared grade ladder |
| 78 | /// ([`GradeLevel`]) — required, not a label the school makes up: a club-shaped |
| 79 | /// *class* still sits at a grade, and it is the school-wide club/study |
| 80 | /// *courses* that belong to no section at all. |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 |