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,47 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { changedSnapshotFields } from '../../src/asset-master/asset-version-diff';
const base = {
code: 'ACT-001',
name: 'Pozo 1',
description: null,
type: { id: 'type-1', code: 'WELL', name: 'Pozo' },
parent: null,
informationStatus: 'DRAFT',
attributes: [{ code: 'depth', value: 1200 }],
geometry: null,
updatedAt: '2026-08-14T10:00:00.000Z',
};
test('version diff ignores technical timestamps and detects functional fields', () => {
const current = {
...base,
informationStatus: 'SURVEYED',
updatedAt: '2026-08-14T11:00:00.000Z',
};
assert.deepEqual(changedSnapshotFields(base, current), ['informationStatus']);
});
test('version diff detects attribute and geometry changes', () => {
const current = {
...base,
attributes: [{ code: 'depth', value: 1300 }],
geometry: { geometryType: 'POINT', geometry: { type: 'POINT', coordinates: [-68, -32] } },
};
assert.deepEqual(changedSnapshotFields(base, current), ['attributes', 'geometry']);
});
test('version diff detects media changes independently', () => {
const previous = { ...base, media: [] };
const current = { ...base, media: [{ id: 'media-1', sha256: 'abc' }] };
assert.deepEqual(changedSnapshotFields(previous, current), ['media']);
});
test('version diff detects provenance changes independently', () => {
const previous = { ...base, provenance: { origin: 'MANUAL', verifiedAt: null } };
const current = { ...base, provenance: { origin: 'FIELD_SURVEY', verifiedAt: null } };
assert.deepEqual(changedSnapshotFields(previous, current), ['provenance']);
});