Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor user actions #551

Open
lchen-2101 opened this issue Jan 14, 2025 · 0 comments · May be fixed by #563
Open

Refactor user actions #551

lchen-2101 opened this issue Jan 14, 2025 · 0 comments · May be fixed by #563
Labels
python Pull requests that update Python code

Comments

@lchen-2101
Copy link
Collaborator

lchen-2101 commented Jan 14, 2025

We currently have a standalone user actions table, and each time a relationship needs to be built between the filing to the user action, a new field is added to the filing object, and a new mapping table is added to relate the filing to the user action. Proposal to to have user actions table have a many to one relationship to the filing table; and each time a new type of action is needed, no mapping table is needed, and little to no modification to the filing table is needed.

tasks:

  • update user_action table by adding filing_id, and submission_id as foreign keys to their respective tables; filing_id should be non-nullable, submission_id is nullable
    • need to seed those fields accordingly first, so in alembic scripts, filing_id would start out nullable, get them populated, then be altered to non-nullable
  • update UserActionDAO accordingly
  • update FilingDAO to have a list of UserActionDAO and remove other mapped UserActionDAO fields
  • update SubmissionDAO to have a list of UserActionDAO and remove other mapped UserActionDAO fields
  • update DTOs to have previously mapped fields to be transient, and derive them from the list of user actions
  • remove mapping tables and DAOs
@lchen-2101 lchen-2101 added the question Further information is requested label Jan 14, 2025
@lchen-2101 lchen-2101 changed the title Re-evaluate how user actions relates to filing Refactor user actions Jan 15, 2025
@lchen-2101 lchen-2101 added python Pull requests that update Python code and removed question Further information is requested labels Jan 15, 2025
michaeljwood added a commit to michaeljwood/sbl-filing-api that referenced this issue Jan 27, 2025
…ubmission directly.

Remove direct links from FilingDAO and SubmissionDAO.  Update DTOs to make existing links to user_action entities be derived.  Update API accordingly.

closes cfpb#551
michaeljwood added a commit to michaeljwood/sbl-filing-api that referenced this issue Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant