Skip to content

Comments

Add shopping list recommendations with autocomplete and admin approval workflow#54

Merged
inur93 merged 6 commits intomainfrom
copilot/add-shopping-list-recommendations
Feb 23, 2026
Merged

Add shopping list recommendations with autocomplete and admin approval workflow#54
inur93 merged 6 commits intomainfrom
copilot/add-shopping-list-recommendations

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

  • Backend: Add ShoppingListRecommendation entity to ApplicationDbContext.cs
  • Backend: Create RecommendationEndpoints.cs (GET approved, GET pending admin-only, POST approve admin-only, DELETE admin-only)
  • Backend: Auto-create pending recommendation when item is added to shopping list (case-insensitive dedup)
  • Backend: Create EF migration AddShoppingListRecommendations for new table
  • Backend: Register new endpoints and Admin authorization policy in Program.cs
  • Frontend (api-client): Add ShoppingListRecommendation model types to models/index.ts
  • Frontend (api-client): Create shoppingListRecommendations request builders (main, item, approve, pending)
  • Frontend (api-client): Update api/index.ts to include shoppingListRecommendations
  • Frontend: Create hooks/useRecommendations.ts with approved/pending/approve/delete hooks
  • Frontend: Update shopping-lists/[id]/page.tsx with autocomplete dropdown showing approved recommendations while typing
  • Frontend: Update admin/page.tsx to show and manage pending recommendations (approve/reject)
  • Tests: Backend integration tests for recommendation endpoints (ShoppingListRecommendationEndpointTests.cs)
  • Tests: Frontend unit tests for recommendation hooks (useRecommendations.test.tsx)
  • Fix: GetUserHttpClientAsync — read invite token from POST response instead of nonexistent GET endpoint
  • Fix: ResetDatabaseAsync — clear ShoppingListRecommendations, ShoppingListItems, ShoppingLists between tests
  • Fix: ResetDatabaseAsync — also remove non-admin users to prevent POST /api/auth/invites returning 400 when user@test.com already exists
Original prompt

This section details on the original issue you should resolve

<issue_title>Recommendations for shopping list </issue_title>
<issue_description>When writing the shoppinglist I want recommendations while writing to allow faster adding of new items.
By default unknown items should be added to recommendations, but will require approval, to avoid creating recommendations that have typos or for some other reason should not be added.</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 3 commits February 23, 2026 09:20
… approval

Co-authored-by: inur93 <5747088+inur93@users.noreply.github.com>
Co-authored-by: inur93 <5747088+inur93@users.noreply.github.com>
Co-authored-by: inur93 <5747088+inur93@users.noreply.github.com>
Copilot AI changed the title [WIP] Add recommendations for shopping list items Add shopping list recommendations with autocomplete and admin approval workflow Feb 23, 2026
Copilot AI requested a review from inur93 February 23, 2026 09:24
Copy link
Contributor

@inur93 inur93 left a comment

Choose a reason for hiding this comment

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

Pending recommendations tests are failing for the backend.

… ResetDatabaseAsync

Co-authored-by: inur93 <5747088+inur93@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 23, 2026

Pending recommendations tests are failing for the backend.

Fixed in e6f825e. Two issues were causing the failures:

  1. GetUserHttpClientAsync was trying to GET /api/auth/invites (which doesn't exist) instead of reading the invite token directly from the POST /api/auth/invites response.
  2. ResetDatabaseAsync wasn't clearing ShoppingListRecommendations, ShoppingListItems, or ShoppingLists, causing data from other tests to bleed into the "WhenEmpty" assertions.

Copilot AI requested a review from inur93 February 23, 2026 11:39
Copy link
Contributor

@inur93 inur93 left a comment

Choose a reason for hiding this comment

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

There are still integrationtests that are failing. Please ensure all are green

…revent invite conflicts

Co-authored-by: inur93 <5747088+inur93@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 23, 2026

There are still integrationtests that are failing. Please ensure all are green

Fixed in e61953c. The remaining failures were caused by user@test.com lingering in the database between tests — when a second test called POST /api/auth/invites with the same email, the server returned 400 "User with this email already exists." instead of the expected invite JSON, causing the deserialization to fail. ResetDatabaseAsync now removes all non-admin users between tests.

Copilot AI requested a review from inur93 February 23, 2026 12:17
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed for 'Anything Frontend'

Failed conditions
74.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sonarqubecloud
Copy link

@inur93 inur93 marked this pull request as ready for review February 23, 2026 13:12
@inur93 inur93 merged commit b200577 into main Feb 23, 2026
7 of 8 checks passed
@inur93 inur93 deleted the copilot/add-shopping-list-recommendations branch February 23, 2026 13:12
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.

Recommendations for shopping list

2 participants