Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Brand domain model with events and exception handling Introduced the `Brand` class in the `FSH.Starter.WebApi.Catalog.Domain` namespace, inheriting from `AuditableEntity` and implementing `IAggregateRoot`. Added properties for `Name` and `Description`, and methods for creating and updating brand instances. Queued domain events `BrandCreated` and `BrandUpdated` during these operations. Added `BrandCreated` and `BrandUpdated` classes in the `FSH.Starter.WebApi.Catalog.Domain.Events` namespace, both inheriting from `DomainEvent` and including a property for the `Brand` instance. Added `BrandNotFoundException` class in the `FSH.Starter.WebApi.Catalog.Domain.Exceptions` namespace, inheriting from `NotFoundException` to handle cases where a brand with a specified ID is not found. * Add brand management commands and handlers Added commands and handlers for brand management: - CreateBrandCommand, CreateBrandCommandValidator, CreateBrandHandler, and CreateBrandResponse for creating brands. - DeleteBrandCommand and DeleteBrandHandler for deleting brands. - BrandCreatedEventHandler for handling brand creation events. - BrandResponse and GetBrandHandler for retrieving brand details. - GetBrandRequest for brand retrieval requests. - SearchBrandSpecs, SearchBrandsCommand, and SearchBrandsHandler for searching brands with pagination. - UpdateBrandCommand, UpdateBrandCommandValidator, UpdateBrandHandler, and UpdateBrandResponse for updating brand details. * Add brand-related endpoints in API version 1 Introduce new endpoints for brand operations in the FSH.Starter.WebApi.Catalog.Infrastructure.Endpoints.v1 namespace. Endpoints include CreateBrand, DeleteBrand, GetBrand, SearchBrands, and UpdateBrand, each secured with specific permissions and mapped to appropriate routes. Handlers use MediatR for request handling and response production. * Add BrandConfiguration for EF Core in Catalog project Introduce BrandConfiguration class to configure the Brand entity for Entity Framework Core. This includes enabling multi-tenancy, setting the primary key, and specifying maximum lengths for the Name (100 characters) and Description (1000 characters) properties. * Add permissions for managing Brands in FshPermissions The changes introduce new permissions related to the "Brands" resource in the `FshPermissions` class. Specifically, the following permissions are added: - View Brands (with `IsBasic` set to true) - Search Brands (with `IsBasic` set to true) - Create Brands - Update Brands - Delete Brands - Export Brands The "View Brands" and "Search Brands" permissions are marked as basic, indicating they might be available to users with basic access rights. * Refactor product handling to include brand details - Modified GetProductHandler to use specification pattern - Added GetProductSpecs for flexible product querying - Updated ProductResponse to include BrandResponse - Enhanced SearchProductSpecs to include brand details - Updated Product class to establish brand relationship - Modified Create and Update methods to accept brandId * Add brand management endpoints and services Introduce new endpoints in CatalogModule for brand creation, retrieval, listing, updating, and deletion. Register scoped services for Brand in RegisterCatalogServices method. Add DbSet<Brand> property in CatalogDbContext for managing Brand entities. * Add BrandId property to product commands and handlers - Updated CreateProductCommand and UpdateProductCommand to include BrandId with a default value of null. - Modified CreateProductHandler and UpdateProductHandler to pass BrandId when creating or updating a product. - Added BrandId filter condition in SearchProductSpecs. - Updated CatalogDbInitializer to include BrandId when seeding the database. * Add Brands table and update Catalog schema Removed old migration and added new migration to create Brands table alongside Products table. Updated Designer and DbContext snapshot to reflect new schema. Updated project file to include new Catalog folder. * Add cancellation tokens, brand methods, and update runtime Enhanced ApiClient with cancellation tokens and new brand methods. Updated serialization to use JsonSerializerSettings. Upgraded NJsonSchema and NSwag to 14.1.0.0. Changed runtime in nswag.json from WinX64 to Net80. * Add Brands management feature with navigation and CRUD Introduced a new "Brands" section in the application: - Added a navigation link for "Brands" in `NavMenu.razor`. - Implemented permission checks for viewing Brands in `NavMenu.razor.cs`. - Created `Brands.razor` page with route `/catalog/brands`. - Set up `EntityTable` component for managing brands. - Added `Brands` class and dependency injection in `Brands.razor.cs`. - Defined `BrandViewModel` for CRUD operations in `Brands.razor.cs`. * Add brand selection to Products component Added a `MudSelect` component in `Products.razor` for brand selection, bound to `context.BrandId` and populated with a list of brands. Introduced a private `_brands` field in `Products.razor.cs` to store the list of brands. Modified `OnInitialized` to `OnInitializedAsync` and added `LoadBrandsAsync` to fetch brands from the server. Updated `EntityServerTableContext` initialization to include the brand name field. * Add brand filter dropdown to advanced search Added a dropdown (`MudSelect`) for selecting a brand in the advanced search section of the `Products.razor` file, allowing users to filter products by brand with an "All Brands" option. Updated the search function in `Products.razor.cs` to include the selected brand ID (`SearchBrandId`). Changed the type of `SearchBrandId` from `Guid` to `Guid?` to support the nullable brand ID for the "All Brands" option. * Remove Catalog folder reference from PostgreSQL.csproj The `ItemGroup` containing the `<Folder Include="Catalog\" />` line was removed from the `PostgreSQL.csproj` file. This change eliminates the folder reference to `Catalog` from the project file.
- Loading branch information