Currently we save the full submission as json in one table. This kept things simple for us while we were still gathering reqs around how we would use this data elsewhere.
Now that we know how minors/omits/search works and the btr-filing design is finished so it is a good time to split out the submission to make it more manageable for other things outside of the btr-filing. Almost everything will work the same concerning the btr-filing, but we want to save the ownership statements and person statements in separate tables. This should make several things simpler and easier when comparing search, finding groups of person or ownership records matching certain criteria (ie. for omit or minors or checking emails were triggered).
Solution
Below is the diagram the devs have discussed for the updated db structure.
Ticket action items:
[x] updating submission table and adding new tables
statement id should be generated when record is created (event.listens_for...)
uuid should be removed (has no value - have statement id already)
up for discussion: last_notification.. stuff in person or ownership table? (won't matter until we start collapsing people into 1 record)
[x] updating submission (post/put/get) to use new structure
[x] tests
[x] UI - when getting existing people set person uuid from statementID, set statementID from uuid on submission
[x] UI - verify ownershipStatement/interestedParties/describedByPersonStatement is set from person statementID and does not change
[x] SEARCH - remove uuid references
[x] SEARCH - update importers for new btr db structure
Background
Currently we save the full submission as json in one table. This kept things simple for us while we were still gathering reqs around how we would use this data elsewhere.
Now that we know how minors/omits/search works and the btr-filing design is finished so it is a good time to split out the submission to make it more manageable for other things outside of the btr-filing. Almost everything will work the same concerning the btr-filing, but we want to save the ownership statements and person statements in separate tables. This should make several things simpler and easier when comparing search, finding groups of person or ownership records matching certain criteria (ie. for omit or minors or checking emails were triggered).
Solution
Below is the diagram the devs have discussed for the updated db structure. Ticket action items:
Future tech debt ticket ?