import 'package:json_annotation/json_annotation.dart'; part 'ingredient_mapping.g.dart'; @JsonSerializable() class IngredientMapping { final String id; @JsonKey(name: 'canonical_name') final String canonicalName; @JsonKey(name: 'category_name') final String? categoryName; final String? category; @JsonKey(name: 'default_unit') final String? defaultUnit; @JsonKey(name: 'storage_days') final int? storageDays; const IngredientMapping({ required this.id, required this.canonicalName, this.categoryName, this.category, this.defaultUnit, this.storageDays, }); /// Display name is the server-resolved canonical name (language-aware from backend). String get displayName => canonicalName; factory IngredientMapping.fromJson(Map json) => _$IngredientMappingFromJson(json); Map toJson() => _$IngredientMappingToJson(this); }