feat(captura): fechas de Obra bloqueadas tras establecerse, solo admin las cambia
This commit is contained in:
@@ -148,7 +148,7 @@ describe('guardarEndpoint (POST /api/captura)', () => {
|
||||
res,
|
||||
)
|
||||
expect(status).toHaveBeenCalledWith(204)
|
||||
expect(capturaService.guardarCampo).toHaveBeenCalledWith('SENDA', 'U-101', 'VENTAS', 'estatus', 'VENDIDO', 'u1')
|
||||
expect(capturaService.guardarCampo).toHaveBeenCalledWith('SENDA', 'U-101', 'VENTAS', 'estatus', 'VENDIDO', 'u1', 'admin')
|
||||
})
|
||||
|
||||
it('rechaza departamento inválido', async () => {
|
||||
@@ -190,7 +190,7 @@ describe('bulkEndpoint (POST /api/captura/bulk)', () => {
|
||||
expect(capturaService.guardarBulk).toHaveBeenCalledWith('SENDA', 'VENTAS', [
|
||||
{ unidad: 'U-101', campo: 'estatus', valor: 'VENDIDO' },
|
||||
{ unidad: 'U-102', campo: 'estatus', valor: 'DISPONIBLE' },
|
||||
], 'u1')
|
||||
], 'u1', 'admin')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ export async function guardarEndpoint(req: Request, res: Response): Promise<void
|
||||
body.campo,
|
||||
body.valor ?? null,
|
||||
usuarioId,
|
||||
req.usuarioToken?.rol ?? '',
|
||||
)
|
||||
res.status(204).end()
|
||||
}
|
||||
@@ -106,6 +107,7 @@ export async function bulkEndpoint(req: Request, res: Response): Promise<void> {
|
||||
body.departamento,
|
||||
body.registros.map((r) => ({ unidad: r.unidad, campo: r.campo, valor: r.valor ?? null })),
|
||||
usuarioId,
|
||||
req.usuarioToken?.rol ?? '',
|
||||
)
|
||||
res.status(204).end()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user