dmolinari c95bc7fe01 fix(tests): extend Respawn + collection config for UDT-010 temporal tables
Follow-up of B1 (V010 migration). Issues found when running the full suite
cross-assembly:

1. Respawn 'Cannot delete rows from a temporal history table' error:
   4 per-class Respawner configs in SIGCM2.Application.Tests did not
   include the newly-created *_History tables introduced by V010
   (Usuario_History / Rol_History / Permiso_History / RolPermiso_History).
   The engine rejects direct DELETE on system-versioned history tables.
   Extended TablesToIgnore in all 4 configs.

2. FK_RefreshToken_Usuario violation in RolRepositoryTests.InitializeAsync:
   Manual 'DELETE FROM Usuario' failed when residual RefreshTokens from
   prior suites existed. Added 'DELETE FROM RefreshToken' before the
   Usuario cleanup to respect FK order. Latent bug surfaced by a new
   test-run ordering — not UDT-010 specific, but fixed in scope.

3. UQ_Usuario_Username duplicate admin race:
   TransactionScopeSpikeTests (B0) and V010MigrationTests (B1) were
   missing [Collection("ApiIntegration")], causing them to run in
   parallel with the rest of SIGCM2.Api.Tests and race on SeedAdmin.
   Serialized by adding the Collection attribute.

Suite now passes cross-assembly: 130/130 Api.Tests + 336/336 Application.Tests.

Refs: sdd/udt-010-auditoria-trazabilidad/apply-progress (B1 follow-up)
2026-04-16 13:22:56 -03:00
2026-04-15 17:36:36 +00:00

SIG-CM 2.0

Sistema de gestión comercial — migración del sistema legacy (VB6) a una plataforma web moderna.

Stack

  • Backend: .NET 10 · C# 13 · ASP.NET Core · Clean Architecture · Dapper 2.x · SQL Server 2022 · JWT RS256 · Serilog · FluentValidation · xUnit + NSubstitute
  • Frontend: React 19 · TypeScript 5 strict · Vite 6 · Tailwind 4 · Zustand · React Router 7 · TanStack Query · Axios · Vitest + RTL
  • Infra: Docker · Gitea Actions · Obsidian (documentación interna) · SQL Server

Estructura

src/api/             # Backend .NET (Clean Architecture)
  SIGCM2.Api/          controllers, filters, Program.cs
  SIGCM2.Application/  commands, handlers, validators, abstractions
  SIGCM2.Domain/       entities, exceptions, domain security
  SIGCM2.Infrastructure/ persistence (Dapper), security, DI

src/web/             # Frontend React 19 (Vite + TS strict)
  src/features/        feature modules (auth, users, …)
  src/components/      shared UI + layout
  src/tests/           Vitest suites

database/
  migrations/          .sql con orden Vxxx
  seeds/               datos iniciales
  schemas/             definiciones auxiliares

tests/
  SIGCM2.Api.Tests/            integration (TestWebAppFactory + SQL Server)
  SIGCM2.Application.Tests/    unit (handlers, validators)
  SIGCM2.TestSupport/          fixtures compartidas

Obsidian/            # Source of truth funcional (IGNORADO por git)
  STATUS.md            roadmap y estado de UDTs
  INSTRUCCIONES_IA.md  SOP del agente de IA
  02-ARQUITECTURA.../  specs por módulo

Cómo correr

Requisitos

  • .NET 10 SDK
  • Node 20+
  • SQL Server 2019+ (local o remoto)

Backend

cd src/api/SIGCM2.Api
dotnet run

Config en appsettings.json (DB: SIGCM2, usuario desarrollo, server TECNICA3). Para tests de integración se usa SIGCM2_Test.

Frontend

cd src/web
npm install
npm run dev

Tests

# Backend
dotnet test tests/SIGCM2.Application.Tests       # unit
dotnet test tests/SIGCM2.Api.Tests               # integration (requiere SIGCM2_Test)

# Frontend
cd src/web && npx vitest run

Convenciones

  • Ramas: feature/UDT-XXX desde main.
  • Commits: tipo(módulo): descripciónfeat, fix, docs, refactor, test, chore, security.
  • Orden de trabajo por UDT: BD → Backend → Frontend.
  • Desarrollo guiado por Spec-Driven Development (SDD) + Strict TDD.
  • Follow-ups / deuda técnica se registran como issues de Gitea con label followup.
Description
SIG-CM 2.0 - Sistema de gestión comercial - El Día.
Readme 3.4 MiB
Languages
C# 63.9%
TypeScript 29.4%
TSQL 6.1%
CSS 0.5%