Commit a22645b
authored
Move the register flow's remaining logic into BikeServices::Register (#4033)
`RegisterController` was still carrying registration logic that belongs
in `BikeServices::Register`. Pure refactor, no behavior change.
- **The service gains the flow's decisions** — `save_step_1`,
`acknowledge_step` (which record a step's boxes write to), `complete`,
`confirmation_token_valid?`, and the two steps' permitted-params lists.
`claim_creator`, `create_bike_if_ready` and `create_bike` are concealed
behind `complete`.
- **`save_step_1` and `save_step_2` add their own errors to `b_param`**,
so `create` and `update` now read the same way: save, or re-render 422
with whatever the service put there. Their copy moves from
`controllers.register.{create,update}` to `shared.register_flow`, the
way `OrganizedServices::UserMenuItems` holds its labels.
- **`update` drops its `acknowledged?` guard and `create` its duplicated
422 render** — `complete` already returns nil when the registration
isn't ready, and both branches redirected to the same place.
The controller keeps what's actually HTTP: the session token, the
redirects, the flashes, the b_param lookups, and signing in a confirmed
address.1 parent 253a5ce commit a22645b
4 files changed
Lines changed: 85 additions & 57 deletions
File tree
- app
- controllers
- services/bike_services
- config
- locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
71 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
72 | 69 | | |
73 | 70 | | |
74 | 71 | | |
75 | 72 | | |
76 | | - | |
| 73 | + | |
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
80 | | - | |
81 | | - | |
| 77 | + | |
82 | 78 | | |
83 | 79 | | |
84 | 80 | | |
85 | 81 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 82 | | |
90 | 83 | | |
91 | 84 | | |
92 | 85 | | |
93 | 86 | | |
94 | 87 | | |
95 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
96 | 92 | | |
97 | 93 | | |
98 | 94 | | |
| |||
114 | 110 | | |
115 | 111 | | |
116 | 112 | | |
117 | | - | |
118 | | - | |
| 113 | + | |
119 | 114 | | |
120 | 115 | | |
121 | 116 | | |
| |||
135 | 130 | | |
136 | 131 | | |
137 | 132 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | 133 | | |
150 | | - | |
151 | | - | |
| 134 | + | |
152 | 135 | | |
153 | | - | |
| 136 | + | |
154 | 137 | | |
155 | 138 | | |
156 | 139 | | |
| |||
240 | 223 | | |
241 | 224 | | |
242 | 225 | | |
243 | | - | |
| 226 | + | |
244 | 227 | | |
245 | | - | |
246 | 228 | | |
247 | 229 | | |
248 | 230 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 231 | + | |
254 | 232 | | |
255 | 233 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
120 | 128 | | |
121 | 129 | | |
122 | 130 | | |
| |||
152 | 160 | | |
153 | 161 | | |
154 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
155 | 170 | | |
156 | 171 | | |
157 | 172 | | |
158 | 173 | | |
159 | 174 | | |
160 | 175 | | |
161 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
162 | 201 | | |
163 | 202 | | |
164 | 203 | | |
| |||
171 | 210 | | |
172 | 211 | | |
173 | 212 | | |
| 213 | + | |
174 | 214 | | |
175 | 215 | | |
176 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
177 | 228 | | |
178 | 229 | | |
179 | 230 | | |
| |||
197 | 248 | | |
198 | 249 | | |
199 | 250 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | 251 | | |
205 | 252 | | |
206 | 253 | | |
| |||
273 | 320 | | |
274 | 321 | | |
275 | 322 | | |
276 | | - | |
277 | | - | |
278 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
279 | 329 | | |
280 | 330 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1926 | 1926 | | |
1927 | 1927 | | |
1928 | 1928 | | |
1929 | | - | |
1930 | | - | |
1931 | | - | |
1932 | | - | |
1933 | 1929 | | |
1934 | 1930 | | |
1935 | 1931 | | |
1936 | 1932 | | |
1937 | 1933 | | |
1938 | 1934 | | |
1939 | | - | |
1940 | | - | |
1941 | 1935 | | |
1942 | 1936 | | |
1943 | 1937 | | |
| |||
5071 | 5065 | | |
5072 | 5066 | | |
5073 | 5067 | | |
| 5068 | + | |
| 5069 | + | |
| 5070 | + | |
| 5071 | + | |
| 5072 | + | |
5074 | 5073 | | |
5075 | 5074 | | |
5076 | 5075 | | |
| |||
0 commit comments