Commit Graph

53 Commits

Author SHA1 Message Date
OlgunR
1667788558 Enhance Catalogs grid UI and filter row experience
Added custom CSS for sortable headers and search inputs. Replaced default filter row inputs with styled DxTextBox components. Set default sort on "Id" column and disabled sorting for action column. Updated grid to use new catalog-grid styles.
2026-02-02 13:38:44 +01:00
OlgunR
b09ee6dc8d Remove DevExpress Fluent and external theme CSS files
Removed several DevExpress Blazor Fluent theme stylesheets and the bootstrap-external.bs5.min.css from index.html. Retained only default Bootstrap, app-specific, and DevExpress Dashboard styles to simplify and standardize application theming.
2026-02-02 12:54:08 +01:00
OlgunR
0213834858 Update to DevExpress Fluent theme and enable SSR
Switched from old DevExpress Blazor theme and icons to Fluent theme stylesheets in index.html and App.razor. Added @rendermode InteractiveServer to Routes.razor to enable interactive server-side rendering.
2026-02-02 10:04:50 +01:00
OlgunR
38baf9f749 Integrate DevExpress Web Dashboard into API and Blazor
Added DevExpress Dashboard to ASP.NET Core API and both Blazor WASM/Server frontends. Configured dashboard storage, sample data source, and API endpoint. Updated Blazor projects with dashboard packages, styles, and a new dashboard page. Navigation and configuration updated to support dashboard integration.
2026-02-02 09:01:08 +01:00
OlgunR
0532cbb329 Add DevExpress.Blazor package reference
Added DevExpress.Blazor v25.1.3 to the project file to enable usage of DevExpress Blazor UI components in the application.
2026-01-30 11:16:06 +01:00
OlgunR
f9a6341b41 Add BlazorWebApp project and Bootstrap source map
Added new Blazor Server project `DbFirst.BlazorWebApp` with core UI components, pages, and static assets. Updated solution file to include the project. Also added `bootstrap.min.css.map` to support CSS debugging in browser developer tools.
2026-01-30 11:12:55 +01:00
OlgunR
98b841196e Add detailed comments and app flow documentation for BlazorWasm
Added comprehensive inline comments (mainly in German) to key files (index.html, Program.cs, App.razor, MainLayout.razor, NavMenu.razor, Catalogs.razor, CatalogApiClient.cs) to clarify their roles and the overall application flow. Updated Home.razor with a clearer heading and intro. Introduced Ablauf.cs, which documents the loading order and responsibilities of each major component. These changes enhance codebase clarity and maintainability, especially for German-speaking developers.
2026-01-28 15:03:52 +01:00
OlgunR
05964eb02e Improve Catalogs page layout with spacing and styling
Added CSS classes for better spacing between form and grid.
Wrapped form in .action-panel and grid in .grid-section divs
to enhance visual separation. No functional changes made.
2026-01-21 10:26:12 +01:00
OlgunR
e55f215210 Integrate DevExpress Blazor UI components throughout app
Replaced Bootstrap UI with DevExpress components in Catalogs.razor, including forms and data grid. Added DevExpress.Blazor package, styles, and service registration. Updated _Imports.razor for global DevExpress usage. Modernizes UI and improves user experience.
2026-01-21 10:21:51 +01:00
OlgunR
6b89f7bd72 Improve CORS config: block all if no origins specified
Refined CORS policy in Program.cs for better security. In development, all origins are allowed. In production, only configured origins are allowed; if none are specified, all cross-origin requests are blocked by default. Switched to Array.Empty<string>() for clarity.
2026-01-19 17:08:55 +01:00
OlgunR
7a78a48d03 Remove Repositories folder reference from project file
Removed the <ItemGroup> entry for the "Repositories" folder in DbFirst.Domain.csproj. This change only affects the project file and does not delete the folder or its contents from the file system.
2026-01-19 17:06:11 +01:00
OlgunR
0b3249cb46 Remove CatalogService and ICatalogService implementations
Eliminated the catalog service layer by deleting both CatalogService.cs and ICatalogService.cs. This removes all catalog-related CRUD operations, mapping logic, repository interactions, and domain-specific checks. Also removed related comments and TODOs regarding generic services and CQRS.
2026-01-19 17:05:36 +01:00
OlgunR
17fdb6ed51 Move repository interfaces to Application layer
Refactored IRepository<T> and ICatalogRepository to reside in the DbFirst.Application layer instead of Domain. Updated namespaces, using statements, and all references in services and handlers. Adjusted csproj dependencies to reflect the new structure. Updated comments to clarify Clean Architecture rationale and improved separation of concerns.
2026-01-19 16:42:48 +01:00
OlgunR
166acea8b1 Introduce generic IRepository<T> and refactor repositories
Added a generic IRepository<T> interface for common CRUD operations and updated ICatalogRepository to inherit from it, removing redundant methods. Updated CatalogRepository to implement the new interface. Cleaned up DbFirst.Domain.csproj by removing an unused folder reference. These changes improve code reuse and align with clean architecture practices.
2026-01-19 16:36:08 +01:00
OlgunR
6c2b1884d2 Configurable EF view/column mapping via appsettings
Refactor ApplicationDbContext to use a configuration-driven approach for mapping view and column names, enabling dynamic mapping through appsettings.json. Add TableConfigurations classes, update DI registration, and include the necessary options package for configuration binding. This improves maintainability and flexibility for schema changes.
2026-01-19 16:25:08 +01:00
OlgunR
3653def773 Clean up and organize using statements across files
Removed unused and redundant using/import statements from multiple files, including command, repository, and Program.cs. No functional changes; this commit improves code clarity and organization.
2026-01-19 14:56:55 +01:00
OlgunR
8d3783cfec Update CORS config; add architecture discussion comments
- Make CORS policy environment-aware: allow any origin in development, restrict to configured origins in production.
- Add detailed comments in CatalogService.cs and ICatalogRepository.cs discussing generic CRUD services, CQRS with MediatR, and repository interface placement, including both Copilot's and Hakan's perspectives.
- No functional changes to service or repository logic.
2026-01-19 14:48:55 +01:00
OlgunR
0af0c4589d Restrict CatTitle editing based on UpdateProcedure
Enforce business rules for catalog title changes: only allow CatTitle to be edited when UpdateProcedure permits, with checks in the API, service, handler, and UI. This ensures consistent validation and user experience across backend and frontend.
2026-01-19 14:44:55 +01:00
OlgunR
26f783e835 Prevent catalog title changes during edit
Enforce immutability of CatTitle on updates: backend now rejects title changes with a BadRequest, and frontend disables the title input field when editing.
2026-01-19 11:21:33 +01:00
d608ab1a6d Refactor CORS config; add architectural commentary
Refactored CORS setup to be environment-aware, restricting origins in production and relaxing in development. Added extensive comments and discussion on service and repository layer design, including clean architecture best practices and CQRS/MediatR considerations. No changes to business logic; documentation and intent clarified for maintainers.
2026-01-19 11:17:36 +01:00
OlgunR
4fbcd0dc11 Support selecting update procedure for catalog updates
Added CatalogUpdateProcedure enum to domain. CatalogWriteDto now includes UpdateProcedure property in both application and BlazorWasm layers. Catalogs.razor form allows users to choose between PRTBMY_CATALOG_UPDATE and PRTBMY_CATALOG_SAVE when editing. Repository, service, and handler layers updated to pass and use the selected procedure. Default remains Update. Updated comments and TODOs for clarity and future refactoring.
2026-01-19 11:10:19 +01:00
OlgunR
45e5327148 Add ICatalogRepository interface and design comments
Added ICatalogRepository with async catalog retrieval methods. Included detailed comments on repository design patterns and clean architecture layer placement, recommending interface stays in Domain. Fixed file encoding (added BOM).
2026-01-19 09:12:16 +01:00
OlgunR
9387db9824 Add comments on generic repo pattern limitations
Added Copilot comments explaining why a generic repository is unsuitable due to stored procedure complexities and asymmetric CRUD operations. Suggested keeping specialized repositories and extracting helpers for reuse. Also added a TODO to move the interface to the application layer for clean architecture.
2026-01-19 09:07:41 +01:00
OlgunR
ef76599bce Document rationale against generic CRUD/service pattern
Added detailed comments in CatalogService and ICatalogService explaining why a generic CRUD base service or repository is not suitable for this solution, due to entity-specific domain logic and stored procedure usage. Removed the previous Copilot comment from CatalogRepository. No functional changes; updates are for architectural clarity.
2026-01-19 09:02:29 +01:00
OlgunR
870b10779e Refactor Catalogs to use MediatR and CQRS pattern
Replaced direct service usage in CatalogsController with MediatR-based commands and queries for all CRUD operations. Added command/query and handler classes for Catalog operations. Updated dependency injection to register MediatR and removed ICatalogService. Improved code maintainability and testability by adopting CQRS architecture.
2026-01-19 09:00:06 +01:00
OlgunR
c8c75b1dc5 Expand usings; add note on generic vs per-entity repos
Expanded using directives to support additional dependencies in CatalogRepository.cs. Added a detailed comment explaining why per-entity repository implementations are preferred over a generic CRUD base service in this context, due to unique domain logic and stored procedure requirements. No functional code changes were made.
2026-01-19 08:53:25 +01:00
OlgunR
8c31784a5a Refactor DI setup with extension methods for modularity
Refactored dependency injection by introducing AddApplication and AddInfrastructure extension methods for service registration. Moved DbContext and AutoMapper setup out of Program.cs to improve modularity and reusability. Added required NuGet packages to .csproj files.
2026-01-19 08:46:52 +01:00
OlgunR
28bab05980 Add configurable CORS support via appsettings.json
Introduce CORS configuration using allowed origins from appsettings.json. Updated Program.cs to read allowed origins from configuration and apply them to the CORS policy, defaulting to AllowAnyOrigin if none are specified. Also made minor formatting and comment improvements.
2026-01-19 08:34:40 +01:00
OlgunR
289dba9b16 Add global exception handling middleware to API
Introduced ExceptionHandlingMiddleware to catch and log unhandled exceptions, returning standardized JSON error responses. Registered the middleware in the request pipeline. Also made minor formatting and comment improvements in Program.cs and ICatalogRepository.cs.
2026-01-19 08:31:10 +01:00
OlgunR
353611d400 Merge branch 'main' of http://git.dd:3000/AppStd/DbFirst 2026-01-16 14:10:59 +01:00
OlgunR
8c175de953 Refactor API client for richer error handling
Refactored CatalogApiClient methods to return ApiResult<T> for create, update, and delete operations, enabling more detailed error reporting. Introduced ApiResult<T> and ProblemDetailsDto types, and added logic to parse and display informative error messages. Updated Catalogs.razor to use the new pattern and show user-friendly error feedback. Added necessary using directives.
2026-01-16 14:10:56 +01:00
OlgunR
1fd776bc29 Prevent CatTitle changes in catalog update endpoint
The Update method now checks if CatTitle is being changed and returns a 400 Bad Request if so. It also returns 404 Not Found if the catalog does not exist before attempting an update. This ensures CatTitle remains immutable during updates.
2026-01-16 13:55:43 +01:00
910b0e4aaa Add default CORS policy allowing any origin
Configured CORS support with a default policy that allows requests from any origin. Added a TODO to restrict allowed origins using values from appsettings.json in the future.
2026-01-16 13:46:51 +01:00
ca563f1d0c Register DbContext and AutoMapper with DI, add TODOs
Added ApplicationDbContext and AutoMapper registrations to the DI container in Program.cs. Included TODO comments to extract these registrations into extension methods for better reuse across projects.
2026-01-16 13:45:15 +01:00
OlgunR
904e6e20f0 Enforce unique catalog titles on creation
Added a uniqueness check for catalog titles in the creation flow. The service now prevents creating catalogs with duplicate titles by checking for existing entries before insertion. If a duplicate is detected, the API returns a 409 Conflict response. Updated interfaces and repository to support title-based lookups.
2026-01-16 13:42:46 +01:00
87031d2a0a Add TODOs for middleware, generic service, and CQRS
Added TODO comments in Program.cs for exception handling middleware, and in CatalogService.cs and ICatalogService.cs for creating a generic service and implementing CQRS with MediatR. No functional changes made.
2026-01-16 13:34:23 +01:00
15680746b0 Refactor: add TODOs for generic repository pattern
Added TODO comments in ICatalogRepository and CatalogRepository to suggest adopting a generic repository pattern to reduce code duplication. Also noted the potential move of the interface to the application layer for better adherence to clean architecture principles.
2026-01-16 13:30:30 +01:00
cca6af814e Add TODO for configuring column names via appsettings
Added a TODO comment in ApplicationDbContext to suggest configuring column names using IConfiguration and appsettings. No functional changes were made.
2026-01-16 13:29:04 +01:00
fe9b211f59 Add SqlClient using and TODO for generic repository
Added Microsoft.Data.SqlClient using directive to CatalogRepository.cs. Also added a TODO comment suggesting the use of a generic repository pattern to minimize code duplication.
2026-01-16 13:28:11 +01:00
OlgunR
215e526230 Update catalog update to use OUTPUT GUID from stored proc
Refactored CatalogRepository to set @GUID as an OUTPUT parameter when calling PRTBMY_CATALOG_UPDATE. Now, after execution, the code checks the returned GUID value and uses it to fetch the updated catalog entry, handling cases where the GUID is null or zero. This ensures the repository returns the correct catalog record as modified by the stored procedure.
2026-01-16 13:18:56 +01:00
OlgunR
ab1f73f987 Implement InsertAsync with stored procedure in CatalogRepository
Replaced the InsertAsync placeholder with a full implementation that inserts a new VwmyCatalog using the dbo.PRTBMY_CATALOG_INSERT stored procedure. The method sets up SQL parameters, handles the output GUID, and retrieves the inserted catalog from the view. Exceptions are thrown if the insert fails or the catalog cannot be loaded.
2026-01-16 11:42:38 +01:00
OlgunR
f1cecf117a Refactor catalog mapping and update logic
Removed ReverseMap from CatalogProfile for one-way mapping. Refactored UpdateAsync in CatalogRepository: eliminated existence check, set @GUID as input only, removed output handling, and simplified return logic.
2026-01-16 09:40:25 +01:00
OlgunR
facc376f74 Remove Upsert functionality from Catalog API
Removed Upsert endpoint and related service/repository methods. Deleted ExecuteUpsertAsync helper. Insert now throws NotImplementedException as a placeholder. Refactored Delete method in repository; logic unchanged.
2026-01-15 16:57:33 +01:00
OlgunR
a849a88fa3 Refactor Catalog update/upsert endpoints and service logic
- Update endpoint now returns CatalogReadDto or NotFound
- Replace UpdateWithStoredProcedure with Upsert endpoint (PUT /upsert)
- Rename AddAsync to InsertAsync; UpdateAsync returns DTO or null
- Introduce UpsertAsync for combined insert/update logic
- Remove stored procedure-specific update/delete methods
- Use DTOs consistently in controller/service responses
- Repository methods now return entities instead of booleans
2026-01-14 15:29:09 +01:00
OlgunR
6caf3a4c07 Refactor to use VwmyCatalog as primary catalog entity
Replaced all usage of the Catalog entity with VwmyCatalog across application, domain, and infrastructure layers. Updated AutoMapper profiles, repository interfaces, and service logic to use VwmyCatalog. Removed the obsolete Catalog entity and related mapping profiles. Moved VwmyCatalog to the Domain.Entities namespace and cleaned up project structure. This change simplifies the domain model and eliminates redundant entity definitions.
2026-01-14 15:01:13 +01:00
OlgunR
ccd97fe9d6 Refactor catalog CRUD to use stored procedures only
Removed direct usage of TbmyCatalog entity and DbSet. All create, update, and delete operations now use stored procedures. Entity lookups and mappings are performed via the VwmyCatalog view. Updated AutoMapper profile and DbContext configuration accordingly. Catalog creation now sets ChangedWho/ChangedWhen to "system" and current UTC time.
2026-01-14 12:50:58 +01:00
OlgunR
6f3c0e33fa Remove unused namespace imports from Program.cs
Cleaned up Program.cs by removing unnecessary using directives
for AutoMapper, DbFirst, and EntityFrameworkCore namespaces.
This reduces clutter and improves code maintainability.
2026-01-14 09:06:04 +01:00
OlgunR
14e1cbc3b6 Refactor DTOs, add Blazor WASM frontend, enable CORS
- Split `CatalogDto` into `CatalogReadDto` and `CatalogWriteDto` for clear separation of read/write operations in both backend and frontend.
- Updated API controllers, services, and AutoMapper profiles to use new DTOs; ensured audit fields are set in service layer.
- Enabled CORS in the API project to support Blazor WASM frontend.
- Added new Blazor WebAssembly project (`DbFirst.BlazorWasm`) with catalog management UI, API client, Bootstrap v5.1.0 styling, and configuration-driven API base URL.
- Included `bootstrap.min.css` and its source map for frontend styling and easier debugging.
- Updated solution file to include new project and support multiple build configurations.
- Result: improved API design, clean DTO separation, and a modern interactive frontend for catalog management.
2026-01-13 10:15:01 +01:00
OlgunR
ce40abe20f Add VwmyCatalog view entity and update repository usage
Introduce VwmyCatalog as a keyless entity mapped to the VWMY_CATALOG database view. Update ApplicationDbContext to include the new DbSet and configure its mapping. Modify CatalogRepository to query the view instead of the table for GetAllAsync and GetByIdAsync. Add AutoMapper configuration for VwmyCatalog to Catalog. Add the VwmyCatalog entity class.
2026-01-12 17:00:37 +01:00
OlgunR
97eea94090 Update SP-based catalog update to use id route param
Refactor UpdateWithStoredProcedure to accept id from the route and set dto.Guid accordingly. In the repository, use Guid for existence checks instead of CAT_TITLE, and ensure CatTitle is not changed via the SP. Improve error handling to return NotFound when appropriate.
2026-01-12 16:39:21 +01:00