Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds five new nutrient-related fields to the Product struct and its corresponding API documentation. The changes support additional nutritional data tracking for products.
Changes:
- Added five new nutrient fields to both
NutrimentsandNutrimentsEstimatedstructs in the Product model - Updated Swagger/OpenAPI documentation (YAML and JSON) to reflect the new fields
- Updated generated documentation code to include the new fields
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/database/product/product.go | Added 5 new fields (FruitsVegetablesLegumesEstimateFromIngredients100g, Galactose_100g, NovaGroup, Phylloquinone_100g, Water_100g) to both Nutriments and NutrimentsEstimated structs |
| docs/swagger.yaml | Added the same 5 fields to both nutriments and nutriments_estimated schema definitions in alphabetical order |
| docs/swagger.json | Added the same 5 fields to both nutriments and nutriments_estimated schema definitions in alphabetical order |
| docs/docs.go | Updated generated documentation template to include the 5 new fields in both schema definitions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Galactose_100g float64 `json:"galactose_100g" bson:"galactose_100g"` | ||
| NovaGroup float64 `json:"nova-group" bson:"nova-group,truncate"` | ||
| Phylloquinone_100g float64 `json:"phylloquinone_100g" bson:"phylloquinone_100g"` | ||
| Water_100g float64 `json:"water_100g" bson:"water_100g"` |
There was a problem hiding this comment.
The field names Galactose_100g, Phylloquinone_100g, and Water_100g violate the established naming convention. Throughout the codebase, all nutrient fields use CamelCase format without underscores (e.g., Fructose100g, Glucose100g, Maltose100g, Zinc100g). These fields should be renamed to Galactose100g, Phylloquinone100g, and Water100g respectively to maintain consistency.
| Galactose_100g float64 `json:"galactose_100g" bson:"galactose_100g"` | |
| NovaGroup float64 `json:"nova-group" bson:"nova-group,truncate"` | |
| Phylloquinone_100g float64 `json:"phylloquinone_100g" bson:"phylloquinone_100g"` | |
| Water_100g float64 `json:"water_100g" bson:"water_100g"` | |
| Galactose100g float64 `json:"galactose_100g" bson:"galactose_100g"` | |
| NovaGroup float64 `json:"nova-group" bson:"nova-group,truncate"` | |
| Phylloquinone100g float64 `json:"phylloquinone_100g" bson:"phylloquinone_100g"` | |
| Water100g float64 `json:"water_100g" bson:"water_100g"` |
| Galactose_100g float64 `json:"galactose_100g" bson:"galactose_100g"` | ||
| NovaGroup float64 `json:"nova-group" bson:"nova-group,truncate"` | ||
| Phylloquinone_100g float64 `json:"phylloquinone_100g" bson:"phylloquinone_100g"` | ||
| Water_100g float64 `json:"water_100g" bson:"water_100g"` |
There was a problem hiding this comment.
The field names Galactose_100g, Phylloquinone_100g, and Water_100g violate the established naming convention. Throughout the codebase, all nutrient fields use CamelCase format without underscores (e.g., Fructose100g, Glucose100g, Maltose100g, Zinc100g). These fields should be renamed to Galactose100g, Phylloquinone100g, and Water100g respectively to maintain consistency.
| Galactose_100g float64 `json:"galactose_100g" bson:"galactose_100g"` | |
| NovaGroup float64 `json:"nova-group" bson:"nova-group,truncate"` | |
| Phylloquinone_100g float64 `json:"phylloquinone_100g" bson:"phylloquinone_100g"` | |
| Water_100g float64 `json:"water_100g" bson:"water_100g"` | |
| Galactose100g float64 `json:"galactose_100g" bson:"galactose_100g"` | |
| NovaGroup float64 `json:"nova-group" bson:"nova-group,truncate"` | |
| Phylloquinone100g float64 `json:"phylloquinone_100g" bson:"phylloquinone_100g"` | |
| Water100g float64 `json:"water_100g" bson:"water_100g"` |
No description provided.