Rework registry elements

This commit is contained in:
2025-09-08 19:48:57 +09:00
parent 80901cc1f9
commit 30235c3d7e
16 changed files with 158 additions and 178 deletions

View File

@ -1,4 +1,5 @@
using Hcs.Service.Async.HouseManagement; using Hcs.Client.Api.Registry;
using Hcs.Service.Async.HouseManagement;
using System; using System;
namespace Hcs.Client.Api.Payload.HouseManagement namespace Hcs.Client.Api.Payload.HouseManagement
@ -37,9 +38,9 @@ namespace Hcs.Client.Api.Payload.HouseManagement
// TODO: Protocol // TODO: Protocol
/// <summary> /// <summary>
/// Ссылка на НСИ "Основание заключения договора" (реестровый номер 58). /// Ссылка на НСИ "Основание заключения договора" (реестровый номер 58)
/// </summary> /// </summary>
public nsiRef contractBase; public RegistryElement contractBase;
/// <summary> /// <summary>
/// Сведения о сроках /// Сведения о сроках

View File

@ -1,4 +1,5 @@
using Hcs.Service.Async.HouseManagement; using Hcs.Client.Api.Registry;
using Hcs.Service.Async.HouseManagement;
using System; using System;
namespace Hcs.Client.Api.Payload.HouseManagement namespace Hcs.Client.Api.Payload.HouseManagement
@ -20,12 +21,12 @@ namespace Hcs.Client.Api.Payload.HouseManagement
/// <summary> /// <summary>
/// Состояние (НСИ 24) /// Состояние (НСИ 24)
/// </summary> /// </summary>
public nsiRef state; public RegistryElement state;
/// <summary> /// <summary>
/// Необязательное. Стадия жизненного цикла (НСИ 338). /// Необязательное. Стадия жизненного цикла (НСИ 338).
/// </summary> /// </summary>
public nsiRef lifeCycleStage; public RegistryElement lifeCycleStage;
/// <summary> /// <summary>
/// Год ввода в эксплуатацию. До 2215 включительно. /// Год ввода в эксплуатацию. До 2215 включительно.
@ -46,7 +47,7 @@ namespace Hcs.Client.Api.Payload.HouseManagement
/// <summary> /// <summary>
/// Часовая зона. Справочник 32. /// Часовая зона. Справочник 32.
/// </summary> /// </summary>
public nsiRef olsonTZ; public RegistryElement olsonTZ;
/// <summary> /// <summary>
/// Наличие у дома статуса объекта культурного наследия /// Наличие у дома статуса объекта культурного наследия

View File

@ -1,6 +1,4 @@
using Hcs.Service.Async.HouseManagement; namespace Hcs.Client.Api.Registry
namespace Hcs.Client.Api.Registry
{ {
/// <summary> /// <summary>
/// НСИ "Межповерочный интервал" (реестровый номер 16). /// НСИ "Межповерочный интервал" (реестровый номер 16).
@ -11,10 +9,8 @@ namespace Hcs.Client.Api.Registry
/// <summary> /// <summary>
/// 4 года /// 4 года
/// </summary> /// </summary>
public static nsiRef Element4 => new() public static RegistryElement Element4 => new(
{ "4",
Code = "4", "296aff1b-0fbe-4111-9aea-1693a6e58db0");
GUID = "296aff1b-0fbe-4111-9aea-1693a6e58db0"
};
} }
} }

View File

@ -1,6 +1,4 @@
using Hcs.Service.Async.HouseManagement; namespace Hcs.Client.Api.Registry
namespace Hcs.Client.Api.Registry
{ {
/// <summary> /// <summary>
/// НСИ "Тарифицируемый ресурс" (реестровый номер 239). /// НСИ "Тарифицируемый ресурс" (реестровый номер 239).
@ -11,10 +9,8 @@ namespace Hcs.Client.Api.Registry
/// <summary> /// <summary>
/// Тепловая энергия /// Тепловая энергия
/// </summary> /// </summary>
public static ContractSubjectTypeMunicipalResource Element4 => new() public static RegistryElement Element4 => new(
{ "4",
Code = "4", "eec6e4b8-76c8-4fce-99b7-c95718edad19");
GUID = "eec6e4b8-76c8-4fce-99b7-c95718edad19"
};
} }
} }

View File

@ -1,6 +1,4 @@
using Hcs.Service.Async.HouseManagement; namespace Hcs.Client.Api.Registry
namespace Hcs.Client.Api.Registry
{ {
/// <summary> /// <summary>
/// НСИ "Состояние дома" (реестровый номер 24). /// НСИ "Состояние дома" (реестровый номер 24).
@ -11,37 +9,29 @@ namespace Hcs.Client.Api.Registry
/// <summary> /// <summary>
/// Аварийный /// Аварийный
/// </summary> /// </summary>
public static nsiRef Element1 => new() public static RegistryElement Element1 => new(
{ "1",
Code = "1", "cbe05853-a91b-43cc-a2cb-06cdfa97d492");
GUID = "cbe05853-a91b-43cc-a2cb-06cdfa97d492"
};
/// <summary> /// <summary>
/// Исправный /// Исправный
/// </summary> /// </summary>
public static nsiRef Element2 => new() public static RegistryElement Element2 => new(
{ "2",
Code = "2", "2d3ae73e-6c72-4740-9122-9c632d1893a7");
GUID = "2d3ae73e-6c72-4740-9122-9c632d1893a7"
};
/// <summary> /// <summary>
/// Ветхий /// Ветхий
/// </summary> /// </summary>
public static nsiRef Element3 => new() public static RegistryElement Element3 => new(
{ "3",
Code = "3", "bf083ae4-e4ec-4ace-b190-4d009e5cd1a1");
GUID = "bf083ae4-e4ec-4ace-b190-4d009e5cd1a1"
};
/// <summary> /// <summary>
/// Не выбран /// Не выбран
/// </summary> /// </summary>
public static nsiRef Element4 => new() public static RegistryElement Element4 => new(
{ "4",
Code = "4", "4ee07c0b-82d6-41f4-a8c5-2cff784bbd9c");
GUID = "4ee07c0b-82d6-41f4-a8c5-2cff784bbd9c"
};
} }
} }

View File

@ -1,6 +1,4 @@
using Hcs.Service.Async.HouseManagement; namespace Hcs.Client.Api.Registry
namespace Hcs.Client.Api.Registry
{ {
/// <summary> /// <summary>
/// НСИ "Показатели качества коммунальных ресурсов" (реестровый номер 276). /// НСИ "Показатели качества коммунальных ресурсов" (реестровый номер 276).
@ -11,19 +9,15 @@ namespace Hcs.Client.Api.Registry
/// <summary> /// <summary>
/// Величина тепловой нагрузки /// Величина тепловой нагрузки
/// </summary> /// </summary>
public static nsiRef Element4 => new() public static RegistryElement Element4 => new(
{ "4",
Code = "4", "51dd6edc-83fe-4810-8b62-4dc85a75e9a3");
GUID = "51dd6edc-83fe-4810-8b62-4dc85a75e9a3"
};
/// <summary> /// <summary>
/// Диапазон давления теплоносителя в подающем трубопроводе /// Диапазон давления теплоносителя в подающем трубопроводе
/// </summary> /// </summary>
public static nsiRef Element10 => new() public static RegistryElement Element10 => new(
{ "10",
Code = "10", "a5a17c90-cc4b-4f32-a22b-6e06cd42a68c");
GUID = "a5a17c90-cc4b-4f32-a22b-6e06cd42a68c"
};
} }
} }

View File

@ -1,6 +1,4 @@
using Hcs.Service.Async.HouseManagement; namespace Hcs.Client.Api.Registry
namespace Hcs.Client.Api.Registry
{ {
/// <summary> /// <summary>
/// НСИ "Вид коммунальной услуги" (реестровый номер 3). /// НСИ "Вид коммунальной услуги" (реестровый номер 3).
@ -11,10 +9,8 @@ namespace Hcs.Client.Api.Registry
/// <summary> /// <summary>
/// Отопление /// Отопление
/// </summary> /// </summary>
public static ContractSubjectTypeServiceType Element6 => new() public static RegistryElement Element6 => new(
{ "6",
Code = "6", "74925764-ddf3-4b4b-b18d-85994187c13a");
GUID = "74925764-ddf3-4b4b-b18d-85994187c13a"
};
} }
} }

View File

@ -1,6 +1,4 @@
using Hcs.Service.Async.HouseManagement; namespace Hcs.Client.Api.Registry
namespace Hcs.Client.Api.Registry
{ {
/// <summary> /// <summary>
/// НСИ "Часовые зоны по Olson" (реестровый номер 32). /// НСИ "Часовые зоны по Olson" (реестровый номер 32).
@ -11,10 +9,8 @@ namespace Hcs.Client.Api.Registry
/// <summary> /// <summary>
/// Иркутск /// Иркутск
/// </summary> /// </summary>
public static nsiRef Element11 => new() public static RegistryElement Element11 => new(
{ "11",
Code = "11", "244ae392-0b96-46f2-80ea-4dac32e7326a");
GUID = "244ae392-0b96-46f2-80ea-4dac32e7326a"
};
} }
} }

View File

@ -1,6 +1,4 @@
using Hcs.Service.Async.HouseManagement; namespace Hcs.Client.Api.Registry
namespace Hcs.Client.Api.Registry
{ {
/// <summary> /// <summary>
/// НСИ "Стадия жизненного цикла" (реестровый номер 338). /// НСИ "Стадия жизненного цикла" (реестровый номер 338).
@ -11,64 +9,50 @@ namespace Hcs.Client.Api.Registry
/// <summary> /// <summary>
/// Эксплуатация /// Эксплуатация
/// </summary> /// </summary>
public static nsiRef Element1 => new() public static RegistryElement Element1 => new(
{ "1",
Code = "1", "29b18683-5195-4ef4-83fc-71bf45597d46");
GUID = "29b18683-5195-4ef4-83fc-71bf45597d46"
};
/// <summary> /// <summary>
/// Реконструкция /// Реконструкция
/// </summary> /// </summary>
public static nsiRef Element2 => new() public static RegistryElement Element2 => new(
{ "2",
Code = "2", "75764145-f181-47e5-bff1-1306a46eb20e");
GUID = "75764145-f181-47e5-bff1-1306a46eb20e"
};
/// <summary> /// <summary>
/// Капитальный ремонт с отселением /// Капитальный ремонт с отселением
/// </summary> /// </summary>
public static nsiRef Element3 => new() public static RegistryElement Element3 => new(
{ "3",
Code = "3", "dee170df-db42-4cd6-9e5e-b62be91b3663");
GUID = "dee170df-db42-4cd6-9e5e-b62be91b3663"
};
/// <summary> /// <summary>
/// Капитальный ремонт без отселения /// Капитальный ремонт без отселения
/// </summary> /// </summary>
public static nsiRef Element4 => new() public static RegistryElement Element4 => new(
{ "4",
Code = "4", "91dc91e2-6883-4c84-b711-53f57f28dbe2");
GUID = "91dc91e2-6883-4c84-b711-53f57f28dbe2"
};
/// <summary> /// <summary>
/// Снос /// Снос
/// </summary> /// </summary>
public static nsiRef Element5 => new() public static RegistryElement Element5 => new(
{ "5",
Code = "5", "cc358aa9-10b3-4d6a-bbec-c5f6b14950f6");
GUID = "cc358aa9-10b3-4d6a-bbec-c5f6b14950f6"
};
/// <summary> /// <summary>
/// Не эксплуатируется, расселен /// Не эксплуатируется, расселен
/// </summary> /// </summary>
public static nsiRef Element6 => new() public static RegistryElement Element6 => new(
{ "6",
Code = "6", "4bed3d7e-6015-428e-b4b4-7b7aec171c0d");
GUID = "4bed3d7e-6015-428e-b4b4-7b7aec171c0d"
};
/// <summary> /// <summary>
/// Выведен из эксплуатации /// Выведен из эксплуатации
/// </summary> /// </summary>
public static nsiRef Element7 => new() public static RegistryElement Element7 => new(
{ "7",
Code = "7", "f3edc065-c1a1-4110-96fa-03313ae7a039");
GUID = "f3edc065-c1a1-4110-96fa-03313ae7a039"
};
} }
} }

View File

@ -1,6 +1,4 @@
using Hcs.Service.Async.HouseManagement; namespace Hcs.Client.Api.Registry
namespace Hcs.Client.Api.Registry
{ {
/// <summary> /// <summary>
/// НСИ "Основание заключения договора" (реестровый номер 58). /// НСИ "Основание заключения договора" (реестровый номер 58).
@ -11,91 +9,71 @@ namespace Hcs.Client.Api.Registry
/// <summary> /// <summary>
/// Решение собрания собственников /// Решение собрания собственников
/// </summary> /// </summary>
public static nsiRef Element1 => new() public static RegistryElement Element1 => new(
{ "1",
Code = "1", "110d48b2-32a9-4a44-939c-b784d9794621");
GUID = "110d48b2-32a9-4a44-939c-b784d9794621"
};
/// <summary> /// <summary>
/// Открытый конкурс /// Открытый конкурс
/// </summary> /// </summary>
public static nsiRef Element2 => new() public static RegistryElement Element2 => new(
{ "2",
Code = "2", "a9dc59c3-d53f-42eb-ba98-cf8c74d88d36");
GUID = "a9dc59c3-d53f-42eb-ba98-cf8c74d88d36"
};
/// <summary> /// <summary>
/// Договор управления /// Договор управления
/// </summary> /// </summary>
public static nsiRef Element3 => new() public static RegistryElement Element3 => new(
{ "3",
Code = "3", "11efe618-79f8-4f53-bfd6-11620e8e9e1e");
GUID = "11efe618-79f8-4f53-bfd6-11620e8e9e1e"
};
/// <summary> /// <summary>
/// Устав /// Устав
/// </summary> /// </summary>
public static nsiRef Element4 => new() public static RegistryElement Element4 => new(
{ "4",
Code = "4", "a2eb920c-8163-4958-812a-ad153a5dfde6");
GUID = "a2eb920c-8163-4958-812a-ad153a5dfde6"
};
/// <summary> /// <summary>
/// Решение правления /// Решение правления
/// </summary> /// </summary>
public static nsiRef Element5 => new() public static RegistryElement Element5 => new(
{ "5",
Code = "5", "58639715-2708-4b8e-a5e6-7cae4ddbf03b");
GUID = "58639715-2708-4b8e-a5e6-7cae4ddbf03b"
};
/// <summary> /// <summary>
/// Решение органа управления застройщика /// Решение органа управления застройщика
/// </summary> /// </summary>
public static nsiRef Element6 => new() public static RegistryElement Element6 => new(
{ "6",
Code = "6", "9b606ef5-7701-4a12-a837-d81b50939160");
GUID = "9b606ef5-7701-4a12-a837-d81b50939160"
};
/// <summary> /// <summary>
/// Заявление потребителя /// Заявление потребителя
/// </summary> /// </summary>
public static nsiRef Element7 => new() public static RegistryElement Element7 => new(
{ "7",
Code = "7", "93cd9d85-91b8-4bf9-ae48-c5f1e691949f");
GUID = "93cd9d85-91b8-4bf9-ae48-c5f1e691949f"
};
/// <summary> /// <summary>
/// Нормативный правовой акт /// Нормативный правовой акт
/// </summary> /// </summary>
public static nsiRef Element8 => new() public static RegistryElement Element8 => new(
{ "8",
Code = "8", "8b8ee37b-fa79-40cc-b98d-0e51f0c38d03");
GUID = "8b8ee37b-fa79-40cc-b98d-0e51f0c38d03"
};
/// <summary> /// <summary>
/// Разрешение на ввод в эксплуатацию /// Разрешение на ввод в эксплуатацию
/// </summary> /// </summary>
public static nsiRef Element9 => new() public static RegistryElement Element9 => new(
{ "9",
Code = "9", "16331000-d96e-4a33-a6c7-3cb9eacf4927");
GUID = "16331000-d96e-4a33-a6c7-3cb9eacf4927"
};
/// <summary> /// <summary>
/// Устав /// Устав
/// </summary> /// </summary>
public static nsiRef Element10 => new() public static RegistryElement Element10 => new(
{ "10",
Code = "10", "555638ae-a207-46fa-99bd-88bdb297c45a");
GUID = "555638ae-a207-46fa-99bd-88bdb297c45a"
};
} }
} }

View File

@ -0,0 +1,9 @@
namespace Hcs.Client.Api.Registry
{
public class RegistryElement(string code, string guid)
{
public string Code { get; } = code;
public string GUID { get; } = guid;
}
}

View File

@ -70,7 +70,11 @@ namespace Hcs.Client.Api.Request.HouseManagement
PlanDateComptetion = payload.planDateComptetion, PlanDateComptetion = payload.planDateComptetion,
Item = true, Item = true,
ItemElementName = ItemChoiceType13.Owners, ItemElementName = ItemChoiceType13.Owners,
ContractBase = payload.contractBase, ContractBase = new nsiRef()
{
Code = payload.contractBase.Code,
GUID = payload.contractBase.GUID
},
DateDetails = payload.dateDetailsType, DateDetails = payload.dateDetailsType,
ContractAttachment = payload.contractAttachment ContractAttachment = payload.contractAttachment
}; };

View File

@ -58,12 +58,24 @@ namespace Hcs.Client.Api.Request.HouseManagement
{ {
FIASHouseGuid = payload.fiasHouseGuid.ToString(), FIASHouseGuid = payload.fiasHouseGuid.ToString(),
TotalSquare = payload.totalSquare, TotalSquare = payload.totalSquare,
State = payload.state, State = new nsiRef()
LifeCycleStage = payload.lifeCycleStage, {
Code = payload.state.Code,
GUID = payload.state.GUID
},
LifeCycleStage = new nsiRef()
{
Code = payload.lifeCycleStage.Code,
GUID = payload.lifeCycleStage.GUID
},
UsedYear = payload.usedYear, UsedYear = payload.usedYear,
FloorCount = payload.floorCount, FloorCount = payload.floorCount,
OKTMO = payload.oktmo, OKTMO = payload.oktmo,
OlsonTZ = payload.olsonTZ, OlsonTZ = new nsiRef()
{
Code = payload.olsonTZ.Code,
GUID = payload.olsonTZ.GUID
},
CulturalHeritage = payload.culturalHeritage, CulturalHeritage = payload.culturalHeritage,
OGFData = payload.ogfData, OGFData = payload.ogfData,
// TODO: Разобраться с кадастровым номером // TODO: Разобраться с кадастровым номером

View File

@ -83,6 +83,7 @@
<Compile Include="Client\Api\Registry\Registry32.cs" /> <Compile Include="Client\Api\Registry\Registry32.cs" />
<Compile Include="Client\Api\Registry\Registry338.cs" /> <Compile Include="Client\Api\Registry\Registry338.cs" />
<Compile Include="Client\Api\Registry\Registry58.cs" /> <Compile Include="Client\Api\Registry\Registry58.cs" />
<Compile Include="Client\Api\Registry\RegistryElement.cs" />
<Compile Include="Client\Api\Request\Adapter\IGetStateResult.cs" /> <Compile Include="Client\Api\Request\Adapter\IGetStateResult.cs" />
<Compile Include="Client\Api\Request\Adapter\IGetStateResultMany.cs" /> <Compile Include="Client\Api\Request\Adapter\IGetStateResultMany.cs" />
<Compile Include="Client\Api\Request\Adapter\IGetStateResultOne.cs" /> <Compile Include="Client\Api\Request\Adapter\IGetStateResultOne.cs" />

View File

@ -27,7 +27,6 @@ namespace Hcs.TestApp.Scenario
}, },
DateValue = new DateTime(2025, 9, 25), DateValue = new DateTime(2025, 9, 25),
TransportGUID = Guid.NewGuid().ToString(), TransportGUID = Guid.NewGuid().ToString(),
// TODO: Переделать работу с НСИ
MunicipalResource = new nsiRef() MunicipalResource = new nsiRef()
{ {
Code = Registry239.Element4.Code, Code = Registry239.Element4.Code,
@ -39,7 +38,6 @@ namespace Hcs.TestApp.Scenario
{ {
DateValue = new DateTime(2025, 9, 25), DateValue = new DateTime(2025, 9, 25),
TransportGUID = Guid.NewGuid().ToString(), TransportGUID = Guid.NewGuid().ToString(),
// TODO: Переделать работу с НСИ
MunicipalResource = new nsiRef() MunicipalResource = new nsiRef()
{ {
Code = Registry239.Element4.Code, Code = Registry239.Element4.Code,

View File

@ -197,7 +197,11 @@ namespace Hcs.TestApp.Scenario
RemoteMeteringMode = false, RemoteMeteringMode = false,
FirstVerificationDate = new DateTime(2021, 1, 1), FirstVerificationDate = new DateTime(2021, 1, 1),
FirstVerificationDateSpecified = true, FirstVerificationDateSpecified = true,
VerificationInterval = Registry16.Element4, VerificationInterval = new nsiRef()
{
Code = Registry16.Element4.Code,
GUID = Registry16.Element4.GUID
},
FactorySealDate = new DateTime(2021, 1, 1), FactorySealDate = new DateTime(2021, 1, 1),
FactorySealDateSpecified = true, FactorySealDateSpecified = true,
TemperatureSensor = false, TemperatureSensor = false,
@ -211,7 +215,11 @@ namespace Hcs.TestApp.Scenario
Item = true, Item = true,
Items = [new MunicipalResourceNotElectricBaseType() Items = [new MunicipalResourceNotElectricBaseType()
{ {
MunicipalResource = Registry239.Element4, MunicipalResource = new nsiRef()
{
Code = Registry239.Element4.Code,
GUID = Registry239.Element4.GUID
},
MeteringValue = "0" MeteringValue = "0"
}] }]
}).Result; }).Result;
@ -270,8 +278,16 @@ namespace Hcs.TestApp.Scenario
contractSubject = [new SupplyResourceContractTypeContractSubject() contractSubject = [new SupplyResourceContractTypeContractSubject()
{ {
TransportGUID = contractSubjectGuid, TransportGUID = contractSubjectGuid,
ServiceType = Registry3.Element6, ServiceType = new ContractSubjectTypeServiceType()
MunicipalResource = Registry239.Element4, {
Code = Registry3.Element6.Code,
GUID = Registry3.Element6.GUID
},
MunicipalResource = new ContractSubjectTypeMunicipalResource()
{
Code = Registry239.Element4.Code,
GUID = Registry239.Element4.GUID
},
StartSupplyDate = effectiveDate, StartSupplyDate = effectiveDate,
EndSupplyDate = comptetionDate, EndSupplyDate = comptetionDate,
EndSupplyDateSpecified = true EndSupplyDateSpecified = true
@ -300,7 +316,11 @@ namespace Hcs.TestApp.Scenario
quality = [new SupplyResourceContractTypeQuality() quality = [new SupplyResourceContractTypeQuality()
{ {
PairKey = contractSubjectGuid, PairKey = contractSubjectGuid,
QualityIndicator = Registry276.Element4, QualityIndicator = new nsiRef()
{
Code = Registry276.Element4.Code,
GUID = Registry276.Element4.GUID
},
IndicatorValue = new SupplyResourceContractTypeQualityIndicatorValue() IndicatorValue = new SupplyResourceContractTypeQualityIndicatorValue()
{ {
Items = [9.76m, 10m, "214"], Items = [9.76m, 10m, "214"],
@ -309,7 +329,11 @@ namespace Hcs.TestApp.Scenario
}, new SupplyResourceContractTypeQuality() }, new SupplyResourceContractTypeQuality()
{ {
PairKey = contractSubjectGuid, PairKey = contractSubjectGuid,
QualityIndicator = Registry276.Element10, QualityIndicator = new nsiRef()
{
Code = Registry276.Element10.Code,
GUID = Registry276.Element10.GUID
},
IndicatorValue = new SupplyResourceContractTypeQualityIndicatorValue() IndicatorValue = new SupplyResourceContractTypeQualityIndicatorValue()
{ {
Items = [0.05m, 0.3m, "298"], Items = [0.05m, 0.3m, "298"],