Repository navigation
Conversation
Baskets, portafilters, drippers, and other prep equipment currently have no home in the bridge API — plugins that need to track them (e.g. DYE2) have been parking equipment data in the generic plugin KV store instead. Adds a general Equipment resource (type: basket|portafilter|dripper|other) following the same layered pattern as Grinders: domain model, Drift table + schema migration (v4 -> v5), DAO, mapper, storage service, and a REST handler with the standard GET/POST/PUT/DELETE + conditional-GET (ETag) + tri-state PATCH semantics used elsewhere in the API. GET supports ?type=<type> filtering and ?includeArchived=true, matching Grinders' conventions. Not included (kept out to bound this PR): a data-export/backup section and DE1-app import support, mirroring what Grinders has for those. Happy to follow up if wanted. Docs: assets/api/rest_v1.yml (paths + Equipment schema), doc/Api.md, doc/AI_API_NOTES.md, doc/AI_STORAGE_NOTES.md. Tests: model round-trip, DAO CRUD/filter/watch, and handler request/response tests mirroring grinders_handler_test.dart's coverage (incl. ETag and tri-state PATCH semantics).
… read them Answers a question about why beans/grinders are Decaid resources but favourites/recipes/baskets aren't: they live in the bridge's generic per-plugin KV store, which turns out to have no ownership/permission check at all (verified against kv_store_handler.dart in the Decaid repo) — any skin can already read (or write) dye2.reaplugin's KV keys today. Also flags that baskets is transitional pending decentespresso/decaid#727. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZKqRkAaE9jCTBKr3S7f9G
|
before we review, have you followed this discussion? |
|
oh thanks. I think what makes sense is that we update this PR to be other_equipment ? Equipment and technique |
|
@allofmeng sorry to leave you hanging. Some of the fields you describe here do not seem to be "equipment" but rather describe how something was done, like e.g. |
|
closed this PR , will add the equipment endpoint options in DYE2 plugin. |
|
Is this definitely something we want to defer to the DYE2 plugin, or are you open to having this be in the Decaid data model at some point? I'm developing a synchronization plugin and am trying to avoid having to write to both Decaid and DYE2 if possible. |
|
@loganfuller Decaid is the backing store for DYE2 anyway, but I think I understand what you mean. I am deferring the equipment endpoint to DYE2 for now until we start seeing the final shape of the api and how it attaches the data to shot records. |
Summary
type: basket|portafilter|dripper|other) for prep equipment that isn't a grinder. Baskets, portafilters, and drippers currently have no home in the bridge API — plugins that track them (e.g. the DYE2 plugin) have been parking that data in the generic plugin KV store instead of a proper resource.Grinders: domain model → Drift table (schema v4 → v5 migration) → DAO → mapper → storage service → REST handler, wired throughwebserver_service.dart/main.dartthe same waygrinderStorageis.GET /api/v1/equipmentsupports?type=<type>filtering and?includeArchived=true, plus conditional GET (ETag), matching Grinders' conventions.PUTuses the same tri-state patch semantics (omit = keep, explicitnull= clear nullable field / reject non-nullable field, value = replace) as the rest of the API.assets/api/rest_v1.yml(new paths +Equipmentschema),doc/Api.md,doc/AI_API_NOTES.md,doc/AI_STORAGE_NOTES.md.Deliberately out of scope
To keep this PR reviewable, I did not add a data-export/backup section or DE1-app import support for Equipment, even though Grinders has both. Happy to follow up with either if wanted.
Test plan
dart analyze lib/— no issuestest/models/equipment_test.dart,test/database/equipment_dao_test.dart,test/webserver/equipment_handler_test.dart(model round-trip, DAO CRUD/filter/watch, handler request/response incl. ETag + tri-state PATCH) — all passinggrinder-related tests re-run after this change — all passing (one pre-existing flaky test inde1handler_machine_swap_ws_test.dart, unrelated to this change and reproducible onmainwithout it)🤖 Generated with Claude Code
https://claude.ai/code/session_01CZKqRkAaE9jCTBKr3S7f9G