hezarfen_backend
Clone
https://git.tahinli.com/archive/hezarfen_backend.git
0 watching0 forksRust8.3 MiB6d68754Ahmet Kaan Gümüş2 months ago566 commits
| 1 | //! The `registration` table: the seat reads, the per-event listing, and |
| 2 | //! the delete that returns the seat in the same transaction. The register |
| 3 | //! workflow itself (the cap claim and its conflict mapping) lives in |
| 4 | //! [`crate::service::registration`]. |
| 5 | |
| 6 | use crate; |
| 7 | use crateClaimed; |
| 8 | use crateEventId; |
| 9 | use crateRegistration; |
| 10 | use crateTimestamp; |
| 11 | use crateUserId; |
| 12 | use crateAppError; |
| 13 | use query_as; |
| 14 | |
| 15 | /// Some(_) iff `user` holds a seat on `event` — the audience point check. |
| 16 | pub async |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | pub async |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | /// Take a seat for `user` on `event` — the cap claim of one: the seat bump, |
| 52 | /// the holder's role handshake, and the row insert are a single statement, |
| 53 | /// so neither a racing placement nor a concurrent capacity lowering can |
| 54 | /// over-admit (the capacity is read off the event row as it is decided, not |
| 55 | /// off a snapshot), and a demotion to `parent` cannot strand a seat the |
| 56 | /// sweep would miss: the handshake takes the holder's row |
| 57 | /// `FOR NO KEY UPDATE`, the same key the demotion writes, so either this |
| 58 | /// sees the parent and inserts nothing, or the sweep sees this row. |
| 59 | /// |
| 60 | /// The verdict maps exactly like the old guard layer's: `Made` — seated; |
| 61 | /// `Duplicate` — a rival placement of the same pair won (23505 on |
| 62 | /// `registration_event_user`); `Full` — the event is at its capacity, was |
| 63 | /// deleted, or the holder fell to `parent` (all one marker; the caller |
| 64 | /// re-reads to pick the message). |
| 65 | pub async |
| 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 | pub async |
| 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 | |
| 138 | |
| 139 | |
| 140 |