feat(inventory): informal quantity scale (number + unit) + seed/plant lots

Rework quantities the way seeds are actually described — a number of an informal
unit — and let a lot hold seeds or plants (plantel).

Quantity model (commons_core):
- Quantity is now { kind, count?, label } — "3 cobs", "2 packets", "a few".
  Count is optional; uncountable vibes (a few, some, pinch) carry no number.
- QuantityKind reorganised into an ascending scale: vibes → containers
  (teaspoon/spoon/cup/jar/sack) → seed & fruit forms → plant units, each tagged
  countable/not. Stored by name; count reuses the existing numeric column.

Lot type (schema v2):
- Lots gain a `type` (seed | plant); germination stays meaningful for seeds.
  schemaVersion 2 with a from1To2 migration (adds the column), drift_schema_v2
  exported, migration test covers v1→v2.

UI:
- New QuantityPicker: a horizontal scale of large seed-glyph icons + a number
  stepper (shown only for countable units), plus a seed/plant SegmentedButton.
  Used in quick-add and add-lot. Lot lines render "3 cobs" / "a few".
- i18n: unit singular/plural (ES/EN, Weblate-friendly), lot-type labels.

Build: slang moved to its CLI (disabled in build_runner to avoid a multi-file
collision); CI runs `dart run slang` before build_runner. 38 tests green,
Linux migrates the existing v1 DB and runs.
This commit is contained in:
vjrj 2026-07-08 10:51:02 +02:00
parent 48e9d15772
commit 3942975dba
26 changed files with 4220 additions and 315 deletions

View file

@ -6,7 +6,8 @@
"save": "Guardar",
"cancel": "Cancelar",
"delete": "Eliminar",
"edit": "Editar"
"edit": "Editar",
"type": "Tipo"
},
"inventory": {
"title": "Inventario",
@ -54,26 +55,38 @@
"addLot": {
"title": "Añadir lote",
"year": "Año de cosecha",
"quantity": "Cantidad"
"quantity": "¿Cuánta?",
"amount": "Cantidad"
},
"quantityKind": {
"lotType": {
"seed": "Semillas",
"plant": "Plantel"
},
"unit": {
"aFew": "unas pocas",
"some": "algunas",
"plenty": "muchas",
"handful": "un puñado",
"pinch": "una pizca",
"jar": "un tarro",
"packet": "un sobre",
"cob": "una mazorca",
"head": "una cabezuela",
"pod": "una vaina",
"ear": "una espiga",
"fruit": "un fruto",
"bulb": "un bulbo",
"tuber": "un tubérculo",
"seedHead": "una cabeza de semillas",
"bunch": "un manojo",
"grams": "gramos",
"count": "unidades"
"handful": { "singular": "puñado", "plural": "puñados" },
"teaspoon": { "singular": "cucharadita", "plural": "cucharaditas" },
"spoon": { "singular": "cuchara", "plural": "cucharas" },
"cup": { "singular": "taza", "plural": "tazas" },
"jar": { "singular": "bote", "plural": "botes" },
"sack": { "singular": "saco", "plural": "sacos" },
"packet": { "singular": "sobre", "plural": "sobres" },
"cob": { "singular": "mazorca", "plural": "mazorcas" },
"pod": { "singular": "vaina", "plural": "vainas" },
"ear": { "singular": "espiga", "plural": "espigas" },
"head": { "singular": "cabezuela", "plural": "cabezuelas" },
"fruit": { "singular": "fruto", "plural": "frutos" },
"bulb": { "singular": "bulbo", "plural": "bulbos" },
"tuber": { "singular": "tubérculo", "plural": "tubérculos" },
"seedHead": { "singular": "cabeza de semillas", "plural": "cabezas de semillas" },
"bunch": { "singular": "manojo", "plural": "manojos" },
"plant": { "singular": "planta", "plural": "plantas" },
"pot": { "singular": "maceta", "plural": "macetas" },
"tray": { "singular": "bandeja", "plural": "bandejas" },
"grams": { "singular": "gramo", "plural": "gramos" },
"count": { "singular": "semilla", "plural": "semillas" }
}
}