feat: multi-tenancy database filters, duplicate username auth, and empty-state UX enhancements#10
Merged
Conversation
…d empty-state UX fixes
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🛠️ Summary of Implementation
This Pull Request introduces enterprise-grade multi-tenancy, refactored authentication policies, real-time profile editing, and comprehensive UI/UX fixes across the frontend and backend. It resolves all outstanding compilation blocks and cleans up compiler warnings across the solution.
🚀 Key Enhancements Added
1. Global Multi-Tenancy & Database Isolation
IHttpContextAccessorintoApplicationDbContextto dynamically extract theNameIdentifierclaim. All database queries forProduct,Order,SalesHistory,Customer, andReorderRequestare now automatically filtered by the current user's ID (e.UserId == CurrentUserId).SaveChangesAsyncinApplicationDbContextto automatically inject the authenticatedUserIdon new entity creations.ApplicationDbContextFactory.cs) to supportIHttpContextAccessorusing default accessors, enabling seamless schema updates viadotnet ef.2. Authenticated Profile & Duplicate Username Support
RequireUniqueEmail = trueand updatedNormalizedUserNameto be non-unique. Users can now sign up with duplicate display usernames (e.g. two separate users namedadminunder different email addresses) with zero database index conflicts.3. Frontend UI/UX Refactoring
max-w-[280px]to a spaciousmax-w-md, optimizing spacing and typography.ConfirmationModalto support synchronous loader spinners and disabled button actions during async operations, auto-closing only upon successful backend API completion.4. Compiler Clean-up
CreateOrderCommandHandlerTestsby mockingIHttpContextAccessorfor database contexts.GetOrdersQuery.csusing safe-navigation checks (o.Customer?.Name ?? "Unknown Customer").🔍 Verification & Integrity
dotnet ef database update.API,Application,Infrastructure,Tests) build and compile with 100% success.