Add supply contract project import

This commit is contained in:
2025-09-13 18:39:13 +09:00
parent 7a84965aad
commit 6e65b619f0
7 changed files with 635 additions and 3 deletions

View File

@ -365,5 +365,104 @@ namespace Hcs.TestApp.Scenario
var result = client.HouseManagement.ImportSupplyResourceContractDataAsync(payload).Result;
Console.WriteLine("Scenario execution " + (result != null ? "succeeded" : "failed"));
}
internal void ImportSupplyResourceContractProject()
{
var signingDate = new DateTime(2017, 01, 01);
var effectiveDate = new DateTime(2017, 01, 01);
var comptetionDate = new DateTime(2078, 12, 31);
var contractSubjectGuid = Guid.NewGuid().ToString();
var payload = new ImportSupplyResourceContractProjectPayload()
{
isContract = false,
contractNumber = "88005553535",
signingDate = signingDate,
effectiveDate = effectiveDate,
automaticRollOverOneYear = true,
comptetionDate = comptetionDate,
period = new SupplyResourceContractProjectTypePeriod()
{
Start = new SupplyResourceContractProjectTypePeriodStart()
{
StartDate = 20
},
End = new SupplyResourceContractProjectTypePeriodEnd()
{
EndDate = 25
}
},
counterparty = true,
isPlannedVolume = false,
contractSubject = [new SupplyResourceContractProjectTypeContractSubject()
{
TransportGUID = contractSubjectGuid,
ServiceType = new ContractSubjectTypeServiceType()
{
Code = Registry3.Element6.Code,
GUID = Registry3.Element6.GUID
},
MunicipalResource = new ContractSubjectTypeMunicipalResource()
{
Code = Registry239.Element4.Code,
GUID = Registry239.Element4.GUID
},
StartSupplyDate = effectiveDate,
EndSupplyDate = comptetionDate,
EndSupplyDateSpecified = true
}],
specifyingQualityIndicators = SupplyResourceContractProjectTypeSpecifyingQualityIndicators.D,
quality = [new SupplyResourceContractProjectTypeQuality()
{
PairKey = contractSubjectGuid,
QualityIndicator = new nsiRef()
{
Code = Registry276.Element4.Code,
GUID = Registry276.Element4.GUID
},
IndicatorValue = new SupplyResourceContractProjectTypeQualityIndicatorValue()
{
Items = [9.76m, 10m, "214"],
ItemsElementName = [ItemsChoiceType10.StartRange, ItemsChoiceType10.EndRange, ItemsChoiceType10.OKEI]
}
}, new SupplyResourceContractProjectTypeQuality()
{
PairKey = contractSubjectGuid,
QualityIndicator = new nsiRef()
{
Code = Registry276.Element10.Code,
GUID = Registry276.Element10.GUID
},
IndicatorValue = new SupplyResourceContractProjectTypeQualityIndicatorValue()
{
Items = [0.05m, 0.3m, "298"],
ItemsElementName = [ItemsChoiceType10.StartRange, ItemsChoiceType10.EndRange, ItemsChoiceType10.OKEI]
}
}],
billingDate = new SupplyResourceContractProjectTypeBillingDate()
{
Date = 1,
DateType = SupplyResourceContractProjectTypeBillingDateDateType.N
},
paymentDate = new SupplyResourceContractProjectTypePaymentDate()
{
Date = 10,
DateType = SupplyResourceContractProjectTypePaymentDateDateType.N
},
meteringDeviceInformation = true,
volumeDepends = false,
oneTimePayment = false,
// TODO: Пока не понятно, откуда берется NormGUID
//norm = [new SupplyResourceContractTypeNorm()
//{
// PairKey = contractSubjectGuid,
// Items = [true],
// NormGUID = ""
//}]
};
var result = client.HouseManagement.ImportSupplyResourceContractProjectAsync(payload).Result;
Console.WriteLine("Scenario execution " + (result != null ? "succeeded" : "failed"));
}
}
}