e-picsa / picsa-apps

Monorepo for building tools to support E-PICSA Apps
https://picsa.app
GNU General Public License v3.0
5 stars 1 forks source link

feat(options-tool) enterprise Select #255

Closed chrismclarke closed 3 weeks ago

chrismclarke commented 3 months ago

Is your feature request related to a problem? Please describe. When using the options tool the user is immediately presented with a screen to start adding options image

This means that they can only keep a single set of options when using the app

Describe the solution you'd like Create a new create screen before showing the options table, that can be used to add a new option list. The screen should minimally ask the user what type of enterprise they are using, either Crop, Livestock, or Livelihood

Depending on the selection the page should link to /option/crop, /option/livestock and use data only for that specific set of options.

While filtering it would also be good to order the results (as think currently the order is based on id which are generated as random strings) - recommend also adding a _created_at field and populating using the existing generateTimestamp method, and using that field to sort. Existing data can be migrated to the current timestamp

Additional context Currently the database is set for a single list of options. To keep things simpler we can keep using a single set of options, but when adding an option include an enterprise field that matches the selected enterprising, and when displaying list of options filter just to that enterprise.

This will require a minor schema update (v4) created at apps\picsa-tools\option-tool\src\app\schemas to include the new enterprise property. All existing data can be migrated to set the default enterprise as crop