sigo-entities 1.2.456 → 1.2.457

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,215 +1,215 @@
1
- # Reporte — Estructura de sigo-entities
2
-
3
- **Fecha:** 2026-08-31
4
- **Autor:** Brayan Andrés Valero Pinzón — Hermes Agent (sigo-frontend-dev)
5
- **Destinatario:** Ingeniero Josue — Repositorio `sigo-entities`
6
-
7
- ---
8
-
9
- ## Resumen
10
-
11
- Se detectaron **47 carpetas con nombres incorrectos** (sin guiones), **30 archivos `shared/index.ts` con Entity + DTO + `_id` mezclados**, y **3 carpetas en configuracion que ya fueron corregidas**.
12
-
13
- ---
14
-
15
- ## ✅ CORREGIDAS (3 archivos)
16
-
17
- Las siguientes 3 Entities fueron corregidas siguiendo el patrón correcto:
18
-
19
- | Carpeta | Archivos creados | Cambios |
20
- |---|---|---|
21
- | `theme config country` | `shared/theme-config-country-entity.ts` | Eliminado `_id`, DTOs inline en entity.ts, `shared/index.ts` solo exporta entity |
22
- | `theme config user` | `shared/dto/favorito-dto.ts` + `shared/theme-config-user-entity.ts` | Eliminado `_id`, DTOs separados en carpeta `dto/`, `shared/index.ts` solo exporta entity |
23
- | `scraping credential` | `shared/scraping-credential-entity.ts` | Eliminado `_id`, `shared/index.ts` solo exporta entity |
24
-
25
- **Patrón aplicado:**
26
- ```
27
- carpeta/
28
- shared/
29
- dto/
30
- nombre-dto.ts ← DTOs aquí
31
- nombre-entity.ts ← solo la Entity aquí
32
- index.ts ← solo export * from './nombre-entity'
33
- ```
34
-
35
- ---
36
-
37
- ## ❌ CARPETA 1: Carpetas con nombres SIN guiones (47 carpetas)
38
-
39
- **Regla:** Nombres compuestos deben usar guiones (`-`) en lugar de espacios.
40
-
41
- ### Configuración (10 carpetas)
42
- | Actual | Debería ser |
43
- |---|---|
44
- | `cargo personal` | `cargo-personal` |
45
- | `contrato ot` | `contrato-ot` |
46
- | `opcion sistema` | `opcion-sistema` |
47
- | ~~`scraping credential`~~ | ~~`scraping-credential`~~ ✅ renombrada |
48
- | ~~`theme config country`~~ | ~~`theme-config-country`~~ ✅ renombrada |
49
- | ~~`theme config user`~~ | ~~`theme-config-user`~~ ✅ renombrada |
50
- | `tipo clave` | `tipo-clave` |
51
- | `tipo especialidad mo` | `tipo-especialidad-mo` |
52
- | `tipo opcion sistema` | `tipo-opcion-sistema` |
53
- | `usuarios autoinventario` | `usuarios-autoinventario` |
54
-
55
- ### Administración (8 carpetas)
56
- | Actual | Debería ser |
57
- |---|---|
58
- | `chile 9512 paquetizado mano obra` | `chile-9512-paquetizado-mano-obra` |
59
- | `chile 9512 paquetizado material` | `chile-9512-paquetizado-material` |
60
- | `key integracion` | `key-integracion` |
61
- | `mail structure` | `mail-structure` |
62
- | `precio especialidad` | `precio-especialidad` |
63
- | `precio material` | `precio-material` |
64
- | `unidad obra material` | `unidad-obra-material` |
65
- | `zona trabajo` | `zona-trabajo` |
66
-
67
- ### Logística (17 carpetas)
68
- | Actual | Debería ser |
69
- |---|---|
70
- | `almacen extra` | `almacen-extra` |
71
- | `atencion ordenes liquidadas` | `atencion-ordenes-liquidadas` |
72
- | `consumo material` | `consumo-material` |
73
- | `consumos P117` | `consumos-P117` |
74
- | `devolucion almacen` | `devolucion-almacen` |
75
- | `gran familia item` | `gran-familia-item` |
76
- | `ingreso almacen` | `ingreso-almacen` |
77
- | `movimiento almacen` | `movimiento-almacen` |
78
- | `salida almacen` | `salida-almacen` |
79
- | `stock almacen` | `stock-almacen` |
80
- | `stock almacen equipos` | `stock-almacen-equipos` |
81
- | `stock personal` | `stock-personal` |
82
- | `stock personal equipos` | `stock-personal-equipos` |
83
- | `tipo almacen` | `tipo-almacen` |
84
- | `tipo movimiento almacen` | `tipo-movimiento-almacen` |
85
- | `tipo stock` | `tipo-stock` |
86
- | `transaccion folios` | `transaccion-folios` |
87
- | `unidad medida` | `unidad--medida` |
88
-
89
- ### Programados (10 carpetas)
90
- | Actual | Debería ser |
91
- |---|---|
92
- | `centro costos` | `centro-costos` |
93
- | `mano obra global` | `mano-obra-global` |
94
- | `rm actividad` | `rm-actividad` |
95
- | `rm comuna` | `rm-comuna` |
96
- | `rm mano obra` | `rm-mano-obra` |
97
- | `rm paquetizado` | `rm-paquetizado` |
98
- | `tipo actividad mo` | `tipo-actividad-mo` |
99
- | `tipo obra` | `tipo-obra` |
100
- | `model mo sql` | `model-mo-sql` |
101
- | `model obra sql` | `model-obra-sql` |
102
-
103
- ### Operativa (7 carpetas)
104
- | Actual | Debería ser |
105
- |---|---|
106
- | `order stock` | `order-stock` |
107
- | `order stock store` | `order-stock-store` |
108
- | `request number TTL` | `request-number-TTL` |
109
- | `Tdc order stock` | `Tdc-order-stock` |
110
- | `TOA Claro order stock` | `TOA-Claro-order-stock` |
111
- | `TOA orden liquidacion` | `TOA-orden-liquidacion` |
112
- | `TOA order stock` | `TOA-order-stock` |
113
-
114
- ---
115
-
116
- ## ❌ CARPETA 2: `shared/index.ts` con Entity + DTO + `_id` mezclados (30 carpetas)
117
-
118
- **Regla:** `shared/index.ts` debe contener SOLO la Entity. Los DTOs deben estar en `shared/dto/`.
119
-
120
- ### Configuración (3 carpetas — ya corregidas)
121
- | Carpeta | Entity | DTOs presentes | `_id` | Estado |
122
- |---|---|---|---|---|
123
- | `configuracion/ theme-config-country/shared/index.ts` | `ThemeConfigCountryENTITY` | `ImgLogoNavBarDTO`, `ThemeCountryManualDTO` | ✅ Línea 50 | ✅ CORREGIDA (carpeta renombrada, DTOs en `shared/dto/`, `_id` eliminado) |
124
- | `configuracion/ theme-config-user/shared/index.ts` | `ThemeConfigUserENTITY` | `FavoritoDTO` | ✅ Línea 33 | ✅ CORREGIDA (carpeta renombrada, DTOs en `shared/dto/`, `_id` eliminado) |
125
- | `configuracion/ scraping-credential/shared/index.ts` | `ScrapingCredentialENTITY` | `CodigoNombreDTO` | ✅ Línea 10 | ✅ CORREGIDA (carpeta renombrada, `_id` eliminado) |
126
-
127
- ### Logística (2 carpetas)
128
- | Carpeta | Entity | DTOs presentes | `_id` |
129
- |---|---|---|---|
130
- | `logistica/stock personal/shared/index.ts` | `StockPersonalENTITY` | Varios | ✅ |
131
- | `logistica/stock personal equipos/shared/index.ts` | `StockPersonalEquiposENTITY` | Varios | ✅ |
132
-
133
- ### Operativa/Procesos (25 carpetas)
134
- | Carpeta | Entity | `_id` |
135
- |---|---|---|
136
- | `operativa/procesos/altas_nvt_order/shared/index.ts` | `AltasNVTOrderENTITY` | ✅ Línea 35 |
137
- | `operativa/procesos/bantel/shared/index.ts` | `BantelENTITY` | ❌ `resource_id` (equivalente a `_id`) |
138
- | `operativa/procesos/claro_peru9112/shared/index.ts` | `Peru9112ClaroENTITY` | ✅ Línea 32 |
139
- | `operativa/procesos/cliente_waoo/shared/index.ts` | `ClienteWAOOENTITY` | ❌ `line_id` (equivalente a `_id`) |
140
- | `operativa/procesos/fibramas_order/shared/index.ts` | `Peru9112FibramasENTITY` | ❌ `resource_id` (equivalente a `_id`) |
141
- | `operativa/procesos/fibramas_order_db/shared/index.ts` | `Peru9112FibramasENTITYDB` | ❌ `resource_id` (equivalente a `_id`) |
142
- | `operativa/procesos/mifibra_db/shared/index.ts` | `MiFibraENTITYDB` | ❌ `resource_id` (equivalente a `_id`) |
143
- | `operativa/procesos/order stock/shared/index.ts` | `OrderStockENTITY` | ✅ |
144
- | `operativa/procesos/order stock store/shared/index.ts` | `OrderStockStoreENTITY` | ✅ |
145
- | `operativa/procesos/request number TTL/shared/index.ts` | `RequestNumberTTLENTITY` | ✅ Línea 14 |
146
- | `operativa/procesos/somacyl_order/shared/index.ts` | `SomacylOrderENTITY` | ✅ Línea 32 |
147
- | `operativa/procesos/stb_dth_toaperu/shared/index.ts` | `STB_DTH_ToaENTITY` | ✅ |
148
- | `operativa/procesos/Tdc order stock/shared/index.ts` | `TdcOrderStockENTITY` | ✅ |
149
- | `operativa/procesos/TOA Claro order stock/shared/index.ts` | `TOAClaroOrderStockENTITY` | ✅ |
150
- | `operativa/procesos/TOA orden liquidacion/shared/index.ts` | `TOAOrdenLiquidacionENTITY` | ✅ |
151
- | `operativa/procesos/TOA orden liquidacion_db/shared/index.ts` | `TOAOrdenLiquidacionENTITYDB` | ✅ Línea 21 |
152
- | `operativa/procesos/TOA order stock/shared/index.ts` | `TOAOrderStockENTITY` | ✅ |
153
- | `operativa/procesos/toa_claro/shared/index.ts` | `ToaClaroENTITY` | ✅ |
154
- | `operativa/procesos/toa_movistar/shared/index.ts` | `Peru9112TOAENTITY` | ✅ Línea 30 |
155
- | `operativa/procesos/toa_movistar_db/shared/index.ts` | `Peru9112TOAENTITYDB` | ✅ Línea 27 |
156
- | `operativa/procesos/tuves/shared/index.ts` | `TuvesENTITY` | ✅ Línea 30 |
157
- | `operativa/procesos/tuves_order_stock/shared/index.ts` | `TuvesOrderStockENTITY` | ✅ |
158
- | `operativa/procesos/win_order/shared/index.ts` | `Peru9112WinENTITY` | ❌ `resource_id` (equivalente a `_id`) |
159
- | `operativa/procesos/win_order_db/shared/index.ts` | `Peru9112WinENTITYDB` | ❌ `resource_id` (equivalente a `_id`) |
160
-
161
- ---
162
-
163
- ## ❌ CARPETA 3: Estructura incorrecta general
164
-
165
- **Patrón actual incorrecto (la mayoría de carpetas):**
166
- ```
167
- carpeta-con-espacios/
168
- shared/
169
- index.ts ← contiene: Entity + DTOs + _id todo mezclado
170
- ```
171
-
172
- **Patrón correcto (patrón de referencia `navisionpreorden`):**
173
- ```
174
- carpeta-con-guiones/
175
- shared/
176
- dto/
177
- nombre-dto.ts
178
- otro-dto.ts
179
- nombre-entity.ts ← solo la Entity aquí
180
- index.ts ← solo: export * from './nombre-entity'
181
- ```
182
-
183
- ---
184
-
185
- ## 📋 Resumen de problemas por prioridad
186
-
187
- | Prioridad | Problema | Cantidad | Impacto |
188
- |---|---|---|---|
189
- | **P0** | `_id` en Entities | 23 carpetas | Error de validación MongoDB: `_id must be a string` |
190
- | **P0** | Entity + DTOs mezclados en `shared/index.ts` | 30 carpetas | Confusión de imports, violación de separación de responsabilidades |
191
- | **P1** | Nombres de carpetas con espacios (sin guiones) | 47 carpetas | Inconsistencia con patrón LatasOS, problemas de import en Windows |
192
- | **P2** | `shared/index.ts` sin carpeta `dto/` separada | 30 carpetas | DTOs no reutilizables, archivo index.ts inflado |
193
-
194
- ---
195
-
196
- ## 📐 Patrón correcto de referencia
197
-
198
- Archivo: `navisionpreorden/shared/navisionpreorden-entity.ts`
199
-
200
- ```typescript
201
- // ✅ Sin _id
202
- // ✅ Solo la Entity
203
- // ✅ DTOs en carpeta shared/dto/
204
- // ✅ Nombre de carpeta con guiones
205
- // ✅ ID principal como número (ID_NavisionpreordenEntity)
206
- ```
207
-
208
- ---
209
-
210
- ## 🔧 Acciones requeridas
211
-
212
- 1. **P0 — Eliminar `_id`** de 20 carpetas restantes (incluyendo `resource_id` y `line_id` como equivalentes) — 3 ya corregidas: `theme-config-country`, `theme-config-user`, `scraping-credential`
213
- 2. **P0 — Separar DTOs de Entities** en 27 carpetas restantes — 3 ya corregidas: `theme-config-country`, `theme-config-user`, `scraping-credential`
214
- 3. **P1 — Renombrar carpetas** de 44 carpetas restantes — 3 ya corregidas: `theme-config-country`, `theme-config-user`, `scraping-credential`
215
- 4. **P2 — Actualizar `shared/index.ts`** en 27 carpetas restantes — 3 ya corregidas
1
+ # Reporte — Estructura de sigo-entities
2
+
3
+ **Fecha:** 2026-08-31
4
+ **Autor:** Brayan Andrés Valero Pinzón — Hermes Agent (sigo-frontend-dev)
5
+ **Destinatario:** Ingeniero Josue — Repositorio `sigo-entities`
6
+
7
+ ---
8
+
9
+ ## Resumen
10
+
11
+ Se detectaron **47 carpetas con nombres incorrectos** (sin guiones), **30 archivos `shared/index.ts` con Entity + DTO + `_id` mezclados**, y **3 carpetas en configuracion que ya fueron corregidas**.
12
+
13
+ ---
14
+
15
+ ## ✅ CORREGIDAS (3 archivos)
16
+
17
+ Las siguientes 3 Entities fueron corregidas siguiendo el patrón correcto:
18
+
19
+ | Carpeta | Archivos creados | Cambios |
20
+ |---|---|---|
21
+ | `theme config country` | `shared/theme-config-country-entity.ts` | Eliminado `_id`, DTOs inline en entity.ts, `shared/index.ts` solo exporta entity |
22
+ | `theme config user` | `shared/dto/favorito-dto.ts` + `shared/theme-config-user-entity.ts` | Eliminado `_id`, DTOs separados en carpeta `dto/`, `shared/index.ts` solo exporta entity |
23
+ | `scraping credential` | `shared/scraping-credential-entity.ts` | Eliminado `_id`, `shared/index.ts` solo exporta entity |
24
+
25
+ **Patrón aplicado:**
26
+ ```
27
+ carpeta/
28
+ shared/
29
+ dto/
30
+ nombre-dto.ts ← DTOs aquí
31
+ nombre-entity.ts ← solo la Entity aquí
32
+ index.ts ← solo export * from './nombre-entity'
33
+ ```
34
+
35
+ ---
36
+
37
+ ## ❌ CARPETA 1: Carpetas con nombres SIN guiones (47 carpetas)
38
+
39
+ **Regla:** Nombres compuestos deben usar guiones (`-`) en lugar de espacios.
40
+
41
+ ### Configuración (10 carpetas)
42
+ | Actual | Debería ser |
43
+ |---|---|
44
+ | `cargo personal` | `cargo-personal` |
45
+ | `contrato ot` | `contrato-ot` |
46
+ | `opcion sistema` | `opcion-sistema` |
47
+ | ~~`scraping credential`~~ | ~~`scraping-credential`~~ ✅ renombrada |
48
+ | ~~`theme config country`~~ | ~~`theme-config-country`~~ ✅ renombrada |
49
+ | ~~`theme config user`~~ | ~~`theme-config-user`~~ ✅ renombrada |
50
+ | `tipo clave` | `tipo-clave` |
51
+ | `tipo especialidad mo` | `tipo-especialidad-mo` |
52
+ | `tipo opcion sistema` | `tipo-opcion-sistema` |
53
+ | `usuarios autoinventario` | `usuarios-autoinventario` |
54
+
55
+ ### Administración (8 carpetas)
56
+ | Actual | Debería ser |
57
+ |---|---|
58
+ | `chile 9512 paquetizado mano obra` | `chile-9512-paquetizado-mano-obra` |
59
+ | `chile 9512 paquetizado material` | `chile-9512-paquetizado-material` |
60
+ | `key integracion` | `key-integracion` |
61
+ | `mail structure` | `mail-structure` |
62
+ | `precio especialidad` | `precio-especialidad` |
63
+ | `precio material` | `precio-material` |
64
+ | `unidad obra material` | `unidad-obra-material` |
65
+ | `zona trabajo` | `zona-trabajo` |
66
+
67
+ ### Logística (17 carpetas)
68
+ | Actual | Debería ser |
69
+ |---|---|
70
+ | `almacen extra` | `almacen-extra` |
71
+ | `atencion ordenes liquidadas` | `atencion-ordenes-liquidadas` |
72
+ | `consumo material` | `consumo-material` |
73
+ | `consumos P117` | `consumos-P117` |
74
+ | `devolucion almacen` | `devolucion-almacen` |
75
+ | `gran familia item` | `gran-familia-item` |
76
+ | `ingreso almacen` | `ingreso-almacen` |
77
+ | `movimiento almacen` | `movimiento-almacen` |
78
+ | `salida almacen` | `salida-almacen` |
79
+ | `stock almacen` | `stock-almacen` |
80
+ | `stock almacen equipos` | `stock-almacen-equipos` |
81
+ | `stock personal` | `stock-personal` |
82
+ | `stock personal equipos` | `stock-personal-equipos` |
83
+ | `tipo almacen` | `tipo-almacen` |
84
+ | `tipo movimiento almacen` | `tipo-movimiento-almacen` |
85
+ | `tipo stock` | `tipo-stock` |
86
+ | `transaccion folios` | `transaccion-folios` |
87
+ | `unidad medida` | `unidad--medida` |
88
+
89
+ ### Programados (10 carpetas)
90
+ | Actual | Debería ser |
91
+ |---|---|
92
+ | `centro costos` | `centro-costos` |
93
+ | `mano obra global` | `mano-obra-global` |
94
+ | `rm actividad` | `rm-actividad` |
95
+ | `rm comuna` | `rm-comuna` |
96
+ | `rm mano obra` | `rm-mano-obra` |
97
+ | `rm paquetizado` | `rm-paquetizado` |
98
+ | `tipo actividad mo` | `tipo-actividad-mo` |
99
+ | `tipo obra` | `tipo-obra` |
100
+ | `model mo sql` | `model-mo-sql` |
101
+ | `model obra sql` | `model-obra-sql` |
102
+
103
+ ### Operativa (7 carpetas)
104
+ | Actual | Debería ser |
105
+ |---|---|
106
+ | `order stock` | `order-stock` |
107
+ | `order stock store` | `order-stock-store` |
108
+ | `request number TTL` | `request-number-TTL` |
109
+ | `Tdc order stock` | `Tdc-order-stock` |
110
+ | `TOA Claro order stock` | `TOA-Claro-order-stock` |
111
+ | `TOA orden liquidacion` | `TOA-orden-liquidacion` |
112
+ | `TOA order stock` | `TOA-order-stock` |
113
+
114
+ ---
115
+
116
+ ## ❌ CARPETA 2: `shared/index.ts` con Entity + DTO + `_id` mezclados (30 carpetas)
117
+
118
+ **Regla:** `shared/index.ts` debe contener SOLO la Entity. Los DTOs deben estar en `shared/dto/`.
119
+
120
+ ### Configuración (3 carpetas — ya corregidas)
121
+ | Carpeta | Entity | DTOs presentes | `_id` | Estado |
122
+ |---|---|---|---|---|
123
+ | `configuracion/ theme-config-country/shared/index.ts` | `ThemeConfigCountryENTITY` | `ImgLogoNavBarDTO`, `ThemeCountryManualDTO` | ✅ Línea 50 | ✅ CORREGIDA (carpeta renombrada, DTOs en `shared/dto/`, `_id` eliminado) |
124
+ | `configuracion/ theme-config-user/shared/index.ts` | `ThemeConfigUserENTITY` | `FavoritoDTO` | ✅ Línea 33 | ✅ CORREGIDA (carpeta renombrada, DTOs en `shared/dto/`, `_id` eliminado) |
125
+ | `configuracion/ scraping-credential/shared/index.ts` | `ScrapingCredentialENTITY` | `CodigoNombreDTO` | ✅ Línea 10 | ✅ CORREGIDA (carpeta renombrada, `_id` eliminado) |
126
+
127
+ ### Logística (2 carpetas)
128
+ | Carpeta | Entity | DTOs presentes | `_id` |
129
+ |---|---|---|---|
130
+ | `logistica/stock personal/shared/index.ts` | `StockPersonalENTITY` | Varios | ✅ |
131
+ | `logistica/stock personal equipos/shared/index.ts` | `StockPersonalEquiposENTITY` | Varios | ✅ |
132
+
133
+ ### Operativa/Procesos (25 carpetas)
134
+ | Carpeta | Entity | `_id` |
135
+ |---|---|---|
136
+ | `operativa/procesos/altas_nvt_order/shared/index.ts` | `AltasNVTOrderENTITY` | ✅ Línea 35 |
137
+ | `operativa/procesos/bantel/shared/index.ts` | `BantelENTITY` | ❌ `resource_id` (equivalente a `_id`) |
138
+ | `operativa/procesos/claro_peru9112/shared/index.ts` | `Peru9112ClaroENTITY` | ✅ Línea 32 |
139
+ | `operativa/procesos/cliente_waoo/shared/index.ts` | `ClienteWAOOENTITY` | ❌ `line_id` (equivalente a `_id`) |
140
+ | `operativa/procesos/fibramas_order/shared/index.ts` | `Peru9112FibramasENTITY` | ❌ `resource_id` (equivalente a `_id`) |
141
+ | `operativa/procesos/fibramas_order_db/shared/index.ts` | `Peru9112FibramasENTITYDB` | ❌ `resource_id` (equivalente a `_id`) |
142
+ | `operativa/procesos/mifibra_db/shared/index.ts` | `MiFibraENTITYDB` | ❌ `resource_id` (equivalente a `_id`) |
143
+ | `operativa/procesos/order stock/shared/index.ts` | `OrderStockENTITY` | ✅ |
144
+ | `operativa/procesos/order stock store/shared/index.ts` | `OrderStockStoreENTITY` | ✅ |
145
+ | `operativa/procesos/request number TTL/shared/index.ts` | `RequestNumberTTLENTITY` | ✅ Línea 14 |
146
+ | `operativa/procesos/somacyl_order/shared/index.ts` | `SomacylOrderENTITY` | ✅ Línea 32 |
147
+ | `operativa/procesos/stb_dth_toaperu/shared/index.ts` | `STB_DTH_ToaENTITY` | ✅ |
148
+ | `operativa/procesos/Tdc order stock/shared/index.ts` | `TdcOrderStockENTITY` | ✅ |
149
+ | `operativa/procesos/TOA Claro order stock/shared/index.ts` | `TOAClaroOrderStockENTITY` | ✅ |
150
+ | `operativa/procesos/TOA orden liquidacion/shared/index.ts` | `TOAOrdenLiquidacionENTITY` | ✅ |
151
+ | `operativa/procesos/TOA orden liquidacion_db/shared/index.ts` | `TOAOrdenLiquidacionENTITYDB` | ✅ Línea 21 |
152
+ | `operativa/procesos/TOA order stock/shared/index.ts` | `TOAOrderStockENTITY` | ✅ |
153
+ | `operativa/procesos/toa_claro/shared/index.ts` | `ToaClaroENTITY` | ✅ |
154
+ | `operativa/procesos/toa_movistar/shared/index.ts` | `Peru9112TOAENTITY` | ✅ Línea 30 |
155
+ | `operativa/procesos/toa_movistar_db/shared/index.ts` | `Peru9112TOAENTITYDB` | ✅ Línea 27 |
156
+ | `operativa/procesos/tuves/shared/index.ts` | `TuvesENTITY` | ✅ Línea 30 |
157
+ | `operativa/procesos/tuves_order_stock/shared/index.ts` | `TuvesOrderStockENTITY` | ✅ |
158
+ | `operativa/procesos/win_order/shared/index.ts` | `Peru9112WinENTITY` | ❌ `resource_id` (equivalente a `_id`) |
159
+ | `operativa/procesos/win_order_db/shared/index.ts` | `Peru9112WinENTITYDB` | ❌ `resource_id` (equivalente a `_id`) |
160
+
161
+ ---
162
+
163
+ ## ❌ CARPETA 3: Estructura incorrecta general
164
+
165
+ **Patrón actual incorrecto (la mayoría de carpetas):**
166
+ ```
167
+ carpeta-con-espacios/
168
+ shared/
169
+ index.ts ← contiene: Entity + DTOs + _id todo mezclado
170
+ ```
171
+
172
+ **Patrón correcto (patrón de referencia `navisionpreorden`):**
173
+ ```
174
+ carpeta-con-guiones/
175
+ shared/
176
+ dto/
177
+ nombre-dto.ts
178
+ otro-dto.ts
179
+ nombre-entity.ts ← solo la Entity aquí
180
+ index.ts ← solo: export * from './nombre-entity'
181
+ ```
182
+
183
+ ---
184
+
185
+ ## 📋 Resumen de problemas por prioridad
186
+
187
+ | Prioridad | Problema | Cantidad | Impacto |
188
+ |---|---|---|---|
189
+ | **P0** | `_id` en Entities | 23 carpetas | Error de validación MongoDB: `_id must be a string` |
190
+ | **P0** | Entity + DTOs mezclados en `shared/index.ts` | 30 carpetas | Confusión de imports, violación de separación de responsabilidades |
191
+ | **P1** | Nombres de carpetas con espacios (sin guiones) | 47 carpetas | Inconsistencia con patrón LatasOS, problemas de import en Windows |
192
+ | **P2** | `shared/index.ts` sin carpeta `dto/` separada | 30 carpetas | DTOs no reutilizables, archivo index.ts inflado |
193
+
194
+ ---
195
+
196
+ ## 📐 Patrón correcto de referencia
197
+
198
+ Archivo: `navisionpreorden/shared/navisionpreorden-entity.ts`
199
+
200
+ ```typescript
201
+ // ✅ Sin _id
202
+ // ✅ Solo la Entity
203
+ // ✅ DTOs en carpeta shared/dto/
204
+ // ✅ Nombre de carpeta con guiones
205
+ // ✅ ID principal como número (ID_NavisionpreordenEntity)
206
+ ```
207
+
208
+ ---
209
+
210
+ ## 🔧 Acciones requeridas
211
+
212
+ 1. **P0 — Eliminar `_id`** de 20 carpetas restantes (incluyendo `resource_id` y `line_id` como equivalentes) — 3 ya corregidas: `theme-config-country`, `theme-config-user`, `scraping-credential`
213
+ 2. **P0 — Separar DTOs de Entities** en 27 carpetas restantes — 3 ya corregidas: `theme-config-country`, `theme-config-user`, `scraping-credential`
214
+ 3. **P1 — Renombrar carpetas** de 44 carpetas restantes — 3 ya corregidas: `theme-config-country`, `theme-config-user`, `scraping-credential`
215
+ 4. **P2 — Actualizar `shared/index.ts`** en 27 carpetas restantes — 3 ya corregidas
package/dist/index.d.mts CHANGED
@@ -8667,7 +8667,7 @@ declare class OrderStockENTITY {
8667
8667
  itemCode: string;
8668
8668
  serial: string;
8669
8669
  quantity: number;
8670
- invpool: string;
8670
+ invpool: InvPoolAction;
8671
8671
  numero_de_peticion: string;
8672
8672
  state_consumption: StateInventory;
8673
8673
  state_replacement: StateInventory;
@@ -10220,7 +10220,7 @@ declare class ThemeConfigCountryEntity extends BaseEntity {
10220
10220
  declare class ThemeConfigUserEntity {
10221
10221
  _id?: string;
10222
10222
  active: boolean;
10223
- ID_Theme: string;
10223
+ ID_Theme: number;
10224
10224
  Identificacion: string;
10225
10225
  Color: string;
10226
10226
  Language: string;
@@ -10378,7 +10378,7 @@ declare class UpdateThemeConfigCountryDto {
10378
10378
  * (que incluye la delegación: ej. "123456AL01").
10379
10379
  */
10380
10380
  declare class CreateThemeConfigUserDto {
10381
- ID_Theme: string;
10381
+ ID_Theme: number;
10382
10382
  Identificacion: string;
10383
10383
  Color: string;
10384
10384
  Language?: string;
@@ -10392,7 +10392,7 @@ declare class CreateThemeConfigUserDto {
10392
10392
  * No se requiere _id — MongoDB maneja su ObjectId internamente.
10393
10393
  */
10394
10394
  declare class UpdateThemeConfigUserDto {
10395
- ID_Theme: string;
10395
+ ID_Theme: number;
10396
10396
  Identificacion: string;
10397
10397
  Color: string;
10398
10398
  Language?: string;
package/dist/index.d.ts CHANGED
@@ -8667,7 +8667,7 @@ declare class OrderStockENTITY {
8667
8667
  itemCode: string;
8668
8668
  serial: string;
8669
8669
  quantity: number;
8670
- invpool: string;
8670
+ invpool: InvPoolAction;
8671
8671
  numero_de_peticion: string;
8672
8672
  state_consumption: StateInventory;
8673
8673
  state_replacement: StateInventory;
@@ -10220,7 +10220,7 @@ declare class ThemeConfigCountryEntity extends BaseEntity {
10220
10220
  declare class ThemeConfigUserEntity {
10221
10221
  _id?: string;
10222
10222
  active: boolean;
10223
- ID_Theme: string;
10223
+ ID_Theme: number;
10224
10224
  Identificacion: string;
10225
10225
  Color: string;
10226
10226
  Language: string;
@@ -10378,7 +10378,7 @@ declare class UpdateThemeConfigCountryDto {
10378
10378
  * (que incluye la delegación: ej. "123456AL01").
10379
10379
  */
10380
10380
  declare class CreateThemeConfigUserDto {
10381
- ID_Theme: string;
10381
+ ID_Theme: number;
10382
10382
  Identificacion: string;
10383
10383
  Color: string;
10384
10384
  Language?: string;
@@ -10392,7 +10392,7 @@ declare class CreateThemeConfigUserDto {
10392
10392
  * No se requiere _id — MongoDB maneja su ObjectId internamente.
10393
10393
  */
10394
10394
  declare class UpdateThemeConfigUserDto {
10395
- ID_Theme: string;
10395
+ ID_Theme: number;
10396
10396
  Identificacion: string;
10397
10397
  Color: string;
10398
10398
  Language?: string;
package/dist/index.js CHANGED
@@ -45092,7 +45092,7 @@ var OrderStockENTITY = class {
45092
45092
  itemCode;
45093
45093
  serial;
45094
45094
  quantity;
45095
- invpool = "";
45095
+ invpool = "install" /* INSTALL */;
45096
45096
  numero_de_peticion;
45097
45097
  state_consumption;
45098
45098
  state_replacement;
@@ -45128,7 +45128,7 @@ __decorateClass([
45128
45128
  __decorateClass([
45129
45129
  (0, import_class_transformer762.Expose)(),
45130
45130
  (0, import_class_validator739.IsDefined)({ message: "El campo invpool es obligatorio." }),
45131
- (0, import_class_validator739.IsString)()
45131
+ (0, import_class_validator739.IsEnum)(InvPoolAction, { message: `El campo invpool debe ser uno de: ${Object.values(InvPoolAction).join(", ")}.` })
45132
45132
  ], OrderStockENTITY.prototype, "invpool", 2);
45133
45133
  __decorateClass([
45134
45134
  (0, import_class_transformer762.Expose)(),
@@ -53835,7 +53835,7 @@ var CreateThemeConfigUserDto = class {
53835
53835
  };
53836
53836
  __decorateClass([
53837
53837
  (0, import_class_validator829.IsDefined)({ message: 'La propiedad "ID_Theme" es obligatoria.' }),
53838
- (0, import_class_validator829.IsString)({ message: 'La propiedad "ID_Theme" debe ser una cadena.' }),
53838
+ (0, import_class_validator829.IsNumber)({}, { message: 'La propiedad "ID_Theme" debe ser un n\xFAmero.' }),
53839
53839
  (0, import_class_transformer853.Expose)()
53840
53840
  ], CreateThemeConfigUserDto.prototype, "ID_Theme", 2);
53841
53841
  __decorateClass([
@@ -53880,7 +53880,7 @@ var UpdateThemeConfigUserDto = class {
53880
53880
  };
53881
53881
  __decorateClass([
53882
53882
  (0, import_class_validator830.IsDefined)({ message: 'La propiedad "ID_Theme" es obligatoria.' }),
53883
- (0, import_class_validator830.IsString)({ message: 'La propiedad "ID_Theme" debe ser una cadena.' }),
53883
+ (0, import_class_validator830.IsNumber)({}, { message: 'La propiedad "ID_Theme" debe ser un n\xFAmero.' }),
53884
53884
  (0, import_class_transformer854.Expose)()
53885
53885
  ], UpdateThemeConfigUserDto.prototype, "ID_Theme", 2);
53886
53886
  __decorateClass([
@@ -54246,7 +54246,7 @@ var import_class_validator839 = require("class-validator");
54246
54246
  var ThemeConfigUserEntity = class {
54247
54247
  _id;
54248
54248
  active = true;
54249
- ID_Theme = "";
54249
+ ID_Theme = 0;
54250
54250
  Identificacion = "";
54251
54251
  Color = "";
54252
54252
  Language = "";
@@ -54263,7 +54263,7 @@ __decorateClass([
54263
54263
  (0, import_class_transformer863.Expose)()
54264
54264
  ], ThemeConfigUserEntity.prototype, "active", 2);
54265
54265
  __decorateClass([
54266
- (0, import_class_validator839.IsString)(),
54266
+ (0, import_class_validator839.IsNumber)(),
54267
54267
  (0, import_class_transformer863.Expose)()
54268
54268
  ], ThemeConfigUserEntity.prototype, "ID_Theme", 2);
54269
54269
  __decorateClass([
package/dist/index.mjs CHANGED
@@ -44480,7 +44480,7 @@ var OrderStockENTITY = class {
44480
44480
  itemCode;
44481
44481
  serial;
44482
44482
  quantity;
44483
- invpool = "";
44483
+ invpool = "install" /* INSTALL */;
44484
44484
  numero_de_peticion;
44485
44485
  state_consumption;
44486
44486
  state_replacement;
@@ -44516,7 +44516,7 @@ __decorateClass([
44516
44516
  __decorateClass([
44517
44517
  Expose736(),
44518
44518
  IsDefined234({ message: "El campo invpool es obligatorio." }),
44519
- IsString606()
44519
+ IsEnum26(InvPoolAction, { message: `El campo invpool debe ser uno de: ${Object.values(InvPoolAction).join(", ")}.` })
44520
44520
  ], OrderStockENTITY.prototype, "invpool", 2);
44521
44521
  __decorateClass([
44522
44522
  Expose736(),
@@ -53278,7 +53278,7 @@ __decorateClass([
53278
53278
 
53279
53279
  // src/v2/dtos/CreateThemeConfigUser.ts
53280
53280
  import { Expose as Expose825, Type as Type498 } from "class-transformer";
53281
- import { IsArray as IsArray260, IsDefined as IsDefined307, IsOptional as IsOptional71, IsString as IsString686, ValidateNested as ValidateNested431 } from "class-validator";
53281
+ import { IsArray as IsArray260, IsDefined as IsDefined307, IsNumber as IsNumber528, IsOptional as IsOptional71, IsString as IsString686, ValidateNested as ValidateNested431 } from "class-validator";
53282
53282
 
53283
53283
  // src/v2/shared-dto/FavoritoDTO.ts
53284
53284
  import { Expose as Expose824 } from "class-transformer";
@@ -53323,7 +53323,7 @@ var CreateThemeConfigUserDto = class {
53323
53323
  };
53324
53324
  __decorateClass([
53325
53325
  IsDefined307({ message: 'La propiedad "ID_Theme" es obligatoria.' }),
53326
- IsString686({ message: 'La propiedad "ID_Theme" debe ser una cadena.' }),
53326
+ IsNumber528({}, { message: 'La propiedad "ID_Theme" debe ser un n\xFAmero.' }),
53327
53327
  Expose825()
53328
53328
  ], CreateThemeConfigUserDto.prototype, "ID_Theme", 2);
53329
53329
  __decorateClass([
@@ -53357,7 +53357,7 @@ __decorateClass([
53357
53357
 
53358
53358
  // src/v2/dtos/UpdateThemeConfigUser.ts
53359
53359
  import { Expose as Expose826, Type as Type499 } from "class-transformer";
53360
- import { IsArray as IsArray261, IsDefined as IsDefined308, IsOptional as IsOptional72, IsString as IsString687, ValidateNested as ValidateNested432 } from "class-validator";
53360
+ import { IsArray as IsArray261, IsDefined as IsDefined308, IsNumber as IsNumber529, IsOptional as IsOptional72, IsString as IsString687, ValidateNested as ValidateNested432 } from "class-validator";
53361
53361
  var UpdateThemeConfigUserDto = class {
53362
53362
  ID_Theme;
53363
53363
  Identificacion;
@@ -53368,7 +53368,7 @@ var UpdateThemeConfigUserDto = class {
53368
53368
  };
53369
53369
  __decorateClass([
53370
53370
  IsDefined308({ message: 'La propiedad "ID_Theme" es obligatoria.' }),
53371
- IsString687({ message: 'La propiedad "ID_Theme" debe ser una cadena.' }),
53371
+ IsNumber529({}, { message: 'La propiedad "ID_Theme" debe ser un n\xFAmero.' }),
53372
53372
  Expose826()
53373
53373
  ], UpdateThemeConfigUserDto.prototype, "ID_Theme", 2);
53374
53374
  __decorateClass([
@@ -53730,11 +53730,11 @@ __decorateClass([
53730
53730
 
53731
53731
  // src/v2/entities/ThemeConfigUser.ts
53732
53732
  import { Expose as Expose835, Type as Type502 } from "class-transformer";
53733
- import { IsString as IsString695, ValidateNested as ValidateNested435, IsArray as IsArray266, IsOptional as IsOptional73, IsDefined as IsDefined315, IsBoolean as IsBoolean81 } from "class-validator";
53733
+ import { IsNumber as IsNumber531, IsString as IsString695, ValidateNested as ValidateNested435, IsArray as IsArray266, IsOptional as IsOptional73, IsDefined as IsDefined315, IsBoolean as IsBoolean81 } from "class-validator";
53734
53734
  var ThemeConfigUserEntity = class {
53735
53735
  _id;
53736
53736
  active = true;
53737
- ID_Theme = "";
53737
+ ID_Theme = 0;
53738
53738
  Identificacion = "";
53739
53739
  Color = "";
53740
53740
  Language = "";
@@ -53751,7 +53751,7 @@ __decorateClass([
53751
53751
  Expose835()
53752
53752
  ], ThemeConfigUserEntity.prototype, "active", 2);
53753
53753
  __decorateClass([
53754
- IsString695(),
53754
+ IsNumber531(),
53755
53755
  Expose835()
53756
53756
  ], ThemeConfigUserEntity.prototype, "ID_Theme", 2);
53757
53757
  __decorateClass([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigo-entities",
3
- "version": "1.2.456",
3
+ "version": "1.2.457",
4
4
  "description": "Desarrollo de modelos de datos SIGO",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -36,4 +36,4 @@
36
36
  "overrides": {
37
37
  "esbuild": "^0.28.0"
38
38
  }
39
- }
39
+ }