- migration 012: create ingredient_categories + ingredient_category_translations tables (7 slugs, Russian names); add ingredient_aliases (ingredient_id, lang, alias) with GIN trigram index; migrate aliases JSONB from ingredient_mappings and ingredient_translations; drop aliases columns and spoonacular_id; add UNIQUE (canonical_name) as conflict key - ingredient/model: remove SpoonacularID, add CategoryName for localized display - ingredient/repository: conflict on canonical_name; GetByID/Search join category translations and aliases lateral; new UpsertAliases (pgx batch), UpsertCategoryTranslation; remove GetBySpoonacularID; split scan helpers into scanMappingWrite / scanMappingRead - gemini/recognition: add IngredientTranslation type; IngredientClassification now carries Translations []IngredientTranslation instead of CanonicalNameRu; update ClassifyIngredient prompt to English with structured translations array - recognition/handler: update ingredientRepo interface; saveClassification uses UpsertAliases and iterates Translations - recipe/model: remove SpoonacularID from RecipeIngredient - integration tests: remove SpoonacularID fixtures, replace GetBySpoonacularID tests with GetByID, add UpsertAliases and UpsertCategoryTranslation tests - Flutter: remove canonicalNameRu from IngredientMapping, add categoryName; displayName returns server-resolved canonicalName; regenerate .g.dart Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
1022 B
Dart
28 lines
1022 B
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'ingredient_mapping.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
IngredientMapping _$IngredientMappingFromJson(Map<String, dynamic> json) =>
|
|
IngredientMapping(
|
|
id: json['id'] as String,
|
|
canonicalName: json['canonical_name'] as String,
|
|
categoryName: json['category_name'] as String?,
|
|
category: json['category'] as String?,
|
|
defaultUnit: json['default_unit'] as String?,
|
|
storageDays: (json['storage_days'] as num?)?.toInt(),
|
|
);
|
|
|
|
Map<String, dynamic> _$IngredientMappingToJson(IngredientMapping instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'canonical_name': instance.canonicalName,
|
|
'category_name': instance.categoryName,
|
|
'category': instance.category,
|
|
'default_unit': instance.defaultUnit,
|
|
'storage_days': instance.storageDays,
|
|
};
|