Closed ferrisoxide closed 5 months ago
@CobolKing this is in line with conversations we've been having outside of Github
This model might not be correct. Workspace checklists, as opposed to ones in the library, may not need versioning. Probably best to get back to writing actual use cases and see what emerges from that.
Done. Closing
Background
Currently the state of a checklist (or more specifically the checklist instance model) is stored within the actual markdown contents. Every time a user clicks on / off a checklist item the code modifies the underlying text content.
While this makes rendering checklists trivial, it complicates data analysis. We have three basic requirements when it comes to data analysis:
Ultimately there has to be a single source of truth in the system. Traditionally we might do this by having a canonical current state, with an audit log for reporting and reconstructing point-in-time state. However, it feels we might be better off using Event Sourcing - or at least having an event-driven architecture to manage state.
Proposed Solution
Sources of Truth
Derived Facts
From the sources of truth we can synthesize or maintain separate representations of the truth. For now, we can call these "facts" and consider a couple of examples - though they are by no means exhaustive:
These can be cached for convenience, but they should also be able to be regenerated from sources of truth at any time.
Rough Data Model
NB this a very rough cut of the representation of checklists in the workspace domain. The library domain is similar but doesn't have the same level of data representation (e.g. doesn't need item states or instances).
There are other configuration-related entities that abut this domain, and some of the models here will need fleshing out, but this is a general idea of how the domain might look like.