Context
Regular upkeep is required to maintain your things.
For this version, we are building a personal inventory of our belongings and a way to manage chores.
Chores have a frequency:
Daily, weekly, monthly, quarterly, yearly.
Architecture
Chores and Chore logs
Chores are a content type, with field_parent_chore, an View entity reference hierarchy on Drupal.orgentity reference hierarchyCovered by the Drupal security advisory policy (2,150 installs) field.
Chore logs are a View storage entity on Drupal.orgstorage entityCovered by the Drupal security advisory policy (3,429 installs), with field_chore and field_chore_log_parent.
There is a timestamp field on chores to track when last logged, updated automatically via ECA (Chore: set next due date).
Chores can be pinned, using node's sticky at top of lists property.
Photos, Location snapshots, Full snapshots
Full snapshot storage entities are a collection of photos from a point in time.
Sub chores
Chores reference a location, which is hierarchical.
Subchores have an View entity reference hierarchy on Drupal.orgentity reference hierarchyCovered by the Drupal security advisory policy (2,150 installs) field for the parent.
This field type may not be necessary, it primarily gives an outline tab on the parent to order children.
Logging sub chores
The parent chore log field is hidden on the edit form and set automatically from the log chore buttons and url context.
The chore logs follow the chore hierarchy, but track logged chores can partially complete the tree.
A chore log's parent may be it's chore's parent's parent (or higher), when it's direct parent has not yet been logged.
*This will change when chores get a status (schedule, in-progress, done). A root or parent chore can be started or scheduled, with scheduled child chore logs created for tracking and faster entry.
When a child log is added, it will look for the nearest ancestor on the same day to attach as it's parent.
Unselecting a chore from a parent will delete it, and reattach children to it's parent chore log.
Logging a parent chore when it's parent and child have already been logged triggers the child to reattach to the parent.
When a log is deleted that has children, a confirmation form asks if you want to delete them too.
Logic handled by ChoreLogTree.
Computed subchore field used in form handled by SubChoresItemList and the sub_chores view and the HierarchyCheckboxes widget.
Chore log ECA
Chore log: update chore
Sets last chore log ref.
Chore: set next due date
Calculate latest chore log, last chore log date, next due date, and unpins the chore.
Chore search view
Search view has a hierarchical location facet and display.
Drill down into locations with location facet.
Chore dashboard view
New chores don't have a log date.
Pinned chores use sticky at top of list.
A view of chore logs with attachments to show new and pinned.
Views Add Button with patches to add new chores and chore logs in a dialog.
Using Activity Link with patches to pin items to top and refresh the view.
Had many issues with log date aggregation, so added the last chore log date field to chores, which gets updated via eca when new chore logs are added.
Still uses aggregation to group logs by chore in pinned.
Sorting aggregated date fields doesn't work in views, but as a workaround, I sorted the column in the table.
Uses hack to position attachment titles - each display has the title in the header, and the new display has the log title in it's footer, set to show when there's no results.
TODO
Fix views display issues:
- On parent chore page, list sub chores with button to log individual chore.