You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented deleteProduct in MongoStorage to clear products and all their dependencies (comments, reviews, owners, events, transfers, scans, notifications) in MongoDB.
Created the secure DELETE /api/products/:id API route protecting it so that only the product owner or an admin user can delete the product.
Implemented useDeleteProduct mutation hook in frontend to invalidate the ["/api/stats"] and ["/api/products"] query cache upon success.
Updated StatsOverview to show the system-wide stats (including the "Total Products" stat card) for admin users instead of user-specific cards.
Added a styled, destructive Delete button with a confirmation dialog on registered-products.tsx for owners and admins, and allowed admins to view all registered products.
Updated setup.ts and wrote integration tests in rbac.test.ts to verify product deletion security rules for all user roles.
🔧 Type of Change
🐛 Bug fix
✨ New feature / enhancement
🧹 Refactor / code cleanup
📄 Documentation update
🧪 Test addition or update
⚙️ Configuration / tooling change
🧪 Testing Steps
Run the backend integration test suite locally to verify authentication and RBAC for product deletion:
npm run test
Log in as an admin or farmer, note the stats on the dashboard, navigate to the registered products page, delete a product, and return to verify that the "Total Products" stat card updates instantly without a manual page refresh.
Environment tested on:
OS: Windows
Node version: v24.11.0
🎥 Demo
✅ Checklist
My code follows the project's coding style and conventions
I have tested my changes locally (npm install + npm run dev)
I have linked the relevant issue above
I have not introduced any new linting errors or warnings
I have updated documentation if needed
My branch is up to date with main
🌟 GSSoC Declaration
This PR is submitted under GSSoC 2026
I have read and followed the
Contributing Guidelines
I have not plagiarised any content
This is my original work
Implemented deleteProduct in MongoStorage to clear products and all their dependencies (comments, reviews, owners, events, transfers, scans, notifications) in MongoDB.
Created the secure DELETE /api/products/:id API route protecting it so that only the product owner or an admin user can delete the product.
Implemented useDeleteProduct mutation hook in frontend to invalidate the ["/api/stats"] and ["/api/products"] query cache upon success.
Updated StatsOverview to show the system-wide stats (including the "Total Products" stat card) for admin users instead of user-specific cards.
Added a styled, destructive Delete button with a confirmation dialog on registered-products.tsx for owners and admins, and allowed admins to view all registered products.
Updated setup.ts and wrote integration tests in rbac.test.ts to verify product deletion security rules for all user roles.
🔧 Type of Change
🐛 Bug fix
✨ New feature / enhancement
🧹 Refactor / code cleanup
📄 Documentation update
🧪 Test addition or update
⚙️ Configuration / tooling change
🧪 Testing Steps
Run the backend integration test suite locally to verify authentication and RBAC for product deletion:
npm run test
Log in as an admin or farmer, note the stats on the dashboard, navigate to the registered products page, delete a product, and return to verify that the "Total Products" stat card updates instantly without a manual page refresh. Environment tested on:
OS: Windows Node version: v24.11.0 🎥 Demo ✅ Checklist My code follows the project's coding style and conventions I have tested my changes locally (npm install + npm run dev) I have linked the relevant issue above I have not introduced any new linting errors or warnings I have updated documentation if needed My branch is up to date with main 🌟 GSSoC Declaration This PR is submitted under GSSoC 2026 I have read and followed the
Contributing Guidelines I have not plagiarised any content This is my original work
u have conflicts resolve them and also how can u assign a user mail as an admin also add instruction for this also and if possible add screen recording of your work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gssoc'26Contribution for GirlScript Summer of Code 2026
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Linked Issue
Closes #240
📝 Summary of Changes
deleteProductinMongoStorageto clear products and all their dependencies (comments, reviews, owners, events, transfers, scans, notifications) in MongoDB.DELETE /api/products/:idAPI route protecting it so that only the product owner or an admin user can delete the product.useDeleteProductmutation hook in frontend to invalidate the["/api/stats"]and["/api/products"]query cache upon success.StatsOverviewto show the system-wide stats (including the "Total Products" stat card) for admin users instead of user-specific cards.registered-products.tsxfor owners and admins, and allowed admins to view all registered products.setup.tsand wrote integration tests inrbac.test.tsto verify product deletion security rules for all user roles.🔧 Type of Change
🧪 Testing Steps
npm run testLog in as an admin or farmer, note the stats on the dashboard, navigate to the registered products page, delete a product, and return to verify that the "Total Products" stat card updates instantly without a manual page refresh.
Environment tested on:
OS: Windows
Node version: v24.11.0
🎥 Demo
✅ Checklist
My code follows the project's coding style and conventions
I have tested my changes locally (npm install + npm run dev)
I have linked the relevant issue above
I have not introduced any new linting errors or warnings
I have updated documentation if needed
My branch is up to date with main
🌟 GSSoC Declaration
This PR is submitted under GSSoC 2026
I have read and followed the
Contributing Guidelines
I have not plagiarised any content
This is my original work