## Summary - Remove FluentValidation dependency; replace with plain IModelValidator<T>/ValidationResult pattern (ported from BuyEngine's Guard/validation approach), wired via a ModelValidationActionFilter - Move FeatureUsage code into MicCheck.Api.Features.Usage namespace - Convert logic-free data classes to records per CLAUDE.md (WebhookEvent, FeatureStateResult, ProjectPermissionRequirement, AuditLog, Tag, FeatureUsageDaily) - Extract IAuditService interface, drop virtual-method mock seam on AuditService - Split Program.cs DI registrations into per-namespace DependencyRegistration classes ## Test plan - [x] dotnet build (API + tests) clean - [x] dotnet test MicCheck.Api.Tests.Unit — 646/646 passing - [x] pre-push hook (full solution build/test + admin build) passed Co-authored-by: miccheck-ci <ci@miccheck.local> Reviewed-on: #7
15 lines
483 B
C#
15 lines
483 B
C#
namespace MicCheck.Api.Common.Validation;
|
|
|
|
public record ValidationError(string PropertyName, string Message);
|
|
|
|
public class ValidationResult
|
|
{
|
|
private readonly List<ValidationError> _errors = [];
|
|
|
|
public IReadOnlyList<ValidationError> Errors => _errors;
|
|
public bool IsValid => _errors.Count == 0;
|
|
public bool IsInvalid => _errors.Count > 0;
|
|
|
|
public void AddError(string propertyName, string message) => _errors.Add(new ValidationError(propertyName, message));
|
|
}
|