# Indice de Especificaciones Tecnicas - MGN-005 Catalogs

## Identificacion

| Campo | Valor |
|-------|-------|
| **Modulo** | MGN-005 |
| **Epic** | Catalogs |
| **Total ET** | 3 |
| **Story Points** | 30 |
| **Fecha** | 2025-12-05 |

---

## Especificaciones Tecnicas

| ID | Titulo | RF Cubiertos | Estado |
|----|--------|--------------|--------|
| [ET-CATALOG-database](./ET-CATALOG-database.md) | Schema core_catalogs | RF-001 a RF-005 | Documentado |
| [ET-CATALOG-backend](./ET-CATALOG-backend.md) | Servicios y API REST | RF-001 a RF-005 | Documentado |
| [ET-CATALOG-frontend](./ET-CATALOG-frontend.md) | Componentes React | RF-001 a RF-005 | Documentado |

---

## Resumen de Componentes

### Database (ET-CATALOG-database)

| Tabla | RF | Descripcion |
|-------|-----|-------------|
| countries | RF-002 | Catalogo global de paises ISO 3166-1 |
| states | RF-002 | Estados/provincias por pais |
| country_groups | RF-002 | Agrupaciones regionales |
| currencies | RF-003 | Catalogo global de monedas ISO 4217 |
| currency_rates | RF-003 | Tasas de cambio por tenant |
| contacts | RF-001 | Clientes, proveedores, empleados |
| contact_tags | RF-001, RF-005 | Tags para clasificar contactos |
| contact_tag_rel | RF-001, RF-005 | Relacion M:N contactos-tags |
| uom_categories | RF-004 | Categorias de unidades de medida |
| uom | RF-004 | Unidades de medida |
| categories | RF-005 | Categorias genericas jerarquicas |

**Total:** 11 tablas (5 globales + 6 por tenant)

### Backend (ET-CATALOG-backend)

| Servicio | Endpoints | RF |
|----------|-----------|-----|
| ContactsService | 7 | RF-001 |
| CountriesService | 4 | RF-002 |
| CurrenciesService | 2 | RF-003 |
| CurrencyRatesService | 4 | RF-003 |
| UomService | 5 | RF-004 |
| CategoriesService | 4 | RF-005 |

**Total:** 26 endpoints

### Frontend (ET-CATALOG-frontend)

| Pagina | Componentes | RF |
|--------|-------------|-----|
| ContactsPage | 6 | RF-001, RF-005 |
| CurrenciesPage | 3 | RF-003 |
| UomPage | 4 | RF-004 |
| CategoriesPage | 3 | RF-005 |

**Total:** 6 paginas, 16 componentes

---

## Matriz de Trazabilidad RF -> ET

| RF | Database | Backend | Frontend |
|----|----------|---------|----------|
| RF-CATALOG-001 | contacts, contact_tags, contact_tag_rel | ContactsService | ContactsPage, ContactForm |
| RF-CATALOG-002 | countries, states, country_groups | CountriesService | CountrySelect, StateSelect |
| RF-CATALOG-003 | currencies, currency_rates | CurrenciesService, CurrencyRatesService | CurrenciesPage, CurrencySelect |
| RF-CATALOG-004 | uom_categories, uom | UomService | UomPage, UomConverter |
| RF-CATALOG-005 | categories, contact_tags | CategoriesService | CategoriesPage, CategoryTree |

---

## Dependencias Tecnicas

### Externas
- PostgreSQL 15+ (RLS, JSONB, GIN)
- TypeORM 0.3+
- NestJS 10+
- React 18+
- Zustand 4+
- shadcn/ui

### Internas
- core_tenants.tenants (RLS)
- core_users.users (vinculacion contactos)
- MGN-001 Auth (autenticacion)
- MGN-003 RBAC (permisos)

---

## Historial

| Version | Fecha | Autor | Cambios |
|---------|-------|-------|---------|
| 1.0 | 2025-12-05 | Requirements-Analyst | Creacion inicial con 3 ET |
