refactor+feat(backend): ChargeableCharConfig por ProductType + Reactivate + Delete endpoints (PRC-001)

Part A — MedioId → ProductTypeId rename across all C# layers:
  Domain, Application, Infrastructure, API, all test projects.
  Solution was non-compilable after BD refactor (5c1675e); now compiles clean (0 errors).

Part B — PATCH /api/v1/admin/chargeable-chars/{id}/reactivate:
  ReactivateChargeableCharConfigCommand/Handler, SP guard maps 50410/50411/50412
  → ChargeableCharConfigReactivationNotAllowedException(Reason) → HTTP 409.

Part C — DELETE /api/v1/admin/chargeable-chars/{id}:
  DeleteChargeableCharConfigCommand/Handler, physical DELETE on SYSTEM_VERSIONED table.
  KeyNotFoundException → 404 via ExceptionFilter.

Tests: +30 unit tests (TDD RED→GREEN). All 1266 unit tests pass.
This commit is contained in:
2026-04-21 10:54:47 -03:00
parent 5c1675e59a
commit f7fb76219a
35 changed files with 1273 additions and 273 deletions

View File

@@ -43,7 +43,7 @@ public class ListChargeableCharConfigHandlerTests
_repo.CountAsync(null, true, Arg.Any<CancellationToken>())
.Returns(2);
var query = new ListChargeableCharConfigQuery(MedioId: null, ActiveOnly: true, Page: 1, PageSize: 20);
var query = new ListChargeableCharConfigQuery(ProductTypeId: null, ActiveOnly: true, Page: 1, PageSize: 20);
var result = await _handler.Handle(query);
result.Items.Should().HaveCount(2);
@@ -104,7 +104,7 @@ public class ListChargeableCharConfigHandlerTests
}
[Fact]
public async Task Handle_FiltersByMedioId_WhenProvided()
public async Task Handle_FiltersByProductTypeId_WhenProvided()
{
_repo.ListAsync(7L, true, 0, 20, Arg.Any<CancellationToken>())
.Returns(new List<ChargeableCharConfig>());