Author: Sayaka Ono
Table of Contents | ||||
---|---|---|---|---|
|
...
When | When the value is(was) pre-populated by the system | When a value is NOT pre-populated by the system or was user created |
---|---|---|
creating | the https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/658309153/Unit+displays#Default-display-guidance should determine the value / unit combination | the user set unit preference should be used What is the “user set unit preference”? Is it a record-to-record unit(a record has not been created on a creation view) or user’s farm unit system preference (metric/imperial)? |
read-only | the https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/658309153/Unit+displays#Default-display-guidance should be used | the user set unit preference should be used |
editing | the https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/658309153/Unit+displays#Default-display-guidance should be used | the user set unit preference should be used |
automatic conversion - we will go with easier solution.
We do not need to see automatic conversion at all for now? (how about the total area?)
...
User’s farm unit system preference is “imperial”. The user created a barn and the total area was 50,000 acres. He switched the unit system to “metric”. (the record-to-record unit and the unit system setting don’t match)
-> The total area should be displayed in ha as determined by the default display guidance. (not record-to-record unit?)Jira Legacy server System JIRA serverId 815f41e5-e5fb-3402-8587-82eccc3ffab0 key LF-2880 User’s farm unit system preference is “imperial”. The user created a crop plan with planting depth 3 inches.
-> The depth should be stored in XXX.
“depth” is not in the https://lite-farm.atlassian.net/wiki/spaces/LITEFARM/pages/658309153/Unit+displays#Default-display-guidance. Is there a guidance for depth and spacing?
...
proposed approach | alternative approach | |
---|---|---|
backfill data | find wrong data and write a script | |
database | no change required | |
APIs |
| no change required |
frontend |
|
|
auto conversion | DB: need migration (auto conversion property in the userFarm table) | |
backend: update the helper or middleware to take user setting into account | frontend: update the hook to take user setting into account | |
pros |
|
|
cons |
|
|
Question
range error for the inputted valueThe maximum number that can be accepted changes depending on the selected unit, but the error message does not change. What is it supposed to be? (currently the error message is always 0-1000000000 for the input in the screenshot)ac: 4046860338724.812ft2: 92903129.90644656m2: 1000000000ha: 10000000000000 (stored as)
(I misunderstood this part. The error is shown against the hidden value. How this works is that the max value for the visible input is converted to “stored as” value to match the unit with that of the hidden value, and the hidden value is validated.)
TODO
ask for answers to all questions and make the requirements crystal clear → create a document(how each Unit input works, how the data is stored in the DB, etc) that can also be used as a reference when testing
update the style?
→ NOJira Legacy server System JIRA serverId 815f41e5-e5fb-3402-8587-82eccc3ffab0 key LF-2910 save data in an apples-to-apples manner
show data correctly on the frontend (should be able to support automatic conversion in the future)
write tests
figure out which data needs to be backfilled and how → write a script.
Jira Legacy server System JIRA serverId 815f41e5-e5fb-3402-8587-82eccc3ffab0 key LF-2719
https://docs.google.com/spreadsheets/d/1XZ-Pgy4xAqYlLCQUeYb3a2pZAknimCRlAwlVdP8xZT4/edit#gid=391799990
should we correct data in production/beta or both? Do we need to investigate when we started saving wrong data?we need to deploy APIs & app after backfilling is complete. Does anyone know how?
fix related bugs
...