hezarfen_backend
Clone
https://git.tahinli.com/archive/hezarfen_backend.git
0 watching0 forksRust8.3 MiB6d68754Ahmet Kaan Gümüş2 months ago566 commits
| 1 | //! One fee plan placed on one student — and the moment the plan becomes money |
| 2 | //! owed: assigning appends *every* installment of the plan as a charge line at |
| 3 | //! once, each carrying its own due date. |
| 4 | //! |
| 5 | //! The row is keyed (plan, student), and every charge it raises is keyed from |
| 6 | //! that same pair plus the installment number, so the whole operation is |
| 7 | //! idempotent **by identity**: assigning twice writes nothing the second time, |
| 8 | //! however the two requests interleave, and an assign cut short after three of |
| 9 | //! twelve charges landed completes itself when it is repeated. No scan decides |
| 10 | //! "has this been billed yet?" — a scan can be slipped past by a concurrent |
| 11 | //! writer, and the cost of that mistake here is a double-billed family. |
| 12 | //! |
| 13 | //! Nothing is ever edited or deleted: unassigning is not a thing, because the |
| 14 | //! charges are already history. A plan raised in error is undone by reversing |
| 15 | //! its charges. That is also why the plan's assignment refcount is only ever |
| 16 | //! claimed and never released — a plan, once assigned, stays frozen for good. |
| 17 | |
| 18 | use crateFeePlanId; |
| 19 | use crateTimestamp; |
| 20 | use crateUserId; |
| 21 | |
| 22 | /// The identity of one (plan, student) pair. Not a row column: the table's |
| 23 | /// primary key *is* the pair — one assignment per pair by construction — and |
| 24 | /// this struct's job is the underscore-joined wire form at the HTTP edge. |
| 25 | |
| 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 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 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 |