feat(block1): bundled species catalog + autocomplete link
Add a small curated catalog of Iberian horticultural species and let a variety be linked to it from the edit sheet. - assets/catalog/species.json: 14 species with botanical family and ES/EN common names (wikidata_qid/gbif_key deferred to the varilla enrichment). - SpeciesRepository: idempotent seedBundled (is_bundled rows, keyed by scientific name) + search by scientific/common name with a locale-best label. Seeded on startup from DI. - VarietyRepository.linkSpecies: sets species_id and prefills category from the species' family when empty (never overwrites an existing category). VarietyDetail now carries the scientific name. - Edit sheet gains a live species-search field; the detail view shows the scientific name (italic). i18n strings added (ES/EN). Tests: catalog parse, idempotent seeding, search by scientific/common name, linkSpecies prefill semantics, and a widget test for the autocomplete → link → scientific-name-shown flow. Full suite: 32 passing, 0 skipped.
This commit is contained in:
parent
7ff4e38a15
commit
4e8b8293e0
22 changed files with 700 additions and 47 deletions
76
apps/app_seeds/assets/catalog/species.json
Normal file
76
apps/app_seeds/assets/catalog/species.json
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"version": 1,
|
||||
"note": "Curated starter set of Iberian horticultural species. Family and common names are stable; wikidata_qid/gbif_key are intentionally omitted here and enriched later from the varilla (Wikidata CC0 + GBIF) work.",
|
||||
"species": [
|
||||
{
|
||||
"scientific_name": "Solanum lycopersicum",
|
||||
"family": "Solanaceae",
|
||||
"common": { "es": ["Tomate"], "en": ["Tomato"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Solanum melongena",
|
||||
"family": "Solanaceae",
|
||||
"common": { "es": ["Berenjena"], "en": ["Aubergine", "Eggplant"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Capsicum annuum",
|
||||
"family": "Solanaceae",
|
||||
"common": { "es": ["Pimiento", "Guindilla"], "en": ["Pepper", "Chilli"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Phaseolus vulgaris",
|
||||
"family": "Fabaceae",
|
||||
"common": { "es": ["Judía", "Alubia", "Habichuela"], "en": ["Common bean"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Vicia faba",
|
||||
"family": "Fabaceae",
|
||||
"common": { "es": ["Haba"], "en": ["Broad bean", "Fava bean"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Pisum sativum",
|
||||
"family": "Fabaceae",
|
||||
"common": { "es": ["Guisante"], "en": ["Pea"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Zea mays",
|
||||
"family": "Poaceae",
|
||||
"common": { "es": ["Maíz"], "en": ["Maize", "Corn"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Cucurbita pepo",
|
||||
"family": "Cucurbitaceae",
|
||||
"common": { "es": ["Calabacín", "Calabaza"], "en": ["Courgette", "Zucchini", "Squash"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Cucumis sativus",
|
||||
"family": "Cucurbitaceae",
|
||||
"common": { "es": ["Pepino"], "en": ["Cucumber"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Lactuca sativa",
|
||||
"family": "Asteraceae",
|
||||
"common": { "es": ["Lechuga"], "en": ["Lettuce"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Beta vulgaris",
|
||||
"family": "Amaranthaceae",
|
||||
"common": { "es": ["Acelga", "Remolacha"], "en": ["Chard", "Beetroot"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Allium cepa",
|
||||
"family": "Amaryllidaceae",
|
||||
"common": { "es": ["Cebolla"], "en": ["Onion"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Allium sativum",
|
||||
"family": "Amaryllidaceae",
|
||||
"common": { "es": ["Ajo"], "en": ["Garlic"] }
|
||||
},
|
||||
{
|
||||
"scientific_name": "Daucus carota",
|
||||
"family": "Apiaceae",
|
||||
"common": { "es": ["Zanahoria"], "en": ["Carrot"] }
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue