Commit Graph

322 Commits

Author SHA1 Message Date
c5a8cd9edd Merge pull request 'fix: openEdit fetch ProductTypeDetail antes de abrir dialog (closes #37)' (#42) from fix/issue-37-openedit-fetch-detail into main 2026-04-19 19:53:47 +00:00
616f6432d1 fix(frontend): openEdit fetch ProductTypeDetail antes de abrir dialog (closes #37)
Reemplaza el stub con nulls por queryClient.fetchQuery con getProductTypeById,
deshabilitando el botón durante la carga y mostrando toast.error si falla.
2026-04-19 16:53:00 -03:00
1730b0623e Merge pull request 'feat: PRD-002 Product CRUD' (#40) from feature/PRD-002 into main 2026-04-19 16:49:58 +00:00
d7fb3105fa feat(bd): V018 crea dbo.Product + SqlTestFixture consolida V018 + permisos catalogo (PRD-002 W6) 2026-04-19 13:46:11 -03:00
b4f17d6961 refactor: eliminar NullProductQueryRepository dead code + EXISTS en ProductQueryRepository (PRD-002 S1 S2) 2026-04-19 13:37:10 -03:00
a7cfcdb683 test(frontend): ProductsPage pagination + filter tests (PRD-002 W5) 2026-04-19 13:36:48 -03:00
0f5455aba6 test(frontend): ProductFormDialog + DeactivateProductDialog tests (PRD-002 W3 W4) 2026-04-19 13:35:23 -03:00
2b79b6f769 feat(frontend): ProductForm reactivo a flags ProductType (PRD-002 W2) 2026-04-19 13:33:53 -03:00
d262454b28 fix(api): ExceptionFilter 409 para ProductTypeInactivo y RubroInactivo (PRD-002 W1) 2026-04-19 13:31:38 -03:00
08a4738daf feat(frontend): Products feature — CRUD page, form, dialogs, hooks (PRD-002)
Implements full frontend for PRD-002: 5 API fns, 5 hooks (useProducts,
useCreateProduct, useUpdateProduct, useDeactivateProduct), ProductForm,
ProductFormDialog, DeactivateProductDialog, ProductsPage with CanPerform
gating. Router entry at /admin/products and sidebar link added. 19 Vitest
tests GREEN (api, hooks, page).
2026-04-19 13:24:42 -03:00
a41a4ea341 test(api): guard proof — ProductType deactivation returns 409 when active Products exist (PRD-002) 2026-04-19 13:18:21 -03:00
165abc8245 feat(api): ProductsController + ExceptionFilter Product cases, fix permiso count to 27 (PRD-002) 2026-04-19 13:17:31 -03:00
733ca0e2e2 test(infrastructure): ProductRepository integration tests — roundtrip, update, deactivate history, UQ (PRD-002) 2026-04-19 13:11:21 -03:00
8c9a50504d feat(infrastructure): ProductRepository + ProductQueryRepository, DI swap activates guard (PRD-002) 2026-04-19 13:10:21 -03:00
bb455be745 feat(application): Product handlers + DI registration, fix permiso count to 27 (PRD-002) 2026-04-19 13:07:59 -03:00
8b555e1f8b feat(application): Product commands, DTOs, IProductRepository, validators (PRD-002) 2026-04-19 13:02:42 -03:00
16197cf242 feat(domain): Product entity + 5 domain exceptions (PRD-002) 2026-04-19 12:59:58 -03:00
0462970ea1 Merge pull request 'feat: PRD-001 ProductType (flags + multimedia)' (#38) from feature/PRD-001 into main 2026-04-19 15:18:53 +00:00
d6ec618ff2 docs(tests): TODO W1 PRD-002 en ProductTypesControllerTests + audit doc ya completo (PRD-001)
Agrega comentario TODO antes del bloque DELETE explicando el gap e2e
para 409 IsInUse (bloqueado por RSA singleton, issue #36, PRD-002).
Auditoría.md ya tenía las entradas producto_tipo.* desde apply anterior.
2026-04-19 12:10:35 -03:00
230405e056 feat(frontend): wire dialogs en ProductTypesPage (PRD-001 W3)
Conecta ProductTypeFormDialog (create/edit) y DeactivateProductTypeDialog
en ProductTypesPage: botón "Nuevo Tipo", acción Editar por fila, acción
Desactivar por fila, empty state CTA "Crear primer tipo".

9 tests nuevos de page integration. Total: 390.
2026-04-19 12:10:09 -03:00
9cb1e84ec0 feat(frontend): ProductTypeForm + Dialog + DeactivateDialog con TDD (PRD-001 W3)
Implementa los 3 componentes de UI faltantes con enfoque Red→Green:
- ProductTypeForm: zod schema con transforms para multimedia numérica,
  lógica condicional (multimedia deshabilitada cuando allowImages=false),
  normalización en submit.
- ProductTypeFormDialog: mode create/edit, inline error 409, aria-describedby (NFR8).
- DeactivateProductTypeDialog: AlertDialog confirmar soft-delete, inline error 409 EnUso.

18 tests nuevos (8 form + 6 dialog + 4 deactivate). Total: 381.
2026-04-19 12:08:36 -03:00
3db4dedb91 feat(frontend): feature product-types completa (PRD-001)
types, api, hooks, ProductTypesPage, router /admin/product-types,
sidebar Tipos de Producto; 11 vitest tests nuevos — suite total 363 GREEN.
2026-04-19 10:01:12 -03:00
170789886b feat(api): ProductTypesController + ExceptionFilter 4 casos PRD-001
CRUD endpoints con validación FluentValidation inline; 4 nuevas excepciones mapeadas
en ExceptionFilter; conteos de permisos 25→26 actualizados; 12 e2e tests nuevos.
2026-04-19 09:57:11 -03:00
936d1dc353 feat(infrastructure): ProductTypeRepository Dapper + DI wiring (PRD-001)
CRUD + paginado con filtros sobre dbo.ProductType; history temporal verificada en tests.
11 integration tests nuevos, suite total 935 GREEN.
2026-04-19 09:49:08 -03:00
5c8f19bf39 feat(application): CRUD handlers + validators + DI de ProductType (PRD-001)
Create/Update/Deactivate handlers con TransactionScope + audit; validators FluentValidation;
DI wiring NullProductQueryRepository + 5 handlers; SqlTestFixture V017 + permiso count 25→26.
2026-04-19 09:46:31 -03:00
3c9e852379 feat(application): IProductTypeRepository + IProductQueryRepository stub + queries (PRD-001) 2026-04-19 09:38:51 -03:00
132d17c99f feat(domain): ProductType entity + domain exceptions (PRD-001) 2026-04-19 09:36:29 -03:00
de70152d3e feat(bd): V017 crea dbo.ProductType con SYSTEM_VERSIONING + permiso catalogo:tipos:gestionar (PRD-001) 2026-04-19 09:34:23 -03:00
d8d1da8ea4 Merge pull request 'feat: CAT-002 Regla de Oro Rama vs Hoja + validaciones' (#35) from feature/CAT-002 into main 2026-04-19 11:56:32 +00:00
a0a1874ac2 test(frontend): apretar match exacto del title en CategoryTree (CAT-002 W2) 2026-04-19 08:52:34 -03:00
4f25233bab feat(frontend): tieneAvisos en RubroTreeNode + disable btn subrubro (CAT-002) 2026-04-19 08:35:42 -03:00
bb5dde6e24 feat(api): ExceptionFilter 409 para regla de oro + DTO delta (CAT-002) 2026-04-19 08:31:39 -03:00
f861dfa826 feat(application): RubroTreeBuilder + GetRubroTree con tieneAvisos (CAT-002) 2026-04-19 08:25:13 -03:00
c03aad8c5a feat(application): guard avisos en MoveRubroCommandHandler (CAT-002) 2026-04-19 08:24:07 -03:00
216983623a feat(application): guard avisos en CreateRubroCommandHandler (CAT-002) 2026-04-19 08:22:55 -03:00
9e50a929ae feat(application): RubroTreeBuilder + GetRubroTree con tieneAvisos (CAT-002) 2026-04-19 08:20:36 -03:00
673194e249 feat(application): IAvisoQueryRepository + NullAvisoQueryRepository (CAT-002) 2026-04-19 08:18:56 -03:00
ddd28ea4d5 feat(domain): excepciones regla de oro rama/hoja (CAT-002) 2026-04-19 08:17:45 -03:00
205f9c76ad Merge pull request 'feat: CAT-001 Árbol N-ario de Rubros' (#30) from feature/CAT-001 into main 2026-04-19 10:49:37 +00:00
389dda6e5e fix(tests): consolidar V016 en SqlTestFixture post issue #29
Rebase de CAT-001 sobre main (post #29) requiere:
- EnsureV016SchemaAsync en SqlTestFixture
- Rubro_History en TablesToIgnore central (el commit original b1be4a5 se skipeo por ser obsoleto post consolidacion)
- catalogo:rubros:gestionar en seed canonical de Permiso + RolPermiso admin
- RubroRepositoryTests refactorizado al patron [Collection] + SqlTestFixture
- RubrosControllerTests apunta a TestConnectionStrings.ApiTestDb
- Counts de permisos admin actualizados 24 -> 25 en 5 tests

Verify: App 819/819 + Api 251/251 + vitest 349/349 verde post-rebase.
2026-04-19 07:49:18 -03:00
bd2febf411 fix(frontend): MoveRubroDialog type cast para zodResolver output (CAT-001) 2026-04-19 07:42:56 -03:00
46ef3878de feat(frontend): MoveRubroDialog + wire en RubrosPage + aria-describedby (CAT-001)
Implementa MoveRubroDialog con flattenExcludingSubtree para prevenir ciclos en UI,
lo conecta en RubrosPage y agrega DialogDescription en RubroFormDialog.
2026-04-19 07:42:55 -03:00
022a36a90c test(application): GetRubroByIdQueryHandlerTests dedicado (CAT-001) 2026-04-19 07:42:55 -03:00
f07802f769 fix(frontend): corregir tipos zodResolver en RubroFormDialog (CAT-001)
- Reemplaza z.union([z.coerce.number(), z.literal('')]) por z.string().transform+pipe para evitar inferencia unknown en zodResolver
- Simplifica RubroFormValues a {nombre: string, tarifarioBaseId?: number | null}
- Actualiza RubrosPage: tarifarioId ya llega como number|null del schema transform
2026-04-19 07:42:55 -03:00
b22e9fe59a feat(frontend): rubros feature + CategoryTree + CRUD dialogs (CAT-001)
Co-Authored-By: none
2026-04-19 07:42:54 -03:00
5e2323e0bc feat(api): RubrosController + integration tests e2e + audit verification (CAT-001) 2026-04-19 07:42:54 -03:00
f8e9d18379 feat(infrastructure): RubroRepository Dapper + DI + integration tests (CAT-001) 2026-04-19 07:42:53 -03:00
d9fc9a2867 feat(application): Rubros commands/queries + RubroTreeBuilder + audit (CAT-001) 2026-04-19 07:42:26 -03:00
dcb2e5ada6 feat(domain): Rubro entity + domain exceptions (CAT-001) 2026-04-19 07:42:26 -03:00
9f78425a93 fix(bd): V016 COLLATE order — SQL Server requiere COLLATE antes de NOT NULL (CAT-001) 2026-04-19 07:42:25 -03:00