feat(inventory): month/year harvest date picker (schema v3)

Replace the free-text harvest year with a themed month/year picker:
a tappable field opens a green-styled dialog with month and year grids
(navigable, paginated years), month optional. Lots now read e.g.
"September 2021" or just "Year 2021".

- schema v3: add nullable Lot.harvest_month (1..12) + migration + tests
- repo/cubit propagate harvestMonth; localized month names (en/es) via slang
This commit is contained in:
vjrj 2026-07-08 12:09:38 +02:00
parent 9e5c82184b
commit 5d4053157f
17 changed files with 3799 additions and 57 deletions

View file

@ -56,10 +56,19 @@
},
"addLot": {
"title": "Add lot",
"year": "Harvest year",
"year": "Harvest date",
"quantity": "How much?",
"amount": "Amount"
},
"harvest": {
"pickTitle": "Select month / year",
"anyMonth": "Any month",
"noDate": "Set harvest date",
"monthNames": [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
]
},
"lotType": {
"seed": "Seeds",
"plant": "Plants"

View file

@ -56,10 +56,19 @@
},
"addLot": {
"title": "Añadir lote",
"year": "Año de cosecha",
"year": "Fecha de cosecha",
"quantity": "¿Cuánta?",
"amount": "Cantidad"
},
"harvest": {
"pickTitle": "Seleccionar mes / año",
"anyMonth": "Cualquier mes",
"noDate": "Indicar fecha de cosecha",
"monthNames": [
"enero", "febrero", "marzo", "abril", "mayo", "junio",
"julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"
]
},
"lotType": {
"seed": "Semillas",
"plant": "Plantel"

View file

@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 2
/// Strings: 186 (93 per locale)
/// Strings: 216 (108 per locale)
///
/// Built on 2026-07-08 at 09:16 UTC
/// Built on 2026-07-08 at 10:02 UTC
// coverage:ignore-file
// ignore_for_file: type=lint, unused_import

View file

@ -48,6 +48,7 @@ class Translations with BaseTranslations<AppLocale, Translations> {
late final Translations$germination$en germination = Translations$germination$en.internal(_root);
late final Translations$editVariety$en editVariety = Translations$editVariety$en.internal(_root);
late final Translations$addLot$en addLot = Translations$addLot$en.internal(_root);
late final Translations$harvest$en harvest = Translations$harvest$en.internal(_root);
late final Translations$lotType$en lotType = Translations$lotType$en.internal(_root);
late final Translations$unit$en unit = Translations$unit$en.internal(_root);
}
@ -249,8 +250,8 @@ class Translations$addLot$en {
/// en: 'Add lot'
String get title => 'Add lot';
/// en: 'Harvest year'
String get year => 'Harvest year';
/// en: 'Harvest date'
String get year => 'Harvest date';
/// en: 'How much?'
String get quantity => 'How much?';
@ -259,6 +260,39 @@ class Translations$addLot$en {
String get amount => 'Amount';
}
// Path: harvest
class Translations$harvest$en {
Translations$harvest$en.internal(this._root);
final Translations _root; // ignore: unused_field
// Translations
/// en: 'Select month / year'
String get pickTitle => 'Select month / year';
/// en: 'Any month'
String get anyMonth => 'Any month';
/// en: 'Set harvest date'
String get noDate => 'Set harvest date';
List<String> get monthNames => [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
];
}
// Path: lotType
class Translations$lotType$en {
Translations$lotType$en.internal(this._root);
@ -682,9 +716,24 @@ extension on Translations {
'editVariety.species' => 'Species (from catalog)',
'editVariety.speciesHint' => 'Search a species…',
'addLot.title' => 'Add lot',
'addLot.year' => 'Harvest year',
'addLot.year' => 'Harvest date',
'addLot.quantity' => 'How much?',
'addLot.amount' => 'Amount',
'harvest.pickTitle' => 'Select month / year',
'harvest.anyMonth' => 'Any month',
'harvest.noDate' => 'Set harvest date',
'harvest.monthNames.0' => 'January',
'harvest.monthNames.1' => 'February',
'harvest.monthNames.2' => 'March',
'harvest.monthNames.3' => 'April',
'harvest.monthNames.4' => 'May',
'harvest.monthNames.5' => 'June',
'harvest.monthNames.6' => 'July',
'harvest.monthNames.7' => 'August',
'harvest.monthNames.8' => 'September',
'harvest.monthNames.9' => 'October',
'harvest.monthNames.10' => 'November',
'harvest.monthNames.11' => 'December',
'lotType.seed' => 'Seeds',
'lotType.plant' => 'Plants',
'unit.aFew' => 'a few',

View file

@ -47,6 +47,7 @@ class TranslationsEs extends Translations with BaseTranslations<AppLocale, Trans
@override late final _Translations$germination$es germination = _Translations$germination$es._(_root);
@override late final _Translations$editVariety$es editVariety = _Translations$editVariety$es._(_root);
@override late final _Translations$addLot$es addLot = _Translations$addLot$es._(_root);
@override late final _Translations$harvest$es harvest = _Translations$harvest$es._(_root);
@override late final _Translations$lotType$es lotType = _Translations$lotType$es._(_root);
@override late final _Translations$unit$es unit = _Translations$unit$es._(_root);
}
@ -163,11 +164,37 @@ class _Translations$addLot$es extends Translations$addLot$en {
// Translations
@override String get title => 'Añadir lote';
@override String get year => 'Año de cosecha';
@override String get year => 'Fecha de cosecha';
@override String get quantity => '¿Cuánta?';
@override String get amount => 'Cantidad';
}
// Path: harvest
class _Translations$harvest$es extends Translations$harvest$en {
_Translations$harvest$es._(TranslationsEs root) : this._root = root, super.internal(root);
final TranslationsEs _root; // ignore: unused_field
// Translations
@override String get pickTitle => 'Seleccionar mes / año';
@override String get anyMonth => 'Cualquier mes';
@override String get noDate => 'Indicar fecha de cosecha';
@override List<String> get monthNames => [
'enero',
'febrero',
'marzo',
'abril',
'mayo',
'junio',
'julio',
'agosto',
'septiembre',
'octubre',
'noviembre',
'diciembre',
];
}
// Path: lotType
class _Translations$lotType$es extends Translations$lotType$en {
_Translations$lotType$es._(TranslationsEs root) : this._root = root, super.internal(root);
@ -494,9 +521,24 @@ extension on TranslationsEs {
'editVariety.species' => 'Especie (del catálogo)',
'editVariety.speciesHint' => 'Buscar una especie…',
'addLot.title' => 'Añadir lote',
'addLot.year' => 'Año de cosecha',
'addLot.year' => 'Fecha de cosecha',
'addLot.quantity' => '¿Cuánta?',
'addLot.amount' => 'Cantidad',
'harvest.pickTitle' => 'Seleccionar mes / año',
'harvest.anyMonth' => 'Cualquier mes',
'harvest.noDate' => 'Indicar fecha de cosecha',
'harvest.monthNames.0' => 'enero',
'harvest.monthNames.1' => 'febrero',
'harvest.monthNames.2' => 'marzo',
'harvest.monthNames.3' => 'abril',
'harvest.monthNames.4' => 'mayo',
'harvest.monthNames.5' => 'junio',
'harvest.monthNames.6' => 'julio',
'harvest.monthNames.7' => 'agosto',
'harvest.monthNames.8' => 'septiembre',
'harvest.monthNames.9' => 'octubre',
'harvest.monthNames.10' => 'noviembre',
'harvest.monthNames.11' => 'diciembre',
'lotType.seed' => 'Semillas',
'lotType.plant' => 'Plantel',
'unit.aFew' => 'unas pocas',