From 7b6e2145ea831772d4eeab520349956a2e82f70d Mon Sep 17 00:00:00 2001 From: "Zimin A.N." Date: Wed, 6 May 2026 17:18:28 +0300 Subject: [PATCH] =?UTF-8?q?feat(cuod-bundle):=20v1.2.1=20=E2=80=94=20x-ref?= =?UTF-8?q?erences=20=D0=BD=D0=B0=205=20FK=20=D0=BF=D0=BE=D0=BB=D1=8F?= =?UTF-8?q?=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Демо нового x-references validator (commit 4142678). До этого FK relationships были только в description как "FK на ...". Теперь app-level integrity check на CRUD: - spacecraft.satellite_type_code → satellite_type.code - consumer.consumer_type → consumer_type.code - deliverable_type.typical_processing_level → processing_level.code - orbital_regime.parent_orbit_type → orbit_type.code - antenna.ground_station → ground_station.code Effect: POST/PUT записи с invalid FK → 422 ValidationError code x_references_target_not_found, не silent broken reference. Bundle version bumped 1.2.0 → 1.2.1 (breaking-change detection прокатит — schemaVersion полей не менялись, только metadata). --- .../src/main/resources/bundles/cuod/antenna.schema.json | 2 +- .../src/main/resources/bundles/cuod/consumer.schema.json | 3 ++- .../main/resources/bundles/cuod/deliverable_type.schema.json | 3 ++- .../src/main/resources/bundles/cuod/manifest.json | 2 +- .../src/main/resources/bundles/cuod/orbital_regime.schema.json | 3 ++- .../src/main/resources/bundles/cuod/spacecraft.schema.json | 3 ++- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/antenna.schema.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/antenna.schema.json index 6c3c1cb..d445460 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/antenna.schema.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/antenna.schema.json @@ -10,7 +10,7 @@ "properties": { "code": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]{1,31}$", "x-unique": true }, "name": { "type": "object", "x-localized": true, "patternProperties": { "^[a-z]{2}-[A-Z]{2}$": { "type": "string", "minLength": 1 } }, "required": ["ru-RU"] }, - "ground_station": { "type": "string", "description": "FK ground_station.code.", "pattern": "^[A-Z][A-Z0-9_]{1,31}$" }, + "ground_station": { "type": "string", "description": "FK ground_station.code.", "pattern": "^[A-Z][A-Z0-9_]{1,31}$", "x-references": "ground_station.code" }, "diameter_m": { "type": "number", "minimum": 0.5, "maximum": 100 }, "supported_bands": { "type": "array", "items": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]{1,31}$" }, "uniqueItems": true }, "g_t_db_per_k": { "type": "number", "description": "G/T (gain over noise temperature), дБ/К.", "minimum": -10, "maximum": 60 }, diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/consumer.schema.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/consumer.schema.json index 7379fd9..2260108 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/consumer.schema.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/consumer.schema.json @@ -21,7 +21,8 @@ "consumer_type": { "type": "string", "description": "FK на consumer_type.code.", - "pattern": "^[A-Z][A-Z0-9_]{1,31}$" + "pattern": "^[A-Z][A-Z0-9_]{1,31}$", + "x-references": "consumer_type.code" }, "industry_sector": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]{1,31}$" }, "country": { "type": "string", "pattern": "^[A-Z]{2}$" }, diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/deliverable_type.schema.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/deliverable_type.schema.json index b9eb386..d4ff97b 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/deliverable_type.schema.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/deliverable_type.schema.json @@ -17,7 +17,8 @@ "typical_processing_level": { "type": "string", "description": "FK на processing_level.code (L0/L1/L2/...).", - "pattern": "^[A-Z][A-Z0-9_]{1,31}$" + "pattern": "^[A-Z][A-Z0-9_]{1,31}$", + "x-references": "processing_level.code" }, "status": { "type": "string", "enum": ["active", "archived"] } } diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/manifest.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/manifest.json index ea2b17d..d1b97f9 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/manifest.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/manifest.json @@ -2,7 +2,7 @@ "bundle": "cuod", "displayName": "ЦУОД ДЗЗ", "description": "Bundle справочников для Центра Управления Обработкой Данных ДЗЗ. Anchor v1.", - "version": "1.2.0", + "version": "1.2.1", "supportedLocales": ["ru-RU", "en-US"], "defaultLocale": "ru-RU", "dictionaries": [ diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/orbital_regime.schema.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/orbital_regime.schema.json index 575418d..bbfe152 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/orbital_regime.schema.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/orbital_regime.schema.json @@ -21,7 +21,8 @@ "parent_orbit_type": { "type": "string", "description": "FK на orbit_type.code.", - "pattern": "^[A-Z][A-Z0-9_]{1,31}$" + "pattern": "^[A-Z][A-Z0-9_]{1,31}$", + "x-references": "orbit_type.code" }, "status": { "type": "string", "enum": ["active", "archived"] } } diff --git a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/spacecraft.schema.json b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/spacecraft.schema.json index e9fb4c9..05e4242 100644 --- a/ordinis-cuod-bundle/src/main/resources/bundles/cuod/spacecraft.schema.json +++ b/ordinis-cuod-bundle/src/main/resources/bundles/cuod/spacecraft.schema.json @@ -41,7 +41,8 @@ }, "satellite_type_code": { "type": "string", - "description": "FK на satellite_type.code" + "description": "FK на satellite_type.code", + "x-references": "satellite_type.code" }, "mass_kg": { "type": "number",