Skip to content

Product more properties#27

Merged
LightJack05 merged 4 commits intomainfrom
product-more-properties
Feb 5, 2026
Merged

Product more properties#27
LightJack05 merged 4 commits intomainfrom
product-more-properties

Conversation

@LightJack05
Copy link
Member

No description provided.

@LightJack05 LightJack05 requested a review from Jannik-Hm February 5, 2026 22:09
@LightJack05 LightJack05 self-assigned this Feb 5, 2026
Copilot AI review requested due to automatic review settings February 5, 2026 22:09
@LightJack05 LightJack05 force-pushed the product-more-properties branch from 4b1c572 to d526726 Compare February 5, 2026 22:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request significantly expands the Product struct to include a comprehensive set of nutritional properties. The PR removes the previous complex structure with _value, _unit, _serving, and truncate tags, replacing it with a simpler two-field pattern (base and _100g variants) for each nutrient.

Changes:

  • Replaced the old Nutriments structure with an expanded list of ~180 nutritional properties (90 pairs of base + _100g fields)
  • Replaced the old NutrimentsEstimated structure with the same expanded set of properties
  • Updated Swagger documentation files (swagger.yaml, swagger.json, docs.go) to reflect the new schema
  • Removed fields: _value, _unit, _serving variants, truncate BSON option, nova-group fields, and fruits-vegetables-legumes-estimate 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 Expanded Nutriments and NutrimentsEstimated structs with comprehensive nutritional properties using a simplified two-field pattern (base and _100g)
docs/swagger.yaml Updated API documentation to reflect new Product schema fields
docs/swagger.json Updated API documentation (JSON format) to reflect new Product schema fields
docs/docs.go Updated embedded API documentation to reflect new Product schema fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

StearicAcid100g float64 `json:"stearic-acid_100g" bson:"stearic-acid_100g"`
StearicAcid float64 `json:"stearic-acid" bson:"stearic-acid"`
ArachidicAcid100g float64 `json:"arachidic-acid_100g" bson:"arachidic-acid_100g"`
ArachidicAcid float64 `json:"arachidic-acid" bson:"arachidonic-acid"`
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BSON tag for ArachidicAcid is "arachidonic-acid" but the JSON tag is "arachidic-acid". These should match. Arachidic acid and arachidonic acid are two different fatty acids. Based on the field name and the JSON tag, this should be "arachidic-acid" in both places. This mismatch will cause data to be stored under the wrong field name in the database.

Suggested change
ArachidicAcid float64 `json:"arachidic-acid" bson:"arachidonic-acid"`
ArachidicAcid float64 `json:"arachidic-acid" bson:"arachidic-acid"`

Copilot uses AI. Check for mistakes.
StearicAcid100g float64 `json:"stearic-acid_100g" bson:"stearic-acid_100g"`
StearicAcid float64 `json:"stearic-acid" bson:"stearic-acid"`
ArachidicAcid100g float64 `json:"arachidic-acid_100g" bson:"arachidic-acid_100g"`
ArachidicAcid float64 `json:"arachidic-acid" bson:"arachidonic-acid"`
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BSON tag for ArachidicAcid is "arachidonic-acid" but the JSON tag is "arachidic-acid". These should match. Arachidic acid and arachidonic acid are two different fatty acids. Based on the field name and the JSON tag, this should be "arachidic-acid" in both places. This mismatch will cause data to be stored under the wrong field name in the database.

Suggested change
ArachidicAcid float64 `json:"arachidic-acid" bson:"arachidonic-acid"`
ArachidicAcid float64 `json:"arachidic-acid" bson:"arachidic-acid"`

Copilot uses AI. Check for mistakes.
@LightJack05 LightJack05 merged commit 7166b28 into main Feb 5, 2026
6 checks passed
@LightJack05 LightJack05 deleted the product-more-properties branch February 5, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants