Skip to content

Feature/27 food catalog - #86

Merged
lauriechammah merged 2 commits into
developfrom
feature/27-food-catalog
Nov 18, 2026
Merged

lauriechammah merged 2 commits into
developfrom
feature/27-food-catalog

Conversation

@jspngl

@jspngl jspngl commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Closes #27

Overview

The catalog is the shared list of foods that donations point to, so the same food keeps one name and can be matched with Business Central. The price grid had already created catalog_items with only a name. This adds the remaining fields on that same table: category, a unique Business Central code, unit, and the quality class.

The quality class is stored on the catalog item and must be a class that already exists. catalog_items is the kind of food. food_items is one donation of that food. The unit is free text until issue #28 decides how a price per unit works.

List, create, and edit are available at api/catalog-items. A duplicate Business Central code is rejected.

Testing

dotnet test passed, 341 tests.

  • Unit tests check that names, categories, codes, and units are required and trimmed, and that a quality class must be one capital letter.
  • Integration tests check the migration: the new fields are stored, the Business Central code is unique, empty values are refused, and the quality class must exist.
  • API tests check list, create, and edit, including a conflict when the Business Central code is already used and a bad request when the quality class does not exist.

Screenshots / Screencasts

No frontend changes. The catalog diagram is in docs/database/images/catalog.png.

Checklist

  • Code is neat, readable, and works
  • Code is commented where appropriate and well-documented
  • Commit messages follow our guidelines
  • Issue number is linked
  • Branch is linked
  • Reviewers are assigned (one of your tech leads)

Tip: You can make the issue and then check them after the fact or replace [ ] with [x] to check it!

Notes

https://dbdiagram.io/d/6afbc6704e0bad6598d94e59

@jspngl
jspngl changed the base branch from main to develop November 17, 2026 04:22
@lauriechammah
lauriechammah removed the request for review from anis022 November 17, 2026 18:07

@lauriechammah lauriechammah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See requested changes below

@jspngl
jspngl requested a review from lauriechammah November 17, 2026 20:26

@lauriechammah lauriechammah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@lauriechammah
lauriechammah merged commit a7f9e51 into develop Nov 18, 2026
7 checks passed
@lauriechammah lauriechammah mentioned this pull request Nov 18, 2026
6 tasks
@lauriechammah
lauriechammah deleted the feature/27-food-catalog branch November 18, 2026 18:54
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.

[Issue]: Food catalog (name, category, Business Central code)

2 participants