Today we added user assignments to homes. The goal was to enable users to be linked to multiple homes and ensure they only have access to those they are assigned to.
I kicked off the process by crafting unit tests to solidify the authorization logic. This involved creating tests to confirm that assigned users could view resident names for their homes, and ensuring unauthorized users would be blocked with a 403 error message. During this phase, I got some insightful AI assistance that helped streamline the test framework.
I encountered and resolved a few snags in the unit test setup, leading to successful test outcomes. However, I noticed the pull request was getting hefty, with over 400 lines of new code. To manage this better, I divided the work into smaller, more manageable tasks.
Next on the agenda was to tailor the homes page display: regular users would see only their assigned homes, while superusers could view all homes. Additional unit tests were created to verify these conditions, which, upon passing, were added to the codebase and pushed to GitHub.
The live coding session was instrumental in enhancing the tests and tackling various edge cases. After a productive 5-hour stint, the core feature of user assignments was implemented. Some aspects, like user experience enhancements, remain to be addressed in future sessions.