hackforla / hackforla/tdm-calculator
Epic: Dev: Create history table for account changes
- Dominant language
- JavaScript
- Stars
- 68
- Forks
- 47
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 25
Description
### Overview
#### Details
We need a table that tracks the following changes to users' accounts
- First Name
- Last Name
- Email Address
- Permissions
This will allow the following to be traceable
- Feedback Submissions
- Feedback submissions form the app are sent via email to LADOT
- If staff was trying to find an email from or to a past email address for a Feedback message from a TDM account that had since changed its email, the staff member would need to know what the prior email was
- TDM Plan Submitters
- Submitters will receive email communication outside of the application from DRO staff (invoices, questions, etc.)
- If DRO staff was trying to find an email from or to a past email address for a TDM Plan submission from a TDM account that had since changed its email, the staff member would need to know what the prior email was
- TDM Plan Reviewers
- If a staff member changes the name and email address on their account to another staff member who does not yet have a TDM account, in order to facilitate the transfer of responsibility
Sharing Problem
- Currently, snapshots are shared with an email address, not an ID
- If a user changes their email address in their account, they will not longer be able to access the shared snapshot
Potential solution to sharing problem
- If share recipient has account:
- When the user adds an email address to share, the system can lookup the user ID and attach it to the share
- If share recipient does not have an account:
- When the user adds an email address to share, the system will not find a matching user ID
- When user follows link provided by snapshot owner, the system will prompt them to log in or create an account
- When they create an account through the prior link, when they are done, it will take them to the snapshot
- When they view the snapshot, the system could change the share from their email address to their user ID
- If user goes directly to application and sets up an account (does not use the link provided by the snapshot owner)
- User logs in and goes to My Project page and opens a snapshot shared with them
- When they view the snapshot, the system could change the share from their email address to their user ID
### Action Items
- [ ] Assign yourself to the development issue.
- [ ] Move the development issue from the Prioritized Backlog to In Progress.
- [ ] Code Changes
- [ ] Create a DB Migration script that adds a LoginLog table, with loginId FK to Login table, dateModified datetime2(7) NOT NULL that records the datetime the record is inserted plus email, firstName, lastName, isAdmin, isSecurityAdmin, isDro, archivedAt (as defined in the Login table.
- [ ] Modify the Loing_Insert, Login_Update and Login_UpdateRoles stored procedures to insert a new row in the LoginLog table with the new values for these fields when any of the sprocs are called.
- [ ] The result of implementing this issue is just in the database information recorded, there will be no visible change to the application as a result of this issue - it only lays the groundwork for related issues that may be forthcoming.
- [ ] Create a PR, if applicable.
- [ ] Create a new slide (or edit one if it already exists) in staging and add the before and after images
- [ ] Once the PR has been approved, use it to close this issue. If there is no PR is associated with this issue, close this issue after lead signoff.
### Resources/Instructions
- Design details: [link to final comment in GitHub issue]
- Design mockups: [link to Ready for Dev section in the related Figma page]
- Note: this came out of reviewing this issue #2676
#### Staging and Release decks
- [Staging Deck](https://docs.google.com/presentation/d/1crZ3IxqA4hAu3qzD7ns93Ieuqjwh6wyEtuX_46cP-fg/)
- [Staging slide, 3440](https://docs.google.com/presentation/d/1crZ3IxqA4hAu3qzD7ns93Ieuqjwh6wyEtuX_46cP-fg/edit?slide=id.g3f74bf8e22b_33_11#slide=id.g3f74bf8e22b_33_11)
- Release Deck
- [2025-MM-DD Release deck, slide ISSUE NUMBER]
Contributor guide
Research direction
Start by locating the Login table, its migration scripts, and the Login_Insert, Login_Update, and Login_UpdateRoles stored procedures. Add the LoginLog table and ensure each procedure records the specified account fields and modification time; done means the database changes are applied and reviewed, with no expected visible application change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100