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

@@ -37,7 +37,7 @@ public class CreateChargeableCharConfigHandlerTests
}
private static CreateChargeableCharConfigCommand ValidCmd(DateOnly? validFrom = null) => new(
MedioId: null,
ProductTypeId: null,
Symbol: "$",
Category: ChargeableCharCategories.Currency,
PricePerUnit: 1.5m,
@@ -80,9 +80,9 @@ public class CreateChargeableCharConfigHandlerTests
}
[Fact]
public async Task Handle_WithMedioId_PassesMedioIdToRepo()
public async Task Handle_WithProductTypeId_PassesProductTypeIdToRepo()
{
var cmd = ValidCmd() with { MedioId = 7 };
var cmd = ValidCmd() with { ProductTypeId = 7 };
await _handler.Handle(cmd);