Implemented complete CQRS pattern for System Configuration management:
Commands:
- SetConfigurationValueCommand: Create or update configurations with history tracking
- DeactivateConfigurationCommand: Deactivate configurations with audit trail
Queries:
- GetConfigurationByKeyQuery: Retrieve configuration by Scope and Key
- GetAllConfigurationsQuery: List all configurations with filters and pagination
- GetConfigurationHistoryQuery: View complete audit history for any configuration
Features:
- All commands include FluentValidation validators
- History recording to SystemConfigurationHistory table
- Pagination support for list queries
- DTOs for clean data transfer
- Null-safe implementations
Updated:
- IApplicationDbContext: Added 11 new DbSets for network-club entities
- GlobalUsings: Added new entity namespaces
Build Status: ✅ Success (0 errors, 184 warnings in legacy code)
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
namespace CMSMicroservice.Application.ConfigurationCQ.Queries.GetAllConfigurations;
|
||
|
||
/// <summary>
|
||
/// Query برای دریافت لیست تمام Configuration ها با فیلتر
|
||
/// </summary>
|
||
public record GetAllConfigurationsQuery : IRequest<GetAllConfigurationsResponseDto>
|
||
{
|
||
/// <summary>
|
||
/// موقعیت صفحهبندی
|
||
/// </summary>
|
||
public PaginationState? PaginationState { get; init; }
|
||
|
||
/// <summary>
|
||
/// مرتبسازی بر اساس
|
||
/// </summary>
|
||
public string? SortBy { get; init; }
|
||
|
||
/// <summary>
|
||
/// فیلتر
|
||
/// </summary>
|
||
public GetAllConfigurationsFilter? Filter { get; init; }
|
||
}
|
||
|
||
public class GetAllConfigurationsFilter
|
||
{
|
||
/// <summary>
|
||
/// فیلتر بر اساس محدوده
|
||
/// </summary>
|
||
public ConfigurationScope? Scope { get; set; }
|
||
|
||
/// <summary>
|
||
/// جستجو در کلید
|
||
/// </summary>
|
||
public string? KeyContains { get; set; }
|
||
|
||
/// <summary>
|
||
/// فقط Configuration های فعال
|
||
/// </summary>
|
||
public bool? IsActive { get; set; }
|
||
}
|