chore: import DH V2 D5.6.4 production baseline

This commit is contained in:
DH V2
2026-09-05 10:12:35 -03:00
commit 82213e72f5
757 changed files with 84218 additions and 0 deletions
@@ -0,0 +1,35 @@
import 'reflect-metadata';
import assert from 'node:assert/strict';
import test from 'node:test';
import { validate } from 'class-validator';
import { AddSurveyTargetDto } from '../../src/survey-planning/dto/add-survey-target.dto';
import { CreateSurveyCampaignDto } from '../../src/survey-planning/dto/create-survey-campaign.dto';
const ASSET_ID = '16e54e65-60cf-4739-b0d1-ccdd904fbfd5';
test('campaign DTO accepts dynamic asset scope and ISO planning dates', async () => {
const dto = Object.assign(new CreateSurveyCampaignDto(), {
code: 'REL-2026-001',
name: 'Campaña operativa',
description: null,
plannedStartAt: '2026-08-15T12:00:00.000Z',
plannedEndAt: '2026-08-20T12:00:00.000Z',
scopeAssetId: ASSET_ID,
coordinatorUserId: null,
});
assert.deepEqual(await validate(dto), []);
});
test('target DTO references an existing Maestro asset instead of copying it', async () => {
const dto = Object.assign(new AddSurveyTargetDto(), {
assetId: ASSET_ID,
assignedUserId: null,
dueAt: null,
instructions: null,
});
assert.deepEqual(await validate(dto), []);
dto.assetId = 'not-a-uuid';
const properties = new Set((await validate(dto)).map((error) => error.property));
assert.equal(properties.has('assetId'), true);
});