sigo-entities 1.2.571 → 1.2.573
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/CLAUDE.md +70 -0
- package/.claude/settings.json +21 -0
- package/.claude/skills/mdl-administracion/SKILL.md +60 -0
- package/.claude/skills/mdl-configuracion/SKILL.md +49 -0
- package/.claude/skills/ope-im/SKILL.md +71 -0
- package/.claude/skills/ope-logistica/SKILL.md +60 -0
- package/.claude/skills/ope-pex/SKILL.md +106 -0
- package/.claude/skills/shared-dtos/SKILL.md +76 -0
- package/README.md +25 -25
- package/REPORTE_ESTRUCTURA_2026-08-31.md +215 -215
- package/__tests__/altasNvtReapertura.test.mjs +58 -0
- package/__tests__/asistenciaCuadrilla.test.mjs +67 -0
- package/__tests__/gridPreferenciaUsuario.test.mjs +89 -0
- package/__tests__/mongoJsonSchema.test.mjs +66 -0
- package/__tests__/replanteo.test.mjs +44 -0
- package/dist/index.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +22 -4
- package/dist/index.mjs +74 -57
- package/package.json +2 -2
- package/__tests__/datos-transportista.test.mjs +0 -34
- package/__tests__/precio-contratista-mo-colombia9612.test.mjs +0 -68
package/dist/index.mjs
CHANGED
|
@@ -31220,17 +31220,14 @@ __decorateClass([
|
|
|
31220
31220
|
], AutoInventarioENTITY.prototype, "ID_StockPersonal", 2);
|
|
31221
31221
|
__decorateClass([
|
|
31222
31222
|
IsString404({ message: "debe ser un texto" }),
|
|
31223
|
-
Length262(1, 40, { message: "debe tener entre 1 y 40 caracteres" }),
|
|
31224
31223
|
Expose530()
|
|
31225
31224
|
], AutoInventarioENTITY.prototype, "Ind_SB", 2);
|
|
31226
31225
|
__decorateClass([
|
|
31227
31226
|
IsString404({ message: "debe ser un texto" }),
|
|
31228
|
-
Length262(1, 50, { message: "debe tener entre 1 y 50 caracteres" }),
|
|
31229
31227
|
Expose530()
|
|
31230
31228
|
], AutoInventarioENTITY.prototype, "CodigoLlave", 2);
|
|
31231
31229
|
__decorateClass([
|
|
31232
31230
|
IsString404({ message: "debe ser un texto" }),
|
|
31233
|
-
Length262(1, 50, { message: "debe tener entre 1 y 50 caracteres" }),
|
|
31234
31231
|
Expose530()
|
|
31235
31232
|
], AutoInventarioENTITY.prototype, "CodigoBusqueda", 2);
|
|
31236
31233
|
__decorateClass([
|
|
@@ -53783,7 +53780,7 @@ __decorateClass([
|
|
|
53783
53780
|
|
|
53784
53781
|
// src/operativa/procesos/btalppluz_order2/shared/index.ts
|
|
53785
53782
|
import { Expose as Expose821, Type as Type505 } from "class-transformer";
|
|
53786
|
-
import { IsDefined as IsDefined306, IsString as IsString677, IsNumber as IsNumber534, IsDate as IsDate195, IsEnum as IsEnum58, IsArray as IsArray257, IsOptional as IsOptional83, ValidateNested as ValidateNested436 } from "class-validator";
|
|
53783
|
+
import { IsDefined as IsDefined306, IsString as IsString677, IsNumber as IsNumber534, IsDate as IsDate195, IsEnum as IsEnum58, IsArray as IsArray257, IsOptional as IsOptional83, IsBoolean as IsBoolean75, IsIn as IsIn10, ValidateNested as ValidateNested436 } from "class-validator";
|
|
53787
53784
|
import "reflect-metadata";
|
|
53788
53785
|
|
|
53789
53786
|
// src/operativa/procesos/btalppluz_order2/shared/dto/liquidacion-bt-alp-pluz-order2-dto.ts
|
|
@@ -54191,6 +54188,11 @@ __decorateClass([
|
|
|
54191
54188
|
IsBoolean74()
|
|
54192
54189
|
], EECCBtAlpPluzDTO.prototype, "Propio", 2);
|
|
54193
54190
|
|
|
54191
|
+
// src/operativa/procesos/btalppluz_order2/shared/dto/origen-orden-vereda.ts
|
|
54192
|
+
var ORIGENES_ORDEN_VEREDA = {
|
|
54193
|
+
PENDIENTE: "PENDIENTE"
|
|
54194
|
+
};
|
|
54195
|
+
|
|
54194
54196
|
// src/operativa/procesos/btalppluz_order2/shared/index.ts
|
|
54195
54197
|
var BtAlpPluzOrder2ENTITY = class {
|
|
54196
54198
|
_id = "";
|
|
@@ -54307,6 +54309,8 @@ var BtAlpPluzOrder2ENTITY = class {
|
|
|
54307
54309
|
cuadrilla = [];
|
|
54308
54310
|
cuadrilla_fecha_key = "";
|
|
54309
54311
|
cuadrilla_id_asistencia = 0;
|
|
54312
|
+
origen_vereda = "";
|
|
54313
|
+
vinculada_electrica = false;
|
|
54310
54314
|
};
|
|
54311
54315
|
__decorateClass([
|
|
54312
54316
|
IsDefined306(),
|
|
@@ -54889,6 +54893,16 @@ __decorateClass([
|
|
|
54889
54893
|
IsOptional83(),
|
|
54890
54894
|
IsNumber534()
|
|
54891
54895
|
], BtAlpPluzOrder2ENTITY.prototype, "cuadrilla_id_asistencia", 2);
|
|
54896
|
+
__decorateClass([
|
|
54897
|
+
Expose821(),
|
|
54898
|
+
IsOptional83(),
|
|
54899
|
+
IsIn10(["", ...Object.values(ORIGENES_ORDEN_VEREDA)])
|
|
54900
|
+
], BtAlpPluzOrder2ENTITY.prototype, "origen_vereda", 2);
|
|
54901
|
+
__decorateClass([
|
|
54902
|
+
Expose821(),
|
|
54903
|
+
IsOptional83(),
|
|
54904
|
+
IsBoolean75()
|
|
54905
|
+
], BtAlpPluzOrder2ENTITY.prototype, "vinculada_electrica", 2);
|
|
54892
54906
|
|
|
54893
54907
|
// src/operativa/procesos/btalppluz_order_stock/shared/index.ts
|
|
54894
54908
|
import { Expose as Expose822, Type as Type506 } from "class-transformer";
|
|
@@ -54968,12 +54982,12 @@ __decorateClass([
|
|
|
54968
54982
|
|
|
54969
54983
|
// src/operativa/procesos/btalppluz_vereda_asignacion/shared/index.ts
|
|
54970
54984
|
import { Expose as Expose832, Transform as Transform117, Type as Type516 } from "class-transformer";
|
|
54971
|
-
import { IsArray as IsArray264, IsBoolean as
|
|
54985
|
+
import { IsArray as IsArray264, IsBoolean as IsBoolean78, IsDate as IsDate201, IsDefined as IsDefined317, IsIn as IsIn15, IsNotEmpty as IsNotEmpty472, IsOptional as IsOptional87, IsString as IsString687, ValidateNested as ValidateNested446 } from "class-validator";
|
|
54972
54986
|
import "reflect-metadata";
|
|
54973
54987
|
|
|
54974
54988
|
// src/operativa/procesos/btalppluz_vereda_asignacion/shared/dto/pendiente-vereda-dto.ts
|
|
54975
54989
|
import { Expose as Expose823, Type as Type507 } from "class-transformer";
|
|
54976
|
-
import { IsBoolean as
|
|
54990
|
+
import { IsBoolean as IsBoolean76, IsDate as IsDate196, IsDefined as IsDefined308, IsOptional as IsOptional84, IsString as IsString679 } from "class-validator";
|
|
54977
54991
|
import "reflect-metadata";
|
|
54978
54992
|
var PendienteVeredaDTO = class {
|
|
54979
54993
|
asunto_orden_mantenimiento = "";
|
|
@@ -55077,7 +55091,7 @@ __decorateClass([
|
|
|
55077
55091
|
__decorateClass([
|
|
55078
55092
|
Expose823(),
|
|
55079
55093
|
IsDefined308(),
|
|
55080
|
-
|
|
55094
|
+
IsBoolean76()
|
|
55081
55095
|
], PendienteVeredaDTO.prototype, "en_fsm", 2);
|
|
55082
55096
|
__decorateClass([
|
|
55083
55097
|
Expose823(),
|
|
@@ -55328,12 +55342,12 @@ __decorateClass([
|
|
|
55328
55342
|
|
|
55329
55343
|
// src/operativa/procesos/btalppluz_vereda_asignacion/shared/dto/formulario-civil-vereda-dto.ts
|
|
55330
55344
|
import { Expose as Expose827, Type as Type511 } from "class-transformer";
|
|
55331
|
-
import { IsArray as IsArray261, IsDate as IsDate198, IsDefined as IsDefined312, IsIn as
|
|
55345
|
+
import { IsArray as IsArray261, IsDate as IsDate198, IsDefined as IsDefined312, IsIn as IsIn11, IsInt, IsNumber as IsNumber538, IsString as IsString682, Max as Max17, MaxLength as MaxLength10, Min as Min355, ValidateNested as ValidateNested441 } from "class-validator";
|
|
55332
55346
|
import "reflect-metadata";
|
|
55333
55347
|
|
|
55334
55348
|
// src/operativa/procesos/btalppluz_vereda_asignacion/shared/dto/desmonte-vereda-dto.ts
|
|
55335
55349
|
import { Expose as Expose826, Type as Type510 } from "class-transformer";
|
|
55336
|
-
import { IsBoolean as
|
|
55350
|
+
import { IsBoolean as IsBoolean77, IsDate as IsDate197, IsDefined as IsDefined311, ValidateBy, ValidateNested as ValidateNested440 } from "class-validator";
|
|
55337
55351
|
import "reflect-metadata";
|
|
55338
55352
|
var FECHA_VACIA_VEREDA = () => /* @__PURE__ */ new Date(0);
|
|
55339
55353
|
var fechaRegistradaVereda = (fecha) => !!fecha && new Date(fecha).getTime() > 0;
|
|
@@ -55345,7 +55359,7 @@ var DesmonteVeredaBodyDTO = class {
|
|
|
55345
55359
|
__decorateClass([
|
|
55346
55360
|
Expose826(),
|
|
55347
55361
|
IsDefined311({ message: "es requerido" }),
|
|
55348
|
-
|
|
55362
|
+
IsBoolean77({ message: "es requerido" })
|
|
55349
55363
|
], DesmonteVeredaBodyDTO.prototype, "tiene_desmonte", 2);
|
|
55350
55364
|
__decorateClass([
|
|
55351
55365
|
Expose826(),
|
|
@@ -55394,7 +55408,7 @@ __decorateClass([
|
|
|
55394
55408
|
Expose827(),
|
|
55395
55409
|
IsDefined312(),
|
|
55396
55410
|
IsString682(),
|
|
55397
|
-
|
|
55411
|
+
IsIn11(PASOS)
|
|
55398
55412
|
], WorkflowPasoVeredaDTO.prototype, "paso", 2);
|
|
55399
55413
|
__decorateClass([
|
|
55400
55414
|
Expose827(),
|
|
@@ -55585,7 +55599,7 @@ __decorateClass([
|
|
|
55585
55599
|
Expose827(),
|
|
55586
55600
|
IsDefined312(),
|
|
55587
55601
|
IsString682(),
|
|
55588
|
-
|
|
55602
|
+
IsIn11(PASOS)
|
|
55589
55603
|
], WorkflowVeredaDTO.prototype, "paso", 2);
|
|
55590
55604
|
__decorateClass([
|
|
55591
55605
|
Expose827(),
|
|
@@ -55628,7 +55642,7 @@ __decorateClass([
|
|
|
55628
55642
|
|
|
55629
55643
|
// src/operativa/procesos/btalppluz_vereda_asignacion/shared/dto/revision-cierre-vereda-dto.ts
|
|
55630
55644
|
import { Expose as Expose828, Type as Type512 } from "class-transformer";
|
|
55631
|
-
import { IsDate as IsDate199, IsDefined as IsDefined313, IsIn as
|
|
55645
|
+
import { IsDate as IsDate199, IsDefined as IsDefined313, IsIn as IsIn12, IsString as IsString683, Length as Length345, ValidateNested as ValidateNested442 } from "class-validator";
|
|
55632
55646
|
import "reflect-metadata";
|
|
55633
55647
|
var ACCIONES_REVISION_VEREDA = ["OBSERVAR", "APROBAR"];
|
|
55634
55648
|
var RevisionVeredaDTO = class {
|
|
@@ -55641,7 +55655,7 @@ __decorateClass([
|
|
|
55641
55655
|
Expose828(),
|
|
55642
55656
|
IsDefined313(),
|
|
55643
55657
|
IsString683(),
|
|
55644
|
-
|
|
55658
|
+
IsIn12(ACCIONES_REVISION_VEREDA)
|
|
55645
55659
|
], RevisionVeredaDTO.prototype, "accion", 2);
|
|
55646
55660
|
__decorateClass([
|
|
55647
55661
|
Expose828(),
|
|
@@ -55705,7 +55719,9 @@ import { IsDate as IsDate200, IsDefined as IsDefined314, IsInt as IsInt2, IsNotE
|
|
|
55705
55719
|
import "reflect-metadata";
|
|
55706
55720
|
var ORIGENES_ASIGNACION_VEREDA = {
|
|
55707
55721
|
BANDEJA: "BANDEJA",
|
|
55708
|
-
POR_ORDEN: "POR_ORDEN"
|
|
55722
|
+
POR_ORDEN: "POR_ORDEN",
|
|
55723
|
+
/** Orden v<orden> creada desde una eléctrica pendiente y luego asignada */
|
|
55724
|
+
CREADA: "CREADA"
|
|
55709
55725
|
};
|
|
55710
55726
|
var LIMITES_PANOS_VEREDA = { MIN: 1, MAX: 99 };
|
|
55711
55727
|
var MSG_PANOS = { message: `debe ser un n\xFAmero entero de ${LIMITES_PANOS_VEREDA.MIN} a ${LIMITES_PANOS_VEREDA.MAX}` };
|
|
@@ -55780,7 +55796,7 @@ __decorateClass([
|
|
|
55780
55796
|
|
|
55781
55797
|
// src/operativa/procesos/btalppluz_vereda_asignacion/shared/dto/material-vereda-dto.ts
|
|
55782
55798
|
import { Expose as Expose830, Type as Type514 } from "class-transformer";
|
|
55783
|
-
import { ArrayUnique, IsArray as IsArray262, IsDefined as IsDefined315, IsIn as
|
|
55799
|
+
import { ArrayUnique, IsArray as IsArray262, IsDefined as IsDefined315, IsIn as IsIn13, IsInt as IsInt3, IsNumber as IsNumber540, IsString as IsString685, Min as Min357, ValidateNested as ValidateNested444 } from "class-validator";
|
|
55784
55800
|
import "reflect-metadata";
|
|
55785
55801
|
var CODIGOS_MATERIALES_VEREDA = ["8841070", "8101001"];
|
|
55786
55802
|
var MaterialVeredaDTO = class {
|
|
@@ -55799,7 +55815,7 @@ __decorateClass([
|
|
|
55799
55815
|
Expose830(),
|
|
55800
55816
|
IsDefined315(),
|
|
55801
55817
|
IsString685(),
|
|
55802
|
-
|
|
55818
|
+
IsIn13(CODIGOS_MATERIALES_VEREDA, { message: "material no permitido" })
|
|
55803
55819
|
], MaterialVeredaDTO.prototype, "codigo", 2);
|
|
55804
55820
|
__decorateClass([
|
|
55805
55821
|
Expose830(),
|
|
@@ -55831,7 +55847,7 @@ __decorateClass([
|
|
|
55831
55847
|
|
|
55832
55848
|
// src/operativa/procesos/btalppluz_vereda_asignacion/shared/dto/mano-obra-vereda-dto.ts
|
|
55833
55849
|
import { Expose as Expose831, Type as Type515 } from "class-transformer";
|
|
55834
|
-
import { ArrayUnique as ArrayUnique2, IsArray as IsArray263, IsDefined as IsDefined316, IsIn as
|
|
55850
|
+
import { ArrayUnique as ArrayUnique2, IsArray as IsArray263, IsDefined as IsDefined316, IsIn as IsIn14, IsNotEmpty as IsNotEmpty471, IsNumber as IsNumber541, IsString as IsString686, Min as Min358, ValidateNested as ValidateNested445 } from "class-validator";
|
|
55835
55851
|
import "reflect-metadata";
|
|
55836
55852
|
var CATALOGO_MANO_OBRA_VEREDA = [
|
|
55837
55853
|
{ codigo: "2100803", descripcion: "MTBTAP-RECONST. VER. CONC/ASF <=15CM 210", unidad: "M2" },
|
|
@@ -55854,7 +55870,7 @@ __decorateClass([
|
|
|
55854
55870
|
Expose831(),
|
|
55855
55871
|
IsDefined316(),
|
|
55856
55872
|
IsString686(),
|
|
55857
|
-
|
|
55873
|
+
IsIn14(CODIGOS_MANO_OBRA_VEREDA, { message: "baremo no permitido" })
|
|
55858
55874
|
], ManoObraVeredaDTO.prototype, "codigo", 2);
|
|
55859
55875
|
__decorateClass([
|
|
55860
55876
|
Expose831(),
|
|
@@ -55892,7 +55908,7 @@ __decorateClass([
|
|
|
55892
55908
|
Expose831(),
|
|
55893
55909
|
IsDefined316(),
|
|
55894
55910
|
IsString686(),
|
|
55895
|
-
|
|
55911
|
+
IsIn14(CODIGOS_MANO_OBRA_VEREDA, { message: "baremo no permitido" })
|
|
55896
55912
|
], CantidadManoObraVeredaDTO.prototype, "codigo", 2);
|
|
55897
55913
|
__decorateClass([
|
|
55898
55914
|
Expose831(),
|
|
@@ -56006,7 +56022,7 @@ __decorateClass([
|
|
|
56006
56022
|
Transform117(({ value }) => value ?? ORIGENES_ASIGNACION_VEREDA.BANDEJA),
|
|
56007
56023
|
IsDefined317(),
|
|
56008
56024
|
IsString687(),
|
|
56009
|
-
|
|
56025
|
+
IsIn15(Object.values(ORIGENES_ASIGNACION_VEREDA))
|
|
56010
56026
|
], BtAlpPluzVeredaAsignacionENTITY.prototype, "origen", 2);
|
|
56011
56027
|
__decorateClass([
|
|
56012
56028
|
Expose832(),
|
|
@@ -56036,7 +56052,7 @@ __decorateClass([
|
|
|
56036
56052
|
__decorateClass([
|
|
56037
56053
|
Expose832(),
|
|
56038
56054
|
IsDefined317(),
|
|
56039
|
-
|
|
56055
|
+
IsBoolean78()
|
|
56040
56056
|
], BtAlpPluzVeredaAsignacionENTITY.prototype, "activa", 2);
|
|
56041
56057
|
__decorateClass([
|
|
56042
56058
|
Expose832(),
|
|
@@ -56179,7 +56195,7 @@ import { IsArray as IsArray267, IsDefined as IsDefined322, IsEnum as IsEnum60, I
|
|
|
56179
56195
|
import { Expose as Expose837, Type as Type518 } from "class-transformer";
|
|
56180
56196
|
|
|
56181
56197
|
// src/v2/dtos/AuthUser.ts
|
|
56182
|
-
import { IsArray as IsArray265, IsBoolean as
|
|
56198
|
+
import { IsArray as IsArray265, IsBoolean as IsBoolean79, IsDefined as IsDefined320, IsEmail as IsEmail7, IsString as IsString689, IsUUID as IsUUID25 } from "class-validator";
|
|
56183
56199
|
import { Expose as Expose835, Transform as Transform120 } from "class-transformer";
|
|
56184
56200
|
var AuthUserDto = class {
|
|
56185
56201
|
email;
|
|
@@ -56222,7 +56238,7 @@ __decorateClass([
|
|
|
56222
56238
|
], AuthUserDto.prototype, "identification", 2);
|
|
56223
56239
|
__decorateClass([
|
|
56224
56240
|
IsDefined320({ message: 'La propiedad "root" es obligatoria.' }),
|
|
56225
|
-
|
|
56241
|
+
IsBoolean79({ message: 'La propiedad "root" debe ser un valor booleano.' }),
|
|
56226
56242
|
Expose835()
|
|
56227
56243
|
], AuthUserDto.prototype, "root", 2);
|
|
56228
56244
|
__decorateClass([
|
|
@@ -56351,7 +56367,7 @@ import { Expose as Expose840, Type as Type519 } from "class-transformer";
|
|
|
56351
56367
|
|
|
56352
56368
|
// src/v2/entities/SystemOption.ts
|
|
56353
56369
|
import { Expose as Expose839 } from "class-transformer";
|
|
56354
|
-
import { IsBoolean as
|
|
56370
|
+
import { IsBoolean as IsBoolean81, IsDefined as IsDefined324, IsNotEmpty as IsNotEmpty474, IsString as IsString692, IsUUID as IsUUID27 } from "class-validator";
|
|
56355
56371
|
var SystemOptionEntity = class {
|
|
56356
56372
|
_id;
|
|
56357
56373
|
key;
|
|
@@ -56394,7 +56410,7 @@ __decorateClass([
|
|
|
56394
56410
|
Expose839()
|
|
56395
56411
|
], SystemOptionEntity.prototype, "route", 2);
|
|
56396
56412
|
__decorateClass([
|
|
56397
|
-
|
|
56413
|
+
IsBoolean81({ message: "Root debe ser booleano" }),
|
|
56398
56414
|
Expose839()
|
|
56399
56415
|
], SystemOptionEntity.prototype, "root", 2);
|
|
56400
56416
|
|
|
@@ -56505,7 +56521,7 @@ __decorateClass([
|
|
|
56505
56521
|
|
|
56506
56522
|
// src/v2/dtos/UpdateProfile.ts
|
|
56507
56523
|
import { Expose as Expose844, Transform as Transform125 } from "class-transformer";
|
|
56508
|
-
import { IsArray as IsArray270, IsDefined as IsDefined328, IsString as IsString696, Length as Length350, MinLength as MinLength62, IsBoolean as
|
|
56524
|
+
import { IsArray as IsArray270, IsDefined as IsDefined328, IsString as IsString696, Length as Length350, MinLength as MinLength62, IsBoolean as IsBoolean83 } from "class-validator";
|
|
56509
56525
|
var UpdateProfileDto = class {
|
|
56510
56526
|
active;
|
|
56511
56527
|
name;
|
|
@@ -56514,7 +56530,7 @@ var UpdateProfileDto = class {
|
|
|
56514
56530
|
};
|
|
56515
56531
|
__decorateClass([
|
|
56516
56532
|
IsDefined328({ message: 'La propiedad "activo" es obligatoria.' }),
|
|
56517
|
-
|
|
56533
|
+
IsBoolean83({ message: 'La propiedad "activo" debe ser un valor booleano.' }),
|
|
56518
56534
|
Expose844()
|
|
56519
56535
|
], UpdateProfileDto.prototype, "active", 2);
|
|
56520
56536
|
__decorateClass([
|
|
@@ -56574,7 +56590,7 @@ __decorateClass([
|
|
|
56574
56590
|
import { Expose as Expose847, Type as Type521 } from "class-transformer";
|
|
56575
56591
|
import {
|
|
56576
56592
|
IsArray as IsArray273,
|
|
56577
|
-
IsBoolean as
|
|
56593
|
+
IsBoolean as IsBoolean86,
|
|
56578
56594
|
IsDefined as IsDefined331,
|
|
56579
56595
|
IsEnum as IsEnum62,
|
|
56580
56596
|
IsNotEmpty as IsNotEmpty476,
|
|
@@ -56646,7 +56662,7 @@ __decorateClass([
|
|
|
56646
56662
|
], _DocumentRequirementDto.prototype, "maxFiles", 2);
|
|
56647
56663
|
__decorateClass([
|
|
56648
56664
|
IsDefined331({ message: "La propiedad de requiere metadatos es requerida" }),
|
|
56649
|
-
|
|
56665
|
+
IsBoolean86({ message: "La propiedad de requiere metadatos debe ser un booleano" }),
|
|
56650
56666
|
Expose847()
|
|
56651
56667
|
], _DocumentRequirementDto.prototype, "requiresMetadata", 2);
|
|
56652
56668
|
__decorateClass([
|
|
@@ -56782,7 +56798,7 @@ var CompanyType = /* @__PURE__ */ ((CompanyType2) => {
|
|
|
56782
56798
|
|
|
56783
56799
|
// src/v2/dtos/CreateCompany.ts
|
|
56784
56800
|
import { Expose as Expose852 } from "class-transformer";
|
|
56785
|
-
import { IsArray as IsArray274, IsBoolean as
|
|
56801
|
+
import { IsArray as IsArray274, IsBoolean as IsBoolean87, IsDefined as IsDefined336, IsEmail as IsEmail11, IsEnum as IsEnum63, IsNotEmpty as IsNotEmpty481, IsString as IsString704, IsUUID as IsUUID36 } from "class-validator";
|
|
56786
56802
|
var CreateCompanyDto = class {
|
|
56787
56803
|
_id;
|
|
56788
56804
|
companyType;
|
|
@@ -56832,7 +56848,7 @@ __decorateClass([
|
|
|
56832
56848
|
], CreateCompanyDto.prototype, "tradeName", 2);
|
|
56833
56849
|
__decorateClass([
|
|
56834
56850
|
IsDefined336({ message: "La propiedad es propia es requerida" }),
|
|
56835
|
-
|
|
56851
|
+
IsBoolean87({ message: "La propiedad es propia debe ser un booleano" }),
|
|
56836
56852
|
Expose852()
|
|
56837
56853
|
], CreateCompanyDto.prototype, "isOwn", 2);
|
|
56838
56854
|
__decorateClass([
|
|
@@ -56862,7 +56878,7 @@ __decorateClass([
|
|
|
56862
56878
|
|
|
56863
56879
|
// src/v2/dtos/UpdateCompany.ts
|
|
56864
56880
|
import { Expose as Expose853 } from "class-transformer";
|
|
56865
|
-
import { IsArray as IsArray275, IsBoolean as
|
|
56881
|
+
import { IsArray as IsArray275, IsBoolean as IsBoolean88, IsDefined as IsDefined337, IsEmail as IsEmail12, IsEnum as IsEnum64, IsNotEmpty as IsNotEmpty482, IsString as IsString705, IsUUID as IsUUID37 } from "class-validator";
|
|
56866
56882
|
var UpdateCompanyDto = class {
|
|
56867
56883
|
_id;
|
|
56868
56884
|
companyType;
|
|
@@ -56912,7 +56928,7 @@ __decorateClass([
|
|
|
56912
56928
|
], UpdateCompanyDto.prototype, "tradeName", 2);
|
|
56913
56929
|
__decorateClass([
|
|
56914
56930
|
IsDefined337({ message: "La propiedad es propia es requerida" }),
|
|
56915
|
-
|
|
56931
|
+
IsBoolean88({ message: "La propiedad es propia debe ser un booleano" }),
|
|
56916
56932
|
Expose853()
|
|
56917
56933
|
], UpdateCompanyDto.prototype, "isOwn", 2);
|
|
56918
56934
|
__decorateClass([
|
|
@@ -56941,7 +56957,7 @@ __decorateClass([
|
|
|
56941
56957
|
], UpdateCompanyDto.prototype, "countryId", 2);
|
|
56942
56958
|
|
|
56943
56959
|
// src/v2/dtos/CreateUser.ts
|
|
56944
|
-
import { IsArray as IsArray276, IsBoolean as
|
|
56960
|
+
import { IsArray as IsArray276, IsBoolean as IsBoolean89, IsDefined as IsDefined339, IsEmail as IsEmail13, IsString as IsString707, IsUUID as IsUUID38, ValidateNested as ValidateNested452 } from "class-validator";
|
|
56945
56961
|
import { Expose as Expose855, Transform as Transform129, Type as Type523 } from "class-transformer";
|
|
56946
56962
|
|
|
56947
56963
|
// src/v2/dtos/ResourceSystemDto.ts
|
|
@@ -57061,7 +57077,7 @@ __decorateClass([
|
|
|
57061
57077
|
], CreateUserDto.prototype, "delegationIds", 2);
|
|
57062
57078
|
__decorateClass([
|
|
57063
57079
|
IsDefined339({ message: 'La propiedad "root" es obligatoria.' }),
|
|
57064
|
-
|
|
57080
|
+
IsBoolean89({ message: 'La propiedad "root" debe ser un valor booleano.' }),
|
|
57065
57081
|
Expose855()
|
|
57066
57082
|
], CreateUserDto.prototype, "root", 2);
|
|
57067
57083
|
__decorateClass([
|
|
@@ -57762,7 +57778,7 @@ __decorateClass([
|
|
|
57762
57778
|
|
|
57763
57779
|
// src/v2/dtos/FinalizeSomacylOrder.ts
|
|
57764
57780
|
import { Expose as Expose873, Transform as Transform135 } from "class-transformer";
|
|
57765
|
-
import { IsDefined as IsDefined352, IsIn as
|
|
57781
|
+
import { IsDefined as IsDefined352, IsIn as IsIn16, IsNotEmpty as IsNotEmpty487, IsOptional as IsOptional97, IsString as IsString724, MaxLength as MaxLength15, ValidateIf as ValidateIf12 } from "class-validator";
|
|
57766
57782
|
var estadosFinalizacion = ["Finalizada" /* FINALIZADA */, "No Finalizada" /* NO_FINALIZADA */];
|
|
57767
57783
|
var motivosNoFinalizado = Object.values(ReasonNoFinalizedSomacyl).filter((e) => e !== "" /* INICIAL */);
|
|
57768
57784
|
var trim2 = ({ value }) => typeof value === "string" ? value.trim() : value;
|
|
@@ -57780,19 +57796,19 @@ var FinalizeSomacylOrderDto = class {
|
|
|
57780
57796
|
};
|
|
57781
57797
|
__decorateClass([
|
|
57782
57798
|
IsDefined352({ message: "El estado es requerido" }),
|
|
57783
|
-
|
|
57799
|
+
IsIn16(estadosFinalizacion, { message: `El estado debe ser uno de: ${estadosFinalizacion.join(", ")}` }),
|
|
57784
57800
|
Expose873()
|
|
57785
57801
|
], FinalizeSomacylOrderDto.prototype, "estado_interno", 2);
|
|
57786
57802
|
__decorateClass([
|
|
57787
57803
|
ValidateIf12((o) => o.estado_interno === "No Finalizada" /* NO_FINALIZADA */),
|
|
57788
57804
|
IsDefined352({ message: "El motivo de no finalizado es requerido" }),
|
|
57789
|
-
|
|
57805
|
+
IsIn16(motivosNoFinalizado, { message: `El motivo de no finalizado debe ser uno de: ${motivosNoFinalizado.join(", ")}` }),
|
|
57790
57806
|
Expose873()
|
|
57791
57807
|
], FinalizeSomacylOrderDto.prototype, "motivo_no_finalizado", 2);
|
|
57792
57808
|
__decorateClass([
|
|
57793
57809
|
ValidateIf12((o) => o.estado_interno === "No Finalizada" /* NO_FINALIZADA */),
|
|
57794
57810
|
IsDefined352({ message: "La clasificaci\xF3n de incidencia es requerida" }),
|
|
57795
|
-
|
|
57811
|
+
IsIn16(clasificacionesNoFinalizado, { message: `La clasificaci\xF3n de incidencia debe ser una de: ${clasificacionesNoFinalizado.join(", ")}` }),
|
|
57796
57812
|
Expose873()
|
|
57797
57813
|
], FinalizeSomacylOrderDto.prototype, "clasificacion_incidencia", 2);
|
|
57798
57814
|
__decorateClass([
|
|
@@ -57863,7 +57879,7 @@ __decorateClass([
|
|
|
57863
57879
|
|
|
57864
57880
|
// src/v2/dtos/HomePassRef.ts
|
|
57865
57881
|
import { Expose as Expose875, Transform as Transform137 } from "class-transformer";
|
|
57866
|
-
import { IsDefined as IsDefined354, IsIn as
|
|
57882
|
+
import { IsDefined as IsDefined354, IsIn as IsIn17, IsInt as IsInt6, IsNotEmpty as IsNotEmpty488, IsString as IsString726, Min as Min363 } from "class-validator";
|
|
57867
57883
|
var HOME_PASS_CLIENT_TYPES = ["Residential", "Business"];
|
|
57868
57884
|
var HomePassRefDto = class {
|
|
57869
57885
|
ID_AddressList = 0;
|
|
@@ -57878,7 +57894,7 @@ __decorateClass([
|
|
|
57878
57894
|
], HomePassRefDto.prototype, "ID_AddressList", 2);
|
|
57879
57895
|
__decorateClass([
|
|
57880
57896
|
IsDefined354({ message: "El tipo de cliente es requerido" }),
|
|
57881
|
-
|
|
57897
|
+
IsIn17(HOME_PASS_CLIENT_TYPES, { message: `El tipo de cliente debe ser uno de: ${HOME_PASS_CLIENT_TYPES.join(", ")}` }),
|
|
57882
57898
|
Expose875()
|
|
57883
57899
|
], HomePassRefDto.prototype, "ClientType", 2);
|
|
57884
57900
|
__decorateClass([
|
|
@@ -57912,14 +57928,14 @@ __decorateClass([
|
|
|
57912
57928
|
|
|
57913
57929
|
// src/v2/dtos/ChangeHomePassState.ts
|
|
57914
57930
|
import { Expose as Expose877 } from "class-transformer";
|
|
57915
|
-
import { IsDefined as IsDefined356, IsIn as
|
|
57931
|
+
import { IsDefined as IsDefined356, IsIn as IsIn18 } from "class-validator";
|
|
57916
57932
|
var HOME_PASS_STATE_TYPES = ["OC", "ASPH", "SOP"];
|
|
57917
57933
|
var ChangeHomePassStateDto = class extends HomePassRefDto {
|
|
57918
57934
|
type = "OC";
|
|
57919
57935
|
};
|
|
57920
57936
|
__decorateClass([
|
|
57921
57937
|
IsDefined356({ message: "El tipo de cierre es requerido" }),
|
|
57922
|
-
|
|
57938
|
+
IsIn18(HOME_PASS_STATE_TYPES, { message: `El tipo de cierre debe ser uno de: ${HOME_PASS_STATE_TYPES.join(", ")}` }),
|
|
57923
57939
|
Expose877()
|
|
57924
57940
|
], ChangeHomePassStateDto.prototype, "type", 2);
|
|
57925
57941
|
|
|
@@ -57950,7 +57966,7 @@ import {
|
|
|
57950
57966
|
ArrayMinSize as ArrayMinSize6,
|
|
57951
57967
|
IsArray as IsArray284,
|
|
57952
57968
|
IsDefined as IsDefined358,
|
|
57953
|
-
IsIn as
|
|
57969
|
+
IsIn as IsIn19,
|
|
57954
57970
|
IsInt as IsInt9,
|
|
57955
57971
|
IsNotEmpty as IsNotEmpty489,
|
|
57956
57972
|
IsNumber as IsNumber552,
|
|
@@ -58053,7 +58069,7 @@ __decorateClass([
|
|
|
58053
58069
|
], PreLiquidateLineDto.prototype, "Cantidad", 2);
|
|
58054
58070
|
__decorateClass([
|
|
58055
58071
|
IsOptional100(),
|
|
58056
|
-
|
|
58072
|
+
IsIn19(BAREMO_SUBCONTRATA_TYPES, { message: `El tipo de baremo debe ser uno de: ${BAREMO_SUBCONTRATA_TYPES.join(", ")}` }),
|
|
58057
58073
|
Expose879()
|
|
58058
58074
|
], PreLiquidateLineDto.prototype, "TipoBaremoSubcontrata", 2);
|
|
58059
58075
|
__decorateClass([
|
|
@@ -58121,7 +58137,7 @@ __decorateClass([
|
|
|
58121
58137
|
], PreLiquidateValuationDto.prototype, "ID_Operacion", 2);
|
|
58122
58138
|
__decorateClass([
|
|
58123
58139
|
IsDefined358({ message: "El tipo de preliquidaci\xF3n es requerido" }),
|
|
58124
|
-
|
|
58140
|
+
IsIn19(PRE_LIQUIDATE_TYPES, { message: `El tipo de preliquidaci\xF3n debe ser uno de: ${PRE_LIQUIDATE_TYPES.join(", ")}` }),
|
|
58125
58141
|
Expose879()
|
|
58126
58142
|
], PreLiquidateValuationDto.prototype, "Tipo", 2);
|
|
58127
58143
|
__decorateClass([
|
|
@@ -58370,13 +58386,13 @@ __decorateClass([
|
|
|
58370
58386
|
|
|
58371
58387
|
// src/v2/dtos/ChangeJobState.ts
|
|
58372
58388
|
import { Expose as Expose882 } from "class-transformer";
|
|
58373
|
-
import { IsDefined as IsDefined361, IsIn as
|
|
58389
|
+
import { IsDefined as IsDefined361, IsIn as IsIn20 } from "class-validator";
|
|
58374
58390
|
var ChangeJobStateDto = class {
|
|
58375
58391
|
type = "OC";
|
|
58376
58392
|
};
|
|
58377
58393
|
__decorateClass([
|
|
58378
58394
|
IsDefined361({ message: "El tipo de cierre es requerido" }),
|
|
58379
|
-
|
|
58395
|
+
IsIn20(HOME_PASS_STATE_TYPES, { message: `El tipo de cierre debe ser uno de: ${HOME_PASS_STATE_TYPES.join(", ")}` }),
|
|
58380
58396
|
Expose882()
|
|
58381
58397
|
], ChangeJobStateDto.prototype, "type", 2);
|
|
58382
58398
|
|
|
@@ -58615,7 +58631,7 @@ import { IsDefined as IsDefined366, IsNotEmpty as IsNotEmpty493, IsString as IsS
|
|
|
58615
58631
|
|
|
58616
58632
|
// src/v2/entities/Base.ts
|
|
58617
58633
|
import { Expose as Expose888 } from "class-transformer";
|
|
58618
|
-
import { IsBoolean as
|
|
58634
|
+
import { IsBoolean as IsBoolean90, IsDefined as IsDefined365, IsUUID as IsUUID41 } from "class-validator";
|
|
58619
58635
|
var BaseEntity = class {
|
|
58620
58636
|
_id;
|
|
58621
58637
|
active;
|
|
@@ -58627,7 +58643,7 @@ __decorateClass([
|
|
|
58627
58643
|
], BaseEntity.prototype, "_id", 2);
|
|
58628
58644
|
__decorateClass([
|
|
58629
58645
|
IsDefined365({ message: 'La propiedad "activo" es obligatoria.' }),
|
|
58630
|
-
|
|
58646
|
+
IsBoolean90({ message: 'La propiedad "activo" debe ser un valor booleano.' }),
|
|
58631
58647
|
Expose888()
|
|
58632
58648
|
], BaseEntity.prototype, "active", 2);
|
|
58633
58649
|
|
|
@@ -58656,7 +58672,7 @@ __decorateClass([
|
|
|
58656
58672
|
], DelegationEntity.prototype, "name", 2);
|
|
58657
58673
|
|
|
58658
58674
|
// src/v2/entities/User.ts
|
|
58659
|
-
import { IsArray as IsArray289, IsBoolean as
|
|
58675
|
+
import { IsArray as IsArray289, IsBoolean as IsBoolean91, IsDefined as IsDefined367, IsEmail as IsEmail14, IsString as IsString734, IsUUID as IsUUID43, ValidateNested as ValidateNested467 } from "class-validator";
|
|
58660
58676
|
import { Expose as Expose890, Transform as Transform142, Type as Type541 } from "class-transformer";
|
|
58661
58677
|
var UserEntity = class extends BaseEntity {
|
|
58662
58678
|
email;
|
|
@@ -58722,7 +58738,7 @@ __decorateClass([
|
|
|
58722
58738
|
], UserEntity.prototype, "delegationIds", 2);
|
|
58723
58739
|
__decorateClass([
|
|
58724
58740
|
IsDefined367({ message: 'La propiedad "root" es obligatoria.' }),
|
|
58725
|
-
|
|
58741
|
+
IsBoolean91({ message: 'La propiedad "root" debe ser un valor booleano.' }),
|
|
58726
58742
|
Expose890()
|
|
58727
58743
|
], UserEntity.prototype, "root", 2);
|
|
58728
58744
|
__decorateClass([
|
|
@@ -58791,7 +58807,7 @@ __decorateClass([
|
|
|
58791
58807
|
|
|
58792
58808
|
// src/v2/entities/Company.ts
|
|
58793
58809
|
import { Expose as Expose893 } from "class-transformer";
|
|
58794
|
-
import { IsArray as IsArray291, IsBoolean as
|
|
58810
|
+
import { IsArray as IsArray291, IsBoolean as IsBoolean92, IsDefined as IsDefined370, IsEmail as IsEmail15, IsEnum as IsEnum68, IsNotEmpty as IsNotEmpty495, IsString as IsString737, IsUUID as IsUUID44 } from "class-validator";
|
|
58795
58811
|
var CompanyEntity = class extends BaseEntity {
|
|
58796
58812
|
companyType;
|
|
58797
58813
|
identification;
|
|
@@ -58835,7 +58851,7 @@ __decorateClass([
|
|
|
58835
58851
|
], CompanyEntity.prototype, "tradeName", 2);
|
|
58836
58852
|
__decorateClass([
|
|
58837
58853
|
IsDefined370({ message: "La propiedad es propia es requerida" }),
|
|
58838
|
-
|
|
58854
|
+
IsBoolean92({ message: "La propiedad es propia debe ser un booleano" }),
|
|
58839
58855
|
Expose893()
|
|
58840
58856
|
], CompanyEntity.prototype, "isOwn", 2);
|
|
58841
58857
|
__decorateClass([
|
|
@@ -58939,7 +58955,7 @@ __decorateClass([
|
|
|
58939
58955
|
|
|
58940
58956
|
// src/v2/entities/ThemeConfigUser.ts
|
|
58941
58957
|
import { Expose as Expose896, Type as Type543 } from "class-transformer";
|
|
58942
|
-
import { IsNumber as IsNumber557, IsString as IsString740, ValidateNested as ValidateNested469, IsArray as IsArray293, IsOptional as IsOptional103, IsDefined as IsDefined371, IsBoolean as
|
|
58958
|
+
import { IsNumber as IsNumber557, IsString as IsString740, ValidateNested as ValidateNested469, IsArray as IsArray293, IsOptional as IsOptional103, IsDefined as IsDefined371, IsBoolean as IsBoolean93 } from "class-validator";
|
|
58943
58959
|
var ThemeConfigUserEntity = class {
|
|
58944
58960
|
_id;
|
|
58945
58961
|
active = true;
|
|
@@ -58956,7 +58972,7 @@ __decorateClass([
|
|
|
58956
58972
|
], ThemeConfigUserEntity.prototype, "_id", 2);
|
|
58957
58973
|
__decorateClass([
|
|
58958
58974
|
IsDefined371({ message: 'La propiedad "activo" es obligatoria.' }),
|
|
58959
|
-
|
|
58975
|
+
IsBoolean93({ message: 'La propiedad "activo" debe ser un valor booleano.' }),
|
|
58960
58976
|
Expose896()
|
|
58961
58977
|
], ThemeConfigUserEntity.prototype, "active", 2);
|
|
58962
58978
|
__decorateClass([
|
|
@@ -59689,6 +59705,7 @@ export {
|
|
|
59689
59705
|
NotasDTO,
|
|
59690
59706
|
NotificacionesENTITY,
|
|
59691
59707
|
ORIGENES_ASIGNACION_VEREDA,
|
|
59708
|
+
ORIGENES_ORDEN_VEREDA,
|
|
59692
59709
|
OTBYESPECIALIDADGEMEINDEENTITY,
|
|
59693
59710
|
OTDTO,
|
|
59694
59711
|
OTENTITY,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sigo-entities",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.573",
|
|
4
4
|
"description": "Desarrollo de modelos de datos SIGO",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -38,4 +38,4 @@
|
|
|
38
38
|
"overrides": {
|
|
39
39
|
"esbuild": "^0.28.0"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// Prueba sobre el build (dist): correr `npm run build` antes de `npm test`
|
|
2
|
-
import { test } from 'node:test'
|
|
3
|
-
import assert from 'node:assert/strict'
|
|
4
|
-
import 'reflect-metadata'
|
|
5
|
-
import { createRequire } from 'node:module'
|
|
6
|
-
|
|
7
|
-
const require = createRequire(import.meta.url)
|
|
8
|
-
const { DatosTransportistaDTO, validateAndFormatData } = require('../dist/index.js')
|
|
9
|
-
|
|
10
|
-
const transportistaViejo = {
|
|
11
|
-
Identificacion: '45879632',
|
|
12
|
-
Nombres: 'JUAN',
|
|
13
|
-
Apellidos: 'PEREZ',
|
|
14
|
-
PlacaVehiculo: 'ABC123',
|
|
15
|
-
Licencia: 'Q45879632',
|
|
16
|
-
RUCEmpresa: '20512345678',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
test('Documento viejo sin RazonSocialEmpresa pasa la validación', async () => {
|
|
20
|
-
const result = await validateAndFormatData(transportistaViejo, DatosTransportistaDTO)
|
|
21
|
-
assert.equal(result.Identificacion, '45879632')
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
test('RazonSocialEmpresa se guarda cuando viene', async () => {
|
|
25
|
-
const result = await validateAndFormatData({ ...transportistaViejo, RazonSocialEmpresa: 'TRANSPORTES SAC' }, DatosTransportistaDTO)
|
|
26
|
-
assert.equal(result.RazonSocialEmpresa, 'TRANSPORTES SAC')
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
test('RazonSocialEmpresa de más de 300 caracteres se rechaza', async () => {
|
|
30
|
-
await assert.rejects(
|
|
31
|
-
validateAndFormatData({ ...transportistaViejo, RazonSocialEmpresa: 'X'.repeat(301) }, DatosTransportistaDTO),
|
|
32
|
-
/RazonSocialEmpresa/
|
|
33
|
-
)
|
|
34
|
-
})
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// Prueba sobre el build (dist): correr `npm run build` antes de `npm test`
|
|
2
|
-
import { test } from 'node:test'
|
|
3
|
-
import assert from 'node:assert/strict'
|
|
4
|
-
import 'reflect-metadata'
|
|
5
|
-
import { createRequire } from 'node:module'
|
|
6
|
-
|
|
7
|
-
const require = createRequire(import.meta.url)
|
|
8
|
-
const { PrecioContratistaMOCOLOMBIA9612ENTITY, validateAndFormatData } = require('../dist/index.js')
|
|
9
|
-
|
|
10
|
-
const contrato2026 = {
|
|
11
|
-
ID_ContratoOT: 10, Codigo: '71.1 -0453 -2026', Descripcion: 'COBRA INSTALACIONES - COLTEL', Sistema: 'SIGO',
|
|
12
|
-
Vigencia: { FechaInicio: new Date('2026-01-01'), FechaFin: new Date('2026-12-31') }, CheckPrecioMO: true,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const precioZona = () => ({
|
|
16
|
-
ID_PrecioContratistaMO: 1,
|
|
17
|
-
Pais: { Codigo: '480', Nombre: 'Colombia' },
|
|
18
|
-
Delegacion: { Codigo: '9612', Nombre: '9612' },
|
|
19
|
-
Moneda: 'COP', Simbolo: '$', Decimales: 2,
|
|
20
|
-
Empresa: { ID_Empresa: 25, Codigo: '900123456', RazonSocial: 'CONTRATISTA SAS', NombreComercial: 'CONTRATISTA', NumeroDocumentoIdentidad: '900123456' },
|
|
21
|
-
Estado: { ID_Estado: 1, Nombre: 'ACTIVO' },
|
|
22
|
-
ContratoOT: contrato2026,
|
|
23
|
-
ManoObraGlobal: [{ ID_ManoObraGlobal: 1, Codigo: 'MO001', Actividad: 'A', Alcance: 'Tendido', Precio: 1500.5, FechaRegistro: new Date(), TipoMO: [] }],
|
|
24
|
-
Vigencia: { Zona: { Codigo: 'Z01', Descripcion: 'BOGOTA NORTE' }, FechaInicio: new Date('2026-11-12'), FechaFin: null },
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
test('Moneda por defecto es COP, $ y 2 decimales', () => {
|
|
28
|
-
const precio = new PrecioContratistaMOCOLOMBIA9612ENTITY()
|
|
29
|
-
assert.deepEqual([precio.Moneda, precio.Simbolo, precio.Decimales], ['COP', '$', 2])
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
test('Precio por zona con vigencia abierta (FechaFin vacía = new Date(0)) pasa la validación', async () => {
|
|
33
|
-
const result = await validateAndFormatData(precioZona(), PrecioContratistaMOCOLOMBIA9612ENTITY)
|
|
34
|
-
assert.deepEqual([result.Vigencia.Zona.Codigo, result.Vigencia.Zona.Descripcion], ['Z01', 'BOGOTA NORTE'])
|
|
35
|
-
assert.equal(result.Vigencia.FechaFin.getTime(), 0)
|
|
36
|
-
assert.equal(result.ContratoOT.Codigo, '71.1 -0453 -2026')
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
test('Vigencia cerrada guarda la FechaFin', async () => {
|
|
40
|
-
const dto = precioZona()
|
|
41
|
-
dto.Vigencia.FechaFin = new Date('2026-12-31')
|
|
42
|
-
const result = await validateAndFormatData(dto, PrecioContratistaMOCOLOMBIA9612ENTITY)
|
|
43
|
-
assert.ok(result.Vigencia.FechaFin instanceof Date)
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
test('Sin zona se rechaza', async () => {
|
|
47
|
-
const dto = precioZona()
|
|
48
|
-
delete dto.Vigencia.Zona
|
|
49
|
-
await assert.rejects(validateAndFormatData(dto, PrecioContratistaMOCOLOMBIA9612ENTITY), /Zona/)
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
test('Sin contrato se rechaza', async () => {
|
|
53
|
-
const dto = precioZona()
|
|
54
|
-
delete dto.ContratoOT
|
|
55
|
-
await assert.rejects(validateAndFormatData(dto, PrecioContratistaMOCOLOMBIA9612ENTITY), /ContratoOT|ID_ContratoOT/)
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
test('Zona sin código se rechaza', async () => {
|
|
59
|
-
const dto = precioZona()
|
|
60
|
-
dto.Vigencia.Zona.Codigo = ''
|
|
61
|
-
await assert.rejects(validateAndFormatData(dto, PrecioContratistaMOCOLOMBIA9612ENTITY), /Codigo/)
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
test('Zona sin descripción se rechaza', async () => {
|
|
65
|
-
const dto = precioZona()
|
|
66
|
-
dto.Vigencia.Zona.Descripcion = ''
|
|
67
|
-
await assert.rejects(validateAndFormatData(dto, PrecioContratistaMOCOLOMBIA9612ENTITY), /Descripcion/)
|
|
68
|
-
})
|