hezarfen_backend
Clone
https://git.tahinli.com/archive/hezarfen_backend.git
0 watching0 forksRust8.3 MiBaf331ecAhmet Kaan Gümüş2 months ago451 commits
| 1 | //! The `class_course` table: the course-axis attach entry point and the |
| 2 | //! attachment listing. The refusals-to-errors policy and the detach that turns |
| 3 | //! a zero-row sweep into a 404 live in [`crate::service::class_course`]; the |
| 4 | //! transaction itself is the pump's, [`crate::db::class_pump`]. |
| 5 | |
| 6 | use crateCLASS_COURSE_TABLE; |
| 7 | use crateDatabase; |
| 8 | use crateAttached; |
| 9 | use cratePagedList; |
| 10 | use crateClassBlueprintId; |
| 11 | use crateClassCourse; |
| 12 | use crateClassGroupId; |
| 13 | use crateCourseId; |
| 14 | use crateUserId; |
| 15 | use crateAppError; |
| 16 | |
| 17 | /// The attach itself, with the refusals left *unmapped*. |
| 18 | /// |
| 19 | /// A hand attach ([`crate::service::class_course::attach`]) turns each of them |
| 20 | /// into the error the route answers with, because one call is one course and a |
| 21 | /// refusal is that call's whole answer. A blueprint pump cannot: it runs |
| 22 | /// one of these per (class, course), and a course that does not fit one |
| 23 | /// section must not abort the other eleven — so it needs to *read* the |
| 24 | /// refusal and carry on ([`crate::domain::class_blueprint`]). |
| 25 | /// |
| 26 | /// `source` is the provenance tag, and it is written by the same statement |
| 27 | /// that writes the link, so no attachment can exist without the answer to |
| 28 | /// "may a blueprint take this back". It is also *claimed* in that |
| 29 | /// transaction ([`Attached::SourceGone`]): a blueprint deleted while this |
| 30 | /// pump ran has already swept by that tag, so a row landing afterwards |
| 31 | /// would carry a name nothing can reach. |
| 32 | pub async |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | /// The courses a class is attached to, newest first — by when they were |
| 43 | /// attached. The composite primary key is the tiebreaker (class, then course: |
| 44 | /// the two halves of the id this order used to sort), which makes the order |
| 45 | /// total. |
| 46 | pub async |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 |