sigo-entities 1.2.537 → 1.2.539
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.
- package/.claude/settings.local.json +8 -0
- package/dist/index.d.mts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +18577 -18456
- package/dist/index.mjs +13126 -13010
- package/package.json +39 -39
- package/.claude/CLAUDE.md +0 -70
- package/.claude/settings.json +0 -21
- package/.claude/skills/mdl-administracion/SKILL.md +0 -60
- package/.claude/skills/mdl-configuracion/SKILL.md +0 -49
- package/.claude/skills/ope-im/SKILL.md +0 -71
- package/.claude/skills/ope-logistica/SKILL.md +0 -60
- package/.claude/skills/ope-pex/SKILL.md +0 -106
- package/.claude/skills/shared-dtos/SKILL.md +0 -76
- package/__tests__/asistenciaCuadrilla.test.mjs +0 -67
- package/__tests__/replanteo.test.mjs +0 -44
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Ejecutar tras `npm run build`: npm test
|
|
2
|
-
import { test } from "node:test";
|
|
3
|
-
import assert from "node:assert/strict";
|
|
4
|
-
import {
|
|
5
|
-
validateAndFormatData,
|
|
6
|
-
ReplanteoENTITY,
|
|
7
|
-
ReplanteoGomRequestBodyDTO,
|
|
8
|
-
ReplanteoGuardarRequestBodyDTO,
|
|
9
|
-
} from "../dist/index.mjs";
|
|
10
|
-
|
|
11
|
-
const pais = { Codigo: "PE", Nombre: "PERU" };
|
|
12
|
-
const delegacion = { Codigo: "9112", Nombre: "LIMA" };
|
|
13
|
-
const usuario = { Identificacion: "1", Apellidos: "AP", Nombres: "NOM", Fecha: new Date() };
|
|
14
|
-
|
|
15
|
-
const replanteo = (overrides = {}) => ({
|
|
16
|
-
_id: "a7c1b6c2-3d0e-4f9b-9a51-0c2f1d3e4b5a", ID_GOM: 10, GOM: "GOM-10", ID_incidencia: 5,
|
|
17
|
-
Pais: pais, Delegacion: delegacion, Estado: "BORRADOR",
|
|
18
|
-
Foto: { ID_Reserva: 1, ID_ManoObra: 2, Huella: "abc", Fecha: new Date(), Material: [], ManoObra: [] },
|
|
19
|
-
Cambios: { Material: [], ManoObra: [] },
|
|
20
|
-
Adjunto: null, PDF: null, Firma: null,
|
|
21
|
-
UsuarioCreacion: usuario, UsuarioEdicion: usuario,
|
|
22
|
-
...overrides,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("ReplanteoENTITY: borrador sin adjunto, PDF ni firma es válido", async () => {
|
|
26
|
-
await assert.doesNotReject(validateAndFormatData(replanteo(), ReplanteoENTITY));
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test("ReplanteoENTITY: estado fuera de BORRADOR/FIRMADO se rechaza", async () => {
|
|
30
|
-
await assert.rejects(validateAndFormatData(replanteo({ Estado: "ANULADO" }), ReplanteoENTITY));
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test("ReplanteoENTITY: firmado con usuario de firma es válido", async () => {
|
|
34
|
-
await assert.doesNotReject(validateAndFormatData(replanteo({ Estado: "FIRMADO", Firma: usuario }), ReplanteoENTITY));
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test("ReplanteoGomRequestBodyDTO: ID_GOM 0 se rechaza", async () => {
|
|
38
|
-
await assert.rejects(validateAndFormatData({ ID_GOM: 0 }, ReplanteoGomRequestBodyDTO));
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test("ReplanteoGuardarRequestBodyDTO: cambios vacíos son válidos", async () => {
|
|
42
|
-
const body = { ID_GOM: 10, Cambios: { Material: [], ManoObra: [] } };
|
|
43
|
-
await assert.doesNotReject(validateAndFormatData(body, ReplanteoGuardarRequestBodyDTO));
|
|
44
|
-
});
|