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)
21 lines
696 B
C#
21 lines
696 B
C#
namespace CMSMicroservice.Application.ConfigurationCQ.Queries.GetConfigurationHistory;
|
|
|
|
public class GetConfigurationHistoryResponseDto
|
|
{
|
|
public MetaData MetaData { get; set; }
|
|
public List<GetConfigurationHistoryResponseModel> Models { get; set; }
|
|
}
|
|
|
|
public class GetConfigurationHistoryResponseModel
|
|
{
|
|
public long Id { get; set; }
|
|
public long ConfigurationId { get; set; }
|
|
public ConfigurationScope Scope { get; set; }
|
|
public string Key { get; set; }
|
|
public string? OldValue { get; set; }
|
|
public string NewValue { get; set; }
|
|
public string ChangeReason { get; set; }
|
|
public string ChangedBy { get; set; }
|
|
public DateTimeOffset Created { get; set; }
|
|
}
|