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

Reg2 - replace M2M fields for contacts & delete documents on Operator model [10] #2680

Open
6 tasks
andrea-williams opened this issue Jan 13, 2025 · 1 comment

Comments

@andrea-williams
Copy link
Contributor

andrea-williams commented Jan 13, 2025

Description of the Tech Debt

On our Operator model, we have configured the documents and contacts fields to be a Many-to-Many (M2M) relationship. It should instead be a One-to-Many relationship - we don't ever want multiple operators to have access to the same document or contact model instances.

Tech Debt Triage

The purpose of our technical debt triage process is to analyze technical debt to determine risk level of the technical debt and the value in tackling that technical debt.

Risk Value Scoring:

Level Value
High
3
Medium
2
Low
1
Technical Debt - Risk Types Level Value
Business Area Risk - Risk of business area visibility / damage to user experience 0 3
Developer Fault Risk - How likely will this tech debt cause a future error related to coding on top of it 0 3
System Fault Risk - Risk of system errors or application downtime 0 1
Time Scale Risk - Compound risk effect if left alone. How much more difficult to fix or dangerous will this become over time? 0 2
Time Sink Risk - How much will this tech debt slow the development process down 0 1
TOTAL SCORE:
0 10

Development Checklist:

  • delete the documents and contacts fields on the Operator model (shouldn't negatively impact prod data - the OperatorDocuments and OperatorContacts tables are empty)
  • delete the documents M2M field on the Operation model -- documents are operation-specific
  • add an operation = models.ForeignKey() field on the Document model
  • (no action required - the operation-contacts M2M field should remain as is)
  • run the django script to auto-generate a new migration
  • if necessary, update mock data fixtures
@Sepehr-Sobhani Sepehr-Sobhani changed the title Reg2 - replace M2M fields for contacts & documents on Operator model [10] Reg2 - replace M2M fields for contacts & delete documents on Operator model [10] Jan 14, 2025
@Sepehr-Sobhani
Copy link
Contributor

As part of this ticket, we need to update the code to incorporate the new reference. Instead of using an M2M relation (.set() or .add()), we now need to associate the operator directly with the contact table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants