Add refactored new supply contract import
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
using Hcs.Client;
|
||||
using Hcs.Client.Api.Payload.HouseManagement;
|
||||
using Hcs.Client.Api.Registry;
|
||||
using Hcs.Service.Async.HouseManagement;
|
||||
using System;
|
||||
|
||||
namespace Hcs.TestApp.Scenario
|
||||
@ -30,5 +33,106 @@ namespace Hcs.TestApp.Scenario
|
||||
var result = client.HouseManagement.ExportSupplyResourceContractObjectAddressDataAsync(Guid.Parse("575a7ff9-5473-4ab4-b077-fa80c1f85f0b")).Result;
|
||||
Console.WriteLine("Scenario execution " + (result != null ? "succeeded" : "failed"));
|
||||
}
|
||||
|
||||
internal void ImportSupplyResourceContractData()
|
||||
{
|
||||
var signingDate = new DateTime(2017, 01, 01);
|
||||
var effectiveDate = new DateTime(2017, 01, 01);
|
||||
var comptetionDate = new DateTime(2078, 12, 31);
|
||||
|
||||
var objectAddressGuid = Guid.NewGuid().ToString();
|
||||
var contractSubjectGuid = Guid.NewGuid().ToString();
|
||||
var normGuid = Guid.NewGuid().ToString();
|
||||
|
||||
var payload = new ImportSupplyResourceContractDataPayload()
|
||||
{
|
||||
isContract = false,
|
||||
contractNumber = "239297999",
|
||||
signingDate = signingDate,
|
||||
effectiveDate = effectiveDate,
|
||||
indefiniteTerm = false,
|
||||
automaticRollOverOneYear = true,
|
||||
comptetionDate = comptetionDate,
|
||||
period = new SupplyResourceContractTypePeriod()
|
||||
{
|
||||
Start = new SupplyResourceContractTypePeriodStart()
|
||||
{
|
||||
StartDate = 20,
|
||||
NextMonth = false
|
||||
},
|
||||
End = new SupplyResourceContractTypePeriodEnd()
|
||||
{
|
||||
EndDate = 25,
|
||||
NextMonth = false
|
||||
}
|
||||
},
|
||||
isPlannedVolume = false,
|
||||
contractSubject = [new SupplyResourceContractTypeContractSubject()
|
||||
{
|
||||
TransportGUID = contractSubjectGuid,
|
||||
ServiceType = Registry3.Element6,
|
||||
MunicipalResource = Registry239.Element4,
|
||||
StartSupplyDate = effectiveDate,
|
||||
EndSupplyDate = comptetionDate
|
||||
}],
|
||||
specifyingQualityIndicators = SupplyResourceContractTypeSpecifyingQualityIndicators.D,
|
||||
objectAddress = [new SupplyResourceContractTypeObjectAddress()
|
||||
{
|
||||
TransportGUID = objectAddressGuid,
|
||||
Pair = [new SupplyResourceContractTypeObjectAddressPair()
|
||||
{
|
||||
PairKey = contractSubjectGuid,
|
||||
StartSupplyDate = effectiveDate,
|
||||
EndSupplyDate = comptetionDate,
|
||||
HeatingSystemType = new SupplyResourceContractTypeObjectAddressPairHeatingSystemType()
|
||||
{
|
||||
OpenOrNot = SupplyResourceContractTypeObjectAddressPairHeatingSystemTypeOpenOrNot.Opened,
|
||||
CentralizedOrNot = SupplyResourceContractTypeObjectAddressPairHeatingSystemTypeCentralizedOrNot.Decentralized
|
||||
}
|
||||
}],
|
||||
FIASHouseGuid = "e606fca9-1ac4-41a1-8478-a9feb6cdfa78"
|
||||
}],
|
||||
quality = [new SupplyResourceContractTypeQuality()
|
||||
{
|
||||
PairKey = contractSubjectGuid,
|
||||
QualityIndicator = Registry276.Element4,
|
||||
IndicatorValue = new SupplyResourceContractTypeQualityIndicatorValue()
|
||||
{
|
||||
Items = [9.76, 10, "214"],
|
||||
ItemsElementName = [ItemsChoiceType10.StartRange, ItemsChoiceType10.EndRange, ItemsChoiceType10.OKEI]
|
||||
}
|
||||
}, new SupplyResourceContractTypeQuality()
|
||||
{
|
||||
PairKey = contractSubjectGuid,
|
||||
QualityIndicator = Registry276.Element10,
|
||||
IndicatorValue = new SupplyResourceContractTypeQualityIndicatorValue()
|
||||
{
|
||||
Items = [0.05, 0.3, "298"],
|
||||
ItemsElementName = [ItemsChoiceType10.StartRange, ItemsChoiceType10.EndRange, ItemsChoiceType10.OKEI]
|
||||
}
|
||||
}],
|
||||
billingDate = new SupplyResourceContractTypeBillingDate()
|
||||
{
|
||||
Date = 1,
|
||||
DateType = SupplyResourceContractTypeBillingDateDateType.N
|
||||
},
|
||||
paymentDate = new SupplyResourceContractTypePaymentDate()
|
||||
{
|
||||
Date = 10,
|
||||
DateType = SupplyResourceContractTypePaymentDateDateType.N
|
||||
},
|
||||
meteringDeviceInformation = true,
|
||||
volumeDepends = false,
|
||||
oneTimePayment = false,
|
||||
norm = [new SupplyResourceContractTypeNorm()
|
||||
{
|
||||
PairKey = contractSubjectGuid,
|
||||
Items = [true],
|
||||
NormGUID = normGuid
|
||||
}]
|
||||
};
|
||||
var result = client.HouseManagement.ImportSupplyResourceContractDataAsync(payload).Result;
|
||||
Console.WriteLine("Scenario execution " + (result != null ? "succeeded" : "failed"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user