@paul121 and I had a chat about this a few weeks ago and I want to capture it here for public consideration.
Proposal: Remove the status
field from assets and plans and replace it with a boolean archived
field.
This would change the data model so that assets and plans are either “archived” or “not archived”, but do not have an explicit “status”.
The benefit of doing this is it separates the concept of “archived”, which in practice is simply a mechanism for hiding/filtering out assets/plans in the UI/API.
This would allow other modules to add their own “Status” field(s) to assets/plans, which can be more targeted to use-case-specific workflows.
For example, a custom plan type may want to provide its own set of statuses, instead of the default “Active” status.
Worth noting, this would actually be a bit more like the original farmOS v1 data model, which changed in v2. In farmOS 1.x, assets had a property called archived
which was either 0
, which indicated that the asset was active, or a timestamp that recorded when the asset was archived. In farmOS 2.x, these were split into two separate fields:
status
- The status of the asset (eitheractive
orarchived
).archived
- The timestamp when the asset was archived. This will be empty if the asset is active.
I propose we simplify things by removing the current status
field and convert the archived
field to a boolean on both assets and plans. I don’t think there is a need to record the timestamp when the record was archived, because this is captured in revisions now (as of farmOS v2).
Logs would remain unchanged under this proposal.