Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
0edf206
feat: Implementar funcionalidad para leer set de cuotas y agregar nue…
Rodrig0at May 9, 2025
f459ad7
feat: Refactor leerSetCuotas to handle set of cuotas and update relat…
Rodrig0at May 11, 2025
a74b403
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
DiegoAlfaro1 May 12, 2025
3d172c5
feat: comenzar actualizar grupo empleados
DiegoAlfaro1 May 13, 2025
055748f
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
DiegoAlfaro1 May 13, 2025
18f2cb7
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
Rodrig0at May 13, 2025
b93b273
feat: agregar actualizacion a empleados y nombre y descripcion, falta…
DiegoAlfaro1 May 13, 2025
744fd09
feat: agregar funcionalidad para que se actualicen los sets de produc…
DiegoAlfaro1 May 13, 2025
2c17567
Add: Nuevo query de LEER_CUOTA_SET_PRODUCTOS para obtener los product…
Rodrig0at May 14, 2025
55ff4e2
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
Rodrig0at May 14, 2025
91f6748
merge develop
toscanodiaz May 16, 2025
f8c64b2
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz May 16, 2025
c0e7b18
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz May 19, 2025
aaffc4f
feat: agregar funcionalidad para consultar la informacion del producto
DiegoAlfaro1 May 20, 2025
854b317
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz May 22, 2025
96babb0
feat: crear endpoint
May 22, 2025
fa25684
feat: crear evento
May 23, 2025
8d3cf0c
fix: mandar mensajes correctos
May 23, 2025
289499b
fix: errores de linter
May 23, 2025
6159f23
cambio clienteRedis.js
toscanodiaz May 23, 2025
6f98b70
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz May 23, 2025
0e52ae2
feat: agregar pruebas automáticas con jest
May 23, 2025
6af4b20
Merge branch 'develop' into feat/DAGP_RF36_CrearEvento
May 23, 2025
3f447fa
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz May 23, 2025
80c6e2a
fix: usar middleware para limitar peticiones
May 25, 2025
a6f23a6
feat: manejo de errores más sólido
May 25, 2025
335d3ce
Merge branch 'develop' into feat/DAGP_RF36_CrearEvento
May 25, 2025
650fbd2
Merge branch 'develop' into feat/DAGP_RF36_CrearEvento
May 26, 2025
97cc804
feat: cambiar la consulta para que me de el nombre de la empresa del …
DiegoAlfaro1 May 26, 2025
d561cfb
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
angieriosc May 26, 2025
913e0df
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz May 26, 2025
f473ef5
feature: recibir Productos desde el frontend
NicoH00d May 26, 2025
1299480
feat: agregar funcionalidad para leer rol
DiegoAlfaro1 May 26, 2025
15278c0
Merge pull request #107 from CodeAnd-Co/fix/HIML_RF8_LEER-ROL
DiegoAlfaro1 May 27, 2025
4c17513
fix(rol): cambio de nombre archivo de controller
Hiram10tec May 27, 2025
30645ac
Feature(categorias):Leer-categoria
Hiram10tec May 27, 2025
af57888
feature: backend crear empleado
May 27, 2025
6fb3d31
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz May 27, 2025
1c89669
feat: agregar crear set de empleados
DiegoAlfaro1 May 27, 2025
f19e155
Merge pull request #108 from CodeAnd-Co/feature/HIML_RF48_leer-categoria
Rodrig0at May 27, 2025
3d3e997
feat: agregar validacion de productos
DiegoAlfaro1 May 27, 2025
977ec02
feat(RF59): agregar controlador, rutas y repositorio para exportar em…
May 27, 2025
9553835
docs: agregar documentacion jsdocs y swagger
DiegoAlfaro1 May 27, 2025
b440168
Merge pull request #109 from CodeAnd-Co/feature/DA_RF28_leer-productos
Hiram10tec May 28, 2025
86a3429
docs: js docs en controlador de crear producto
NicoH00d May 28, 2025
2db92e2
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
NicoH00d May 28, 2025
f3258c1
Merge branch 'feat/DAGP_RF36_CrearEvento' of https://github.com/CodeA…
NicoH00d May 28, 2025
e9be560
feature: cambiar consulta para que también devuelva los productos que…
NicoH00d May 28, 2025
0c2a630
feat(Categorías): actualizar categoría
Hiram10tec May 28, 2025
7a52c28
fix: eliminar comentarios
NicoH00d May 28, 2025
ea9aefd
Fix(productos): se eliminan imagenes con placeholder o imagenes
Hiram10tec May 28, 2025
d726a52
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
NicoH00d May 29, 2025
a7f01ed
feature: repositorio para crear un empleado
May 29, 2025
dcf5d34
feat: agregar la consulta
May 29, 2025
2d72496
feat(usuarios): implement update user functionality with controller, …
toscanodiaz May 29, 2025
fc9a87f
feat: agregar funcionalidad para leer rol
DiegoAlfaro1 May 26, 2025
8918141
fix(rol): cambio de nombre archivo de controller
Hiram10tec May 27, 2025
de7321f
Feature(categorias):Leer-categoria
Hiram10tec May 27, 2025
f9a6c85
feat(Categorías): actualizar categoría
Hiram10tec May 28, 2025
0ca90f3
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
May 30, 2025
97dd3eb
Fix: cambio de consulta e información enviada de grupo de empleados
angieriosc May 30, 2025
8e81554
Merge branch 'MBI-1' into feat/DAGP_RF36_CrearEvento
NicoH00d May 30, 2025
5d6f2e9
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
NicoH00d May 30, 2025
50e7627
feat: Actualizar sets de productos
ZValer May 30, 2025
f711cda
fix: cambiar a exportar por seleccion y agregar correciones de formato
May 30, 2025
162ae42
feat(usuarios): add update user route and controller implementation
toscanodiaz May 31, 2025
e0951b9
feat: agregar validaciones para importar producto
NicoH00d May 31, 2025
f471479
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
DiegoAlfaro1 Jun 1, 2025
dbe9552
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
Jun 1, 2025
4be124a
Fix: Correción rutas actualizar empleado y grupo de empleados
angieriosc Jun 1, 2025
b8d1350
Fix: productos actualizados quitar null
angieriosc Jun 2, 2025
798d49f
fix: canelar importación si hay errores
NicoH00d Jun 2, 2025
fc198d1
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
Rodrig0at Jun 2, 2025
0013ab9
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
ArturoSanRod Jun 2, 2025
ce5e7c1
Merge branch 'feat/DAGP_RF36_CrearEvento' of https://github.com/CodeA…
ArturoSanRod Jun 2, 2025
0ac8928
feat: agregar mas validaciones para importar
NicoH00d Jun 2, 2025
dc14464
Merge branch 'feat/DAGP_RF36_CrearEvento' of https://github.com/CodeA…
NicoH00d Jun 2, 2025
646d1b1
fix: cambios menores
NicoH00d Jun 2, 2025
d9a14e9
Merge pull request #103 from CodeAnd-Co/feat/DAGP_RF36_CrearEvento
DiegoAlfaro1 Jun 2, 2025
fb71e95
fix: arreglar logica de actualizacion
DiegoAlfaro1 Jun 2, 2025
ed41ad2
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
Rodrig0at Jun 2, 2025
51c06e8
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
Jun 2, 2025
bf0db1f
fix: agregar validaciones adicionales
NicoH00d Jun 2, 2025
91f4675
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
NicoH00d Jun 2, 2025
db7645f
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz Jun 2, 2025
11f1837
fix: actualizar documentacionn
NicoH00d Jun 3, 2025
6fd220d
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
ZValer Jun 3, 2025
fa42f8d
chore: Agregar rama para GitHub Actions
ZValer Jun 3, 2025
c0c2d0b
Merge pull request #115 from CodeAnd-Co/feat/DA_RF41_crear-set-productos
ZValer Jun 3, 2025
b84b218
merge: Merge con MBI-1
ZValer Jun 3, 2025
bc1a2ae
feat: actualicé para que tenga 2 querys el repositorio uno para el no…
Rodrig0at Jun 3, 2025
8bc0fb4
fix: actualizar comentario de swagger
Jun 3, 2025
5c04f59
feat(usuarios): enhance user update functionality and improve user li…
toscanodiaz Jun 3, 2025
cc7684b
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
angieriosc Jun 3, 2025
49e4295
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
Rodrig0at Jun 3, 2025
02d16c3
Merge pull request #117 from CodeAnd-Co/feature/DA_RF24_actualizar-gr…
toscanodiaz Jun 3, 2025
31329b6
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
Rodrig0at Jun 3, 2025
bf56810
refactor: renombrar varibales en Camel case
Rodrig0at Jun 3, 2025
05845a8
Merge pull request #118 from CodeAnd-Co/feature/RA_US33_lee-set-cuotas
Hiram10tec Jun 3, 2025
cb889e7
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
Jun 4, 2025
836b786
feat(usuarios): enhance user-client association logic in actualizarUs…
toscanodiaz Jun 4, 2025
8bfceca
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
toscanodiaz Jun 4, 2025
868ba29
feat: agregar funcionalidad para editar un rol
DiegoAlfaro1 Jun 4, 2025
25b2bf6
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
DiegoAlfaro1 Jun 4, 2025
778405c
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
DiegoAlfaro1 Jun 4, 2025
3164645
feat: agregar generacion de SKU Automatico
NicoH00d Jun 5, 2025
782fd40
fix: eliminar comentarios de debugging
NicoH00d Jun 5, 2025
535aada
fix: quitar parametro innecesario
DiegoAlfaro1 Jun 5, 2025
b4ec2cd
fix:corregir mensaje de error
Jun 5, 2025
ef63ac7
chore: merge conflicts
Jun 5, 2025
abb3c8e
feature de actualizar categorias
Hiram10tec Jun 5, 2025
960f28d
fix:correcion de lint y estatus
Jun 5, 2025
9c99838
Merge pull request #119 from CodeAnd-Co/feature/PG_RF59_exportar-empl…
angieriosc Jun 5, 2025
5a2aeae
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
DiegoAlfaro1 Jun 5, 2025
e66edd3
fix: arreglar errores
DiegoAlfaro1 Jun 5, 2025
6806bed
Merge pull request #120 from CodeAnd-Co/feature/DA_RF9_actualizar-rol
ArturoSanRod Jun 5, 2025
fbf18bf
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
ZValer Jun 5, 2025
f9b5927
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
Hiram10tec Jun 5, 2025
97fae6d
Corregir rutas duplicadas
Hiram10tec Jun 5, 2025
acc1f25
Corregir conflictos
Hiram10tec Jun 5, 2025
e9719b6
Feat: controller, rutas, repositorio, mensajes
angieriosc Jun 6, 2025
b9b44dd
corrección lint
Hiram10tec Jun 6, 2025
3134acb
Feat: consulta productos completa, controller con las hojas de produ…
angieriosc Jun 6, 2025
496b9e3
Feat: Agregar SKU automatica, y corregir parseo de productos
angieriosc Jun 6, 2025
513f18e
Co-authored-by: Nicolas Hood Figueroa <NicoH00d@users.noreply.github.…
toscanodiaz Jun 6, 2025
fe385dc
Fix: correciones eslint
angieriosc Jun 6, 2025
b48feb7
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
angieriosc Jun 6, 2025
f5e8cce
Fix: pasar logica a repositorio
angieriosc Jun 6, 2025
61fed11
fix: validacion de proveedor existente
NicoH00d Jun 6, 2025
fe52355
Merge pull request #122 from CodeAnd-Co/feature/PG-ARC_RF58_Exportar-…
DiegoAlfaro1 Jun 6, 2025
b5dcd00
feat(usuarios): add password hashing for user updates in actualizarUs…
toscanodiaz Jun 6, 2025
97766b7
feat: agregar validación de proveedor existente
NicoH00d Jun 6, 2025
dd331d1
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
NicoH00d Jun 6, 2025
9521924
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
Hiram10tec Jun 6, 2025
dea5ce3
Añadir dependencias
Hiram10tec Jun 6, 2025
37071e0
fix: mensajes de validacion
NicoH00d Jun 6, 2025
2834863
FIX: mensajes de validacion
NicoH00d Jun 6, 2025
2465500
Merge branch 'develop' of https://github.com/CodeAnd-Co/Backend-texti…
Jun 6, 2025
7114aa6
Merge pull request #121 from CodeAnd-Co/feature/HIML_RF49_actualizar-…
NicoH00d Jun 6, 2025
d15601d
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
NicoH00d Jun 6, 2025
1bb390c
fix: validacion de decripcion repositorio
NicoH00d Jun 6, 2025
ba297a8
feat: agregar proteccion CSRF
DiegoAlfaro1 Jun 6, 2025
28d5097
feat: actualizar sets productos
ZValer Jun 6, 2025
88606d9
feat: Desplegar los productos iniciales para actualizar set
ZValer Jun 6, 2025
349aed4
fix: Corregir errores de lint
ZValer Jun 6, 2025
02edcd3
Implementación semi funcional de actualizar set de cuotas
ArturoSanRod Jun 6, 2025
2a60635
Funcionalidad de actualizar pedido
ArturoSanRod Jun 6, 2025
adc1f7d
No se manda el ID al hook
ArturoSanRod Jun 6, 2025
e268153
fix: mensaje de validacion
NicoH00d Jun 6, 2025
f125849
fix: console error
NicoH00d Jun 6, 2025
d7fb0ff
Fix: consulta, revisar entradas maliciosas, lógica controller y repos…
angieriosc Jun 6, 2025
3a85b01
feature/CIFM rf16 crear empleado
Jun 6, 2025
00ea41d
chore: Merge branch 'MBI-1'
Jun 6, 2025
70e12ab
fix: arreglar errores de eslint
Jun 6, 2025
88c3ded
feat: Agregar pruebas automaticas
NicoH00d Jun 6, 2025
93e3a16
hotfix: quitar console.error
Jun 6, 2025
cba22a7
Fix: mensajes en constantes
NicoH00d Jun 6, 2025
7eba807
FIX: renombrar variable
NicoH00d Jun 6, 2025
4845d6d
test: agregar pruebas automáticas en los modulos de clientes, categor…
Jun 6, 2025
27d14f3
Merge pull request #128 from CodeAnd-Co/test/PG_no_ref_pruebas-automa…
Krlos7121 Jun 6, 2025
1ce82c1
fix(usuarios): improve error handling in actualizarUsuario and clarif…
toscanodiaz Jun 6, 2025
d9f9c68
Merge branch 'MBI-1' into feature/NHF_RF56_ImportarProducto
NicoH00d Jun 6, 2025
9d8bf6d
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
ZValer Jun 6, 2025
f5385bc
Merge branch 'MBI-1' into feat/DA_no_ref_agregar-CSRF
angieriosc Jun 6, 2025
cb2617d
Merge pull request #125 from CodeAnd-Co/feat/DA_no_ref_agregar-CSRF
angieriosc Jun 6, 2025
4604ef5
Implementacion de actualizar set de cuotas
ArturoSanRod Jun 6, 2025
9c24ca4
Fix de implementacion de console logs
ArturoSanRod Jun 6, 2025
274393d
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
ArturoSanRod Jun 6, 2025
d9ee1e9
fix: Agregar manejor de error de nombre duplicado
ZValer Jun 6, 2025
ece3b69
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
ZValer Jun 6, 2025
08a6c83
docs: Agregar comentarios de JSDocs
ZValer Jun 6, 2025
d11a19f
fix: manjeo de error
ZValer Jun 6, 2025
dfd2f9b
Fix: Correciones eslint
angieriosc Jun 6, 2025
e459fcc
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
toscanodiaz Jun 6, 2025
57b6dbd
fix(package): add license information for csurf package
toscanodiaz Jun 6, 2025
8aa811e
Merge branch 'MBI-1' into feature/NHF_RF56_ImportarProducto
ArturoSanRod Jun 7, 2025
390f248
Merge pull request #124 from CodeAnd-Co/feature/NHF_RF56_ImportarProd…
ArturoSanRod Jun 7, 2025
3712b6d
Merge branch 'MBI-1' into feat/VZ_RF44_Actualiza_set_productos
DiegoAlfaro1 Jun 7, 2025
4fc7015
Merge branch 'MBI-1' into tests/NHF_RF1_CrearUsuario
NicoH00d Jun 7, 2025
d269c08
Merge pull request #129 from CodeAnd-Co/feat/VZ_RF44_Actualiza_set_pr…
DiegoAlfaro1 Jun 7, 2025
21315a6
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
NicoH00d Jun 7, 2025
efa080b
Merge pull request #126 from CodeAnd-Co/tests/NHF_RF1_CrearUsuario
Krlos7121 Jun 7, 2025
591a85f
Merge branch 'MBI-1' into feature/CIFM_RF16_Crear-empleado
NicoH00d Jun 7, 2025
455722b
Merge pull request #127 from CodeAnd-Co/feature/CIFM_RF16_Crear-empleado
NicoH00d Jun 7, 2025
6030c84
Merge branch 'MBI-1' into feature/ASR_RF62_Actualizar_Pedido
DiegoAlfaro1 Jun 7, 2025
24bf621
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
ArturoSanRod Jun 7, 2025
4a0aae0
Implementacion de JSDocs
ArturoSanRod Jun 7, 2025
5288c80
Merge pull request #130 from CodeAnd-Co/feature/ASR_RF62_Actualizar_P…
DiegoAlfaro1 Jun 7, 2025
9cbd2be
Merge branch 'MBI-1' into feature/ASR_RF34_Actualizar_Set_Cuotas
Krlos7121 Jun 7, 2025
dc0f24e
Merge pull request #131 from CodeAnd-Co/feature/ASR_RF34_Actualizar_S…
Krlos7121 Jun 7, 2025
ed5b689
fix(actualizarUsuario): streamline password handling and improve erro…
toscanodiaz Jun 7, 2025
daac9f3
Merge branch 'MBI-1' into feature/MT_RF4_ActualizaUsuario
Krlos7121 Jun 7, 2025
0a7d943
fix(actualizarUsuario): simplify password check logic in user update …
toscanodiaz Jun 7, 2025
3ac4ab9
Merge branch 'feature/MT_RF4_ActualizaUsuario' of https://github.com/…
toscanodiaz Jun 7, 2025
a96a863
tests: Agregar pruebas automáticas de consultar lista y actualizar se…
ZValer Jun 7, 2025
a140a3d
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
ZValer Jun 7, 2025
04d8ebe
Merge pull request #134 from CodeAnd-Co/tests/VZ_no_ref_pruebas_autom…
ArturoSanRod Jun 7, 2025
45f6bee
[FIX] - Arreglar actualizar rol de usuario
toscanodiaz Jun 7, 2025
12953d9
integración
toscanodiaz Jun 7, 2025
ace5540
Merge branch 'MBI-1' into feature/MT_RF4_ActualizaUsuario
toscanodiaz Jun 7, 2025
8f574eb
fix: arreglar consulta
NicoH00d Jun 7, 2025
565d7d6
Implementacion de prueba
ArturoSanRod Jun 8, 2025
cd5c21c
Merge pull request #136 from CodeAnd-Co/feature/ASR_RF34_test
Hiram10tec Jun 8, 2025
6d69029
Merge branch 'MBI-1' of https://github.com/CodeAnd-Co/Backend-textile…
NicoH00d Jun 12, 2025
277fbfa
Manejo de errores con nuevo estandar
NicoH00d Jun 13, 2025
fd6df3f
Validación para eliminar al usuario logeado
NicoH00d Jun 13, 2025
209e8d4
Merge pull request #132 from CodeAnd-Co/feature/MT_RF4_ActualizaUsuario
angieriosc Jun 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
- staging
- develop
- MBI-1

jobs:
lint:
Expand All @@ -18,7 +19,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22.14"
node-version: '22.14'

- name: Install dependencies
run: npm install
Expand All @@ -35,7 +36,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22.14"
node-version: '22.14'

- name: Install dependencies
run: npm install
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/dictionaries/project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/webResources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions Categorias/Controladores/actualizarCategoria.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const { actualizarCategoria } = require('@altertex/cat/repos/repositorioActualizarCategorias');
const MENSAJES = require('@altertex/util/const/mensajesCategorias');

/**
* RF49 - Actualizar categoría de productos - https://codeandco-wiki.netlify.app/docs/proyectos/textiles/documentacion/requisitos/RF49
*
* @param {express.Request} req
* @param {express.Response} res
* @returns {Promise<void>}
*/
exports.actualizarCategoria = async (req, res) => {
try {
const { idCategoria } = req.params;
const { nombreCategoria, descripcion, productos } = req.body;

if (!idCategoria) {
return res.status(400).json(MENSAJES.CATEGORIA_NO_ENCONTRADA);
}

if (!nombreCategoria || typeof nombreCategoria !== 'string' || nombreCategoria.trim() === '') {
return res.status(400).json(MENSAJES.NOMBRE_CATEGORIA_INVALIDO);
}

if (!Array.isArray(productos)) {
return res.status(400).json({
codigo: 400,
mensaje: 'El campo productos debe ser un arreglo.',
});
}

if (descripcion && typeof descripcion !== 'string') {
return res.status(400).json(MENSAJES.DESCRIPCION_INVALIDA);
}

await actualizarCategoria({ idCategoria, nombreCategoria, descripcion, productos });

return res.status(200).json({
codigo: 200,
mensaje: 'Categoría actualizada correctamente.',
});
} catch {
return res.status(500).json(MENSAJES.ERROR_CREAR_CATEGORIA);
}
};
41 changes: 41 additions & 0 deletions Categorias/Controladores/consultarDetalleCategoria.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const repositorio = require('@altertex/cat/repos/repositorioLeerDetalleCategoria');
const MENSAJES_CATEGORIAS = require('@altertex/util/const/mensajesCategorias');

/**
* Consulta el detalle de una categoría de productos, incluyendo sus productos asociados.
*
* @function
* @async
* @param {Express.Request} req - Objeto de solicitud HTTP con `req.params.idCategoria`.
* @param {Express.Response} res - Objeto de respuesta HTTP para enviar el resultado.
*
* @returns {Promise<void>} Devuelve una respuesta HTTP con el detalle de la categoría o un mensaje de error.
*
* @description
* Implementa el RF48: Leer categoría de productos.
* Si no se encuentra la categoría, devuelve código 404.
* Si ocurre un error inesperado, devuelve código 500.
*
* @see [RF48 - Documentación de requisitos](https://codeandco-wiki.netlify.app/docs/proyectos/textiles/documentacion/requisitos/RF48)
*/
exports.consultarDetalleCategoria = async (req, res) => {
const idCategoria = parseInt(req.params.idCategoria);

try {
const resultado = await repositorio.leerDetalleCategoria(idCategoria);

if (!resultado) {
return res
.status(MENSAJES_CATEGORIAS.CATEGORIA_NO_ENCONTRADA.codigo)
.json({ mensaje: MENSAJES_CATEGORIAS.CATEGORIA_NO_ENCONTRADA.mensaje });
}

return res
.status(MENSAJES_CATEGORIAS.CATEGORIA_OBTENIDA.codigo)
.json({ mensaje: MENSAJES_CATEGORIAS.CATEGORIA_OBTENIDA.mensaje, categoria: resultado });
} catch {
return res
.status(MENSAJES_CATEGORIAS.ERROR_OBTENER_CATEGORIA.codigo)
.json({ mensaje: MENSAJES_CATEGORIAS.ERROR_OBTENER_CATEGORIA.mensaje });
}
};
22 changes: 22 additions & 0 deletions Categorias/Datos/Repositorios/repositorioActualizarCategorias.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const correrQuery = require('@altertex/util/ser/correrQuery');
const CONSULTAS = require('@altertex/util/const/consultasCategorias');

/**
* Actualiza el nombre, descripción y productos de una categoría.
*
* @param {object} categoria - Objeto con los datos de la categoría.
* @param {number} categoria.idCategoria - ID de la categoría a actualizar.
* @param {string} categoria.nombreCategoria - Nuevo nombre de la categoría.
* @param {string} categoria.descripcion - Nueva descripción.
* @param {number[]} categoria.productos - IDs de productos asociados.
* @returns {Promise<void>}
*/
exports.actualizarCategoria = async ({ idCategoria, nombreCategoria, descripcion, productos }) => {
await correrQuery(CONSULTAS.ACTUALIZAR_CATEGORIA, [nombreCategoria, descripcion, idCategoria]);
await correrQuery(CONSULTAS.ELIMINAR_PRODUCTOS_CATEGORIA, [idCategoria]);

if (productos && productos.length > 0) {
const valores = productos.map((idProd) => [idCategoria, idProd]);
await correrQuery(CONSULTAS.ASIGNAR_PRODUCTOS_A_CATEGORIA, [valores]);
}
};
35 changes: 35 additions & 0 deletions Categorias/Datos/Repositorios/repositorioLeerDetalleCategoria.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const correrQuery = require('@altertex/util/ser/correrQuery');
const CONSULTAS = require('@altertex/util/const/consultasCategorias');

/**
* Consulta el detalle de una categoría y sus productos asociados.
*
* @param {number} idCategoria - ID de la categoría a consultar.
* @returns {Promise<object|null>} Objeto con la información de la categoría y sus productos, o null si no existe.
*
* @throws {Error} Si ocurre un error al ejecutar la consulta.
*
* @see [RF48 - Documentación de requisitos](https://codeandco-wiki.netlify.app/docs/proyectos/textiles/documentacion/requisitos/RF48)
*/
exports.leerDetalleCategoria = async (idCategoria) => {
const query = CONSULTAS.LEER_DETALLE_CATEGORIA;
const resultados = await correrQuery(query, [idCategoria]);

if (!resultados || resultados.length === 0) return null;

const { nombreCategoria, descripcion } = resultados[0];

const productos = resultados
.filter(resul => resul.idProducto !== null)
.map(produc => ({
idProducto: produc.idProducto,
nombreComun: produc.nombreComun,
}));

return {
idCategoria,
nombreCategoria,
descripcion,
productos,
};
};
Loading