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

Data integrity #23

Open
pedanticantic opened this issue Jul 1, 2019 · 2 comments
Open

Data integrity #23

pedanticantic opened this issue Jul 1, 2019 · 2 comments

Comments

@pedanticantic
Copy link
Contributor

I noticed that when when deleting a record, there is no code to deal with other records that might be referencing the one that's being deleted. I imagine in most cases, there should be validation to prevent the delete in the first place.

@pedanticantic
Copy link
Contributor Author

pedanticantic commented Nov 18, 2019

Thinking about this, I wonder if when transforming the raw firebase data to arrays of models (here), we should build up a list of objects (categories, etc) that have children. Then, the delete buttons in the list screens can just check against that data when validating whether the record can be deleted (it'll be much faster and more efficient to do this).
And also, it would be nice to tell the user which record(s) depend on the record in question, in which case the data above would have to include an array of the referenced records, rather than just having the record in the list.
We may need to think about what happens when some edits a record, and chooses a different parent - do we need to refresh that data, or can we assume the application will always return the to list screen, in which case it'll be re-created anyway?

@pedanticantic
Copy link
Contributor Author

In the edit screens, we could show a read-only list of records that are dependants of this record, maybe as links so the user can navigate to them?

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

No branches or pull requests

1 participant