feat(infrastructure): ChargeableCharConfigRepository Dapper + SP invocation (PRC-001)

- ChargeableCharConfigRepository implements IChargeableCharConfigRepository via Dapper
- InsertWithCloseAsync calls usp_ChargeableCharConfig_InsertWithClose with OUTPUT params;
  maps SqlException 50409 → ChargeableCharConfigForwardOnlyException, 50404 → ChargeableCharConfigInvalidException
- GetActiveForMedioAsync calls usp_ChargeableCharConfig_GetActiveForMedio; returns all rows
  (global + per-medio) — Application service handles priority resolution
- ListAsync / CountAsync use parameterized SQL with OFFSET/FETCH and NULL-aware MedioId filter
- GetByIdAsync / DeactivateAsync cover single-entity read and idempotent deactivation
- DateOnly mapping: DateTime → DateOnly.FromDateTime() pattern, same as ProductPriceRepository
- Registered IChargeableCharConfigRepository → ChargeableCharConfigRepository in DI
- 14 integration tests against SIGCM2_Test_App (all GREEN); 1571/1571 total tests pass
This commit is contained in:
2026-04-20 12:32:17 -03:00
parent f1b38cd9ce
commit 3b1edfd696
3 changed files with 700 additions and 0 deletions

View File

@@ -45,6 +45,8 @@ public static class DependencyInjection
services.AddScoped<IProductQueryRepository, ProductQueryRepository>();
// PRD-003: ProductPrices históricos
services.AddScoped<IProductPriceRepository, ProductPriceRepository>();
// PRC-001: ChargeableCharConfig — caracteres especiales tasables
services.AddScoped<IChargeableCharConfigRepository, ChargeableCharConfigRepository>();
// JWT Options — bound lazily via IOptions so tests can override via ConfigureWebHost
services.Configure<JwtOptions>(configuration.GetSection("Jwt"));