There's a conceptual layering in the codebase where the Session and Element structs can be built on top of Request structs, but this is not apparent because Request structs refer to Session/Element types. This refactoring is a step towards making this layering explicit. A follow-up will be to pull the requests in separate files.
Replace Request dependencies on Session/Element with strings
Make Request struct properties var instead of let for more swiftiness
Rename ***Request variables to request since the type is apparent from the context
Changed all var body properties to computed properties based on fields of the request
There's a conceptual layering in the codebase where the Session and Element structs can be built on top of Request structs, but this is not apparent because Request structs refer to Session/Element types. This refactoring is a step towards making this layering explicit. A follow-up will be to pull the requests in separate files.
var
instead oflet
for more swiftiness***Request
variables torequest
since the type is apparent from the contextvar body
properties to computed properties based on fields of the request