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

Refactoring status values #22

Merged
merged 5 commits into from
Sep 19, 2023
Merged

Refactoring status values #22

merged 5 commits into from
Sep 19, 2023

Conversation

jgaehring
Copy link
Contributor

I refactored and tidied up a bit before getting back to the main alpha.1 milestone issues.

The main thing is how the status value was being converted from the backend string value (eg, "Green") to an emoji for the farm list (eg, "🟢"). I added a couple hacks and sloppy naming conventions in 9327343, and that was probably fine b/c we know we want to eventually use some kind of numeric code for the primary status value, possibly for #6, but it got me thinking more about the domain model.

I think there is a valid case to make that the color codes are in one sense "original" data, insofar as they can represent a verbal, qualitative assessment, but in another sense they are meant to display the status as a computed value, derived from the last known assessment value and the time that has elapsed since it was recorded, as laid out in #6.

To my mind, it makes sense to call the original qualitative assessment value a triage value, which can be stored as an integer,1 while the term status is reserved for the computed or derived value at any given moment and can be a float or a string or whatever form makes sense in the given context. Both can be represented by the same color coding or other indicators in the UI, and it may also be helpful to store both in some capacity, but a status value can be treated as ephemeral state, whereas a triage value is original data that should be preserved. This distinction should become more apparent once we begin deriving the status from not just qualitative but quantitative assessments, as well as aggregations of both.

Footnotes

  1. I haven't made up my mind at all about this, but possibly the set of [-1, 0, 1, 2], where 0 is red, 1 is yellow and 2 (or anything higher than 1) is green; -1 is for an inactive or ignored status, something we might represent with a neutral color.

@jgaehring jgaehring merged commit acd749b into runrig-coop:main Sep 19, 2023
@jgaehring jgaehring deleted the refactor branch September 19, 2023 16:40
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

Successfully merging this pull request may close these issues.

1 participant