MadeInPierre / MadeInPierre/cuicuit

Shopping cooldown for long-shelf ingredients

Open
#65 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Svelte
Stars
49
Forks
0
Avg merge
28m
Merged PRs (30d)
1

Description

Many ingredients can be bought once and then used for several weeks such as salt and spices. Add a constant cooldown number of days for these ingredients database table to avoid seeing them everytime we do groceries. To start, all ingredients categorized as spices using the hierarchy column could get a default 30 days cooldown, with manual adjustments later.

Then, hide these in the shopping list in a muted small collapsible zone titled "+6 you probably have >".

TODO How should the status be calculated? By a query or by the client? Draft proposal:

  1. Keep the existing "get all shopping items" query
  2. Add a new "get the last time each ingredient has been bought in this space" query
  3. Join on the client when generating the shopping list (adds an at_home field on each combined shopping item with values such as "home" | "cooldown" | "missing"). "home" would never happen for now as we don't have pantry management, but might in the future if one day we know for sure the user has the ingredient at home. For now only "maybe" and "missing" applies depending on the cooldown.
  4. Hence, ingredients would use the fixed cooldown and the last bought time to guess if a user probably has the ingredient at home or not. If no cooldown, always assume "missing".

I am tempted to let the client join data instead of the database to reduce database pressure and loading latency, but TBD.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing the existing shopping-list query and the client-side shopping-list generation, then resolve how cooldown status should be calculated and joined. Done means spice ingredients use a 30-day cooldown and the shopping list displays matching items in the proposed collapsible muted section.

Written by the indexing model from the issue text.

Assessment

Domain
full-stack
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.