fix(cuod+docs): Resurs-P/Канопус/Метеор/Электро/Арктика в seed + правильный read-api путь

Альтум-команда обнаружила что /api/v1/dictionaries/{name}/records даёт 500
и spacecraft_codes ссылаются на несуществующий "RESURS-P-3". Оба бага мои:

1. Read-api живёт на /api/v1/{name}/records (БЕЗ /dictionaries/ префикса).
   /dictionaries/* — это admin-write контроллер, у него GET-list нет.
   Fix: docs/integration/altum-imaging-order.md + docs/tech/api-integration.md
   обновлены с правильными URL'ами + примером ответа из live staging.

2. spacecraft seed имел только 4 КА (Terra, Sentinel-1A/2A, Кондор-ФКА),
   а mission.spacecraft_codes ссылался на пустые/RESURS-P-3 — каскад в
   "Заказ съёмки" не работал бы.
   Fix: добавлено 10 российских КА (Ресурс-П 1-4, Канопус-В 1+5, Метеор-М 2+2-2,
   Электро-Л 2, Арктика-М 1) с COSPAR designators как businessKey.

3. mission.records.json + instrument.records.json: spacecraft_codes теперь
   ссылается на реально существующие COSPAR-ключи. Каскад работает:
   instrument MSU-MR → spacecraft [2014-037A, 2019-038A] → Метеор-М № 2 / 2-2.

После redeploy и идемпотентного пересева:
  spacecraft   14 (было 4, +10 РФ)
  mission       9 (existing 9, references фиксированы)
  instrument   11 (было 10, +МСУ-ГСМ Арктики)
This commit is contained in:
Zimin A.N.
2026-05-04 18:27:36 +03:00
parent 578fe8f476
commit 2fc9b451e4
5 changed files with 238 additions and 35 deletions
+33 -19
View File
@@ -34,43 +34,57 @@ instrument / processing_level / data_format пока отсутствуют в
**Endpoints (read-only):**
```
GET /dictionaries
→ список доступных справочников.
> ⚠️ **Read-api живёт без префикса `/dictionaries/`** — это admin-write путь.
> Для чтения используйте `/api/v1/{name}/records` напрямую.
GET /dictionaries/{name}/records?lang=ru&at=2026-05-04T12:00:00Z
```
GET /api/v1/dictionaries
→ список доступных справочников (только метаданные + JSON Schema).
GET /api/v1/{name}/records?lang=ru-RU&at=2026-05-04T12:00:00Z
→ активные записи на момент `at` (default: now).
?lang=ru/en — i18n поля приходят строкой на выбранном языке.
?lang=ru-RU / ?lang=en-US — i18n поля сворачиваются в строку на этом языке.
Без ?lang — i18n остаётся объектом {ru-RU, en-US}, BFF может flatten сам.
GET /dictionaries/{name}/records/{businessKey}?lang=ru&at=...
GET /api/v1/{name}/records/{businessKey}?lang=ru-RU&at=...
→ одна запись по businessKey.
GET /api/v1/{name}/records/{businessKey}/history
→ все версии записи (закрытые + текущая).
```
**Пример:**
**Пример (есть на staging прямо сейчас):**
```bash
curl https://ordinis.k8s.265.nstart.cloud/api/v1/dictionaries/spacecraft/records?lang=ru
curl https://ordinis.k8s.265.nstart.cloud/api/v1/spacecraft/records?lang=ru-RU
```
```json
[
{
"businessKey": "RESURS-P-3",
"validFrom": "2025-01-01T00:00:00+03:00",
"validTo": "9999-12-31T23:59:59+00:00",
"id": "72a15bec-56f6-4fb6-8e85-d91a492c707e",
"businessKey": "1999-068A",
"data": {
"code": "RESURS-P-3",
"name": "Ресурс-П № 3",
"norad_id": 41386,
"satellite_type": "OPTICAL",
"launched_at": "2016-03-13",
"operator": "ROSCOSMOS",
"status": "ACTIVE"
}
"name": "Terra (EOS AM-1)",
"country": "US",
"operator": "НАСА",
"norad_id": 25994,
"designator": "1999-068A",
"launch_date": "1999-12-18",
"status": "ACTIVE",
"satellite_type_code": "OPT_MIDRES_MS",
"spectrum_bands": ["VIS", "NIR", "SWIR", "TIR"]
},
"validFrom": "2026-05-03T20:49:09Z",
"validTo": "9999-12-31T23:59:59Z"
}
]
```
**businessKey формат:** для существующих spacecraft — COSPAR designator
(например `2016-016A` = Ресурс-П № 3). Для остальных справочников — code-style
(`RESURS_P`, `MSI-S2`, `GEOTIFF`, `L1A`).
## 3. Согласованные схемы 4 справочников
Все справочники имеют общую базовую структуру: `code` (string, businessKey),
+21 -5
View File
@@ -95,26 +95,42 @@ curl -H "Authorization: Bearer $TOKEN" \
]
```
### `GET /api/v1/dictionaries/{name}/records`
### `GET /api/v1/{name}/records`
> ⚠️ **БЕЗ префикса `/dictionaries/`!** Read-api сидит на `/api/v1/{name}/records`.
> `/api/v1/dictionaries/...` — это admin-write контроллер для CRUD, у него нет
> bulk-list эндпоинта, не пытайтесь его читать.
Активные записи на момент `at` (default: `now`). Параметры:
| параметр | тип | пример | примечание |
|----------|-----------|------------------------------|------------------------------------------------|
| `lang` | string | `ru`, `en` | flatten i18n полей до строки на этом языке |
| `lang` | string | `ru-RU`, `en-US` | flatten i18n полей до строки на этом языке. Короткие формы (`ru`, `en`) тоже принимаются. |
| `at` | ISO 8601 | `2026-05-04T12:00:00+03:00` | bitemporal query — вернёт активные на момент |
| `as_scope` | string | `PUBLIC,INTERNAL` | для anonymous + `allowQueryScope=true` (legacy) |
```bash
curl -H "Authorization: Bearer $TOKEN" \
"https://ordinis.k8s.265.nstart.cloud/api/v1/dictionaries/spacecraft/records?lang=ru"
"https://ordinis.k8s.265.nstart.cloud/api/v1/spacecraft/records?lang=ru-RU"
```
### `GET /api/v1/dictionaries/{name}/records/{businessKey}`
Без `?lang` ответ возвращает локализованные поля как объект:
```json
"name": { "ru-RU": "Ресурс-П № 3", "en-US": "Resurs-P No.3" }
```
С `?lang=ru-RU`:
```json
"name": "Ресурс-П № 3"
```
### `GET /api/v1/{name}/records/{businessKey}`
Одна запись. Параметры те же.
### `GET /api/v1/dictionaries/{name}/records/{businessKey}/history`
### `GET /api/v1/{name}/records/{businessKey}/history`
Все версии записи (включая закрытые). Используется UI-историей, для consumer'ов
обычно не нужно.
@@ -8,7 +8,7 @@
"ru-RU": "Оптико-электронный комплекс высокого разрешения для КА Ресурс-П: панхром 1 м, мультиспектр 3-4 м, 5 каналов VNIR.",
"en-US": "High-resolution optoelectronic payload on Resurs-P: 1 m PAN, 3-4 m multispectral, 5 VNIR bands."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2013-030A", "2014-085A", "2016-016A", "2024-046A"],
"type": "optical",
"spatial_resolution_m": 1.0,
"swath_km": 38,
@@ -27,7 +27,7 @@
"ru-RU": "Широкозахватный мультиспектральный сенсор Ресурс-П: 4 канала VNIR, разрешение 60-120 м, полоса 441 км.",
"en-US": "Wide-swath multispectral sensor on Resurs-P: 4 VNIR bands, 60-120 m resolution, 441 km swath."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2013-030A", "2014-085A", "2016-016A", "2024-046A"],
"type": "multispectral",
"spatial_resolution_m": 60,
"swath_km": 441,
@@ -46,7 +46,7 @@
"ru-RU": "Гиперспектральный сенсор для Ресурс-П: 96-216 каналов в диапазоне 400-1100 нм, разрешение 25-30 м.",
"en-US": "Hyperspectral sensor on Resurs-P: 96-216 channels in 400-1100 nm, 25-30 m resolution."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2013-030A", "2014-085A", "2016-016A"],
"type": "hyperspectral",
"spatial_resolution_m": 25,
"swath_km": 25,
@@ -64,7 +64,7 @@
"ru-RU": "Панхроматический сенсор Канопус-В: разрешение 2,1 м, полоса 23 км.",
"en-US": "Panchromatic sensor on Kanopus-V: 2.1 m resolution, 23 km swath."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2012-039A", "2017-076A"],
"type": "optical",
"spatial_resolution_m": 2.1,
"swath_km": 23,
@@ -83,7 +83,7 @@
"ru-RU": "Многозональный сканер Метеор-М: 6 каналов VIS-TIR, разрешение 1 км, полоса 2900 км.",
"en-US": "Multi-band scanner on Meteor-M: 6 VIS-TIR bands, 1 km resolution, 2900 km swath."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2014-037A", "2019-038A"],
"type": "multispectral",
"spatial_resolution_m": 1000,
"swath_km": 2900,
@@ -102,7 +102,7 @@
"ru-RU": "Многозональное сканирующее устройство геостационарного наблюдения для Электро-Л: 10 каналов VIS/IR, диск Земли каждые 15-30 минут.",
"en-US": "Multi-band scanner for Elektro-L geostationary platform: 10 VIS/IR bands, full disk every 15-30 minutes."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2015-074A"],
"type": "multispectral",
"spatial_resolution_m": 1000,
"swath_km": 22000,
@@ -112,6 +112,25 @@
"status": "active"
}
},
{
"businessKey": "MSU-GSM",
"data": {
"code": "MSU-GSM",
"name": { "ru-RU": "МСУ-ГСМ", "en-US": "MSU-GSM" },
"description": {
"ru-RU": "Многоспектральный сканер Арктика-М: VIS+IR каналы, оперативный мониторинг арктических широт.",
"en-US": "Multi-spectral scanner on Arktika-M: VIS+IR channels, Arctic-region rapid monitoring."
},
"spacecraft_codes": ["2021-016A"],
"type": "multispectral",
"spatial_resolution_m": 1000,
"swath_km": 6000,
"spectral_bands": ["VIS", "NIR", "MWIR", "TIR"],
"supported_format_codes": ["GEOTIFF", "NETCDF"],
"supported_level_codes": ["L1A", "L1B", "L2A"],
"status": "active"
}
},
{
"businessKey": "KONDOR-FKA-SAR",
"data": {
@@ -8,7 +8,7 @@
"ru-RU": "Российская программа оптического ДЗЗ среднего и высокого разрешения. Mass-class — большие КА на ССО.",
"en-US": "Russian optical Earth observation programme, mid-to-high resolution. Heavy buses on SSO."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2013-030A", "2014-085A", "2016-016A", "2024-046A"],
"operator": { "ru-RU": "Роскосмос / РКЦ Прогресс", "en-US": "Roscosmos / RSC Progress" },
"country": "RU",
"status": "active"
@@ -23,7 +23,7 @@
"ru-RU": "Малые КА оперативного мониторинга техногенных и природных катастроф, картографирование.",
"en-US": "Small satellites for rapid monitoring of man-made and natural disasters, mapping."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2012-039A", "2017-076A"],
"operator": { "ru-RU": "Роскосмос / ВНИИЭМ", "en-US": "Roscosmos / VNIIEM" },
"country": "RU",
"status": "active"
@@ -53,7 +53,7 @@
"ru-RU": "Геостационарная гидрометеорологическая программа. Многоспектральная съёмка диска Земли каждые 15-30 минут.",
"en-US": "Geostationary meteorological programme. Multi-spectral full-disk imaging every 15-30 minutes."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2015-074A"],
"operator": { "ru-RU": "Росгидромет / НПО Лавочкина", "en-US": "Roshydromet / Lavochkin Association" },
"country": "RU",
"status": "active"
@@ -68,7 +68,7 @@
"ru-RU": "Российская гидрометеорологическая полярная программа. Глобальное покрытие 1-2 раза в сутки.",
"en-US": "Russian polar meteorological programme. Global coverage 1-2 times per day."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2014-037A", "2019-038A"],
"operator": { "ru-RU": "Росгидромет / ВНИИЭМ", "en-US": "Roshydromet / VNIIEM" },
"country": "RU",
"status": "active"
@@ -83,7 +83,7 @@
"ru-RU": "Высокоэллиптическая орбита (Молния) для непрерывного мониторинга Арктики и северных широт.",
"en-US": "Highly elliptical Molniya orbit for continuous Arctic and high-latitude monitoring."
},
"spacecraft_codes": [],
"spacecraft_codes": ["2021-016A"],
"operator": { "ru-RU": "Росгидромет / НПО Лавочкина", "en-US": "Roshydromet / Lavochkin Association" },
"country": "RU",
"status": "active"
@@ -118,5 +118,159 @@
"en-US": "Radar Earth observation"
}
}
},
{
"businessKey": "2013-030A",
"data": {
"designator": "2013-030A",
"norad_id": 39186,
"name": { "ru-RU": "Ресурс-П № 1", "en-US": "Resurs-P No.1" },
"operator": { "ru-RU": "Роскосмос / РКЦ Прогресс", "en-US": "Roscosmos / RSC Progress" },
"country": "RU",
"satellite_type_code": "OPT_HIRES_VIS",
"mass_kg": 5920,
"launch_date": "2013-06-25",
"decay_date": "2021-12-19",
"status": "DECAYED",
"orbit": { "type": "SSO", "inclination_deg": 97.27 },
"spectrum_bands": ["VIS", "NIR"],
"mission": { "ru-RU": "Высокодетальная оптическая съёмка", "en-US": "High-resolution optical imaging" }
}
},
{
"businessKey": "2014-085A",
"data": {
"designator": "2014-085A",
"norad_id": 40360,
"name": { "ru-RU": "Ресурс-П № 2", "en-US": "Resurs-P No.2" },
"operator": { "ru-RU": "Роскосмос / РКЦ Прогресс", "en-US": "Roscosmos / RSC Progress" },
"country": "RU",
"satellite_type_code": "OPT_HIRES_VIS",
"mass_kg": 5920,
"launch_date": "2014-12-26",
"decay_date": "2022-04-13",
"status": "DECAYED",
"orbit": { "type": "SSO", "inclination_deg": 97.27 }
}
},
{
"businessKey": "2016-016A",
"data": {
"designator": "2016-016A",
"norad_id": 41386,
"name": { "ru-RU": "Ресурс-П № 3", "en-US": "Resurs-P No.3" },
"operator": { "ru-RU": "Роскосмос / РКЦ Прогресс", "en-US": "Roscosmos / RSC Progress" },
"country": "RU",
"satellite_type_code": "OPT_HIRES_VIS",
"mass_kg": 5920,
"launch_date": "2016-03-13",
"status": "ACTIVE",
"orbit": { "type": "SSO", "inclination_deg": 97.28 },
"spectrum_bands": ["VIS", "NIR"]
}
},
{
"businessKey": "2024-046A",
"data": {
"designator": "2024-046A",
"name": { "ru-RU": "Ресурс-П № 4", "en-US": "Resurs-P No.4" },
"operator": { "ru-RU": "Роскосмос / РКЦ Прогресс", "en-US": "Roscosmos / RSC Progress" },
"country": "RU",
"satellite_type_code": "OPT_HIRES_VIS",
"mass_kg": 5920,
"launch_date": "2024-03-31",
"status": "ACTIVE",
"orbit": { "type": "SSO", "inclination_deg": 97.28 },
"spectrum_bands": ["VIS", "NIR"]
}
},
{
"businessKey": "2012-039A",
"data": {
"designator": "2012-039A",
"norad_id": 38707,
"name": { "ru-RU": "Канопус-В № 1", "en-US": "Kanopus-V No.1" },
"operator": { "ru-RU": "Роскосмос / ВНИИЭМ", "en-US": "Roscosmos / VNIIEM" },
"country": "RU",
"satellite_type_code": "OPT_HIRES_VIS",
"mass_kg": 473,
"launch_date": "2012-07-22",
"status": "ACTIVE",
"orbit": { "type": "SSO", "inclination_deg": 97.43 },
"spectrum_bands": ["VIS", "NIR"]
}
},
{
"businessKey": "2017-076A",
"data": {
"designator": "2017-076A",
"name": { "ru-RU": "Канопус-В № 5 (2-Гранд)", "en-US": "Kanopus-V No.5 (Grand)" },
"operator": { "ru-RU": "Роскосмос / ВНИИЭМ", "en-US": "Roscosmos / VNIIEM" },
"country": "RU",
"satellite_type_code": "OPT_HIRES_VIS",
"mass_kg": 473,
"launch_date": "2017-12-01",
"status": "ACTIVE",
"orbit": { "type": "SSO", "inclination_deg": 97.45 }
}
},
{
"businessKey": "2014-037A",
"data": {
"designator": "2014-037A",
"name": { "ru-RU": "Метеор-М № 2", "en-US": "Meteor-M No.2" },
"operator": { "ru-RU": "Росгидромет / ВНИИЭМ", "en-US": "Roshydromet / VNIIEM" },
"country": "RU",
"satellite_type_code": "OPT_MIDRES_MS",
"mass_kg": 2900,
"launch_date": "2014-07-08",
"status": "ACTIVE",
"orbit": { "type": "SSO", "inclination_deg": 98.86 },
"spectrum_bands": ["VIS", "NIR", "SWIR", "TIR"]
}
},
{
"businessKey": "2019-038A",
"data": {
"designator": "2019-038A",
"name": { "ru-RU": "Метеор-М № 2-2", "en-US": "Meteor-M No.2-2" },
"operator": { "ru-RU": "Росгидромет / ВНИИЭМ", "en-US": "Roshydromet / VNIIEM" },
"country": "RU",
"satellite_type_code": "OPT_MIDRES_MS",
"mass_kg": 2900,
"launch_date": "2019-07-05",
"status": "ACTIVE",
"orbit": { "type": "SSO", "inclination_deg": 98.83 }
}
},
{
"businessKey": "2015-074A",
"data": {
"designator": "2015-074A",
"name": { "ru-RU": "Электро-Л № 2", "en-US": "Elektro-L No.2" },
"operator": { "ru-RU": "Росгидромет / НПО Лавочкина", "en-US": "Roshydromet / Lavochkin Association" },
"country": "RU",
"satellite_type_code": "OPT_MIDRES_MS",
"mass_kg": 1740,
"launch_date": "2015-12-11",
"status": "ACTIVE",
"orbit": { "type": "GEO" },
"spectrum_bands": ["VIS", "NIR", "MWIR", "TIR"]
}
},
{
"businessKey": "2021-016A",
"data": {
"designator": "2021-016A",
"name": { "ru-RU": "Арктика-М № 1", "en-US": "Arktika-M No.1" },
"operator": { "ru-RU": "Росгидромет / НПО Лавочкина", "en-US": "Roshydromet / Lavochkin Association" },
"country": "RU",
"satellite_type_code": "OPT_MIDRES_MS",
"mass_kg": 2200,
"launch_date": "2021-02-28",
"status": "ACTIVE",
"orbit": { "type": "HEO" },
"spectrum_bands": ["VIS", "NIR", "MWIR", "TIR"]
}
}
]