Add notification import

This commit is contained in:
2025-08-28 12:25:22 +09:00
parent d6d27e502c
commit e115440c41
8 changed files with 236 additions and 22 deletions

View File

@ -3,6 +3,7 @@ using Hcs.Client.Api.Payload.HouseManagement;
using Hcs.Client.Api.Registry;
using Hcs.Service.Async.HouseManagement;
using System;
using System.Collections.Generic;
namespace Hcs.TestApp.Scenario
{
@ -42,7 +43,6 @@ namespace Hcs.TestApp.Scenario
var objectAddressGuid = Guid.NewGuid().ToString();
var contractSubjectGuid = Guid.NewGuid().ToString();
var normGuid = Guid.NewGuid().ToString();
var payload = new ImportSupplyResourceContractDataPayload()
{
@ -50,10 +50,6 @@ namespace Hcs.TestApp.Scenario
contractNumber = "239297999",
signingDate = signingDate,
effectiveDate = effectiveDate,
// TODO: Очень странно, что сервис не дает отправить значения
// для indefiniteTerm и automaticRollOverOneYear одновременно,
// хотя в выгружаемом шаблоне они оба заполнены
//indefiniteTerm = false,
automaticRollOverOneYear = true,
comptetionDate = comptetionDate,
// TODO: Не дает выгрузить период
@ -61,18 +57,14 @@ namespace Hcs.TestApp.Scenario
//{
// Start = new SupplyResourceContractTypePeriodStart()
// {
// StartDate = 20,
// // TODO: Ломается если отправить NextMonth = false, если отправить true - то все ОК
// //NextMonth = false,
// //NextMonthSpecified = true
// StartDate = 20
// },
// End = new SupplyResourceContractTypePeriodEnd()
// {
// EndDate = 25,
// //NextMonth = false,
// //NextMonthSpecified = true
// EndDate = 25
// }
//},
counterparty = true,
isPlannedVolume = false,
contractSubject = [new SupplyResourceContractTypeContractSubject()
{
@ -139,11 +131,29 @@ namespace Hcs.TestApp.Scenario
//{
// PairKey = contractSubjectGuid,
// Items = [true],
// NormGUID = normGuid
// NormGUID = ""
//}]
};
var result = client.HouseManagement.ImportSupplyResourceContractDataAsync(payload).Result;
Console.WriteLine("Scenario execution " + (result != null ? "succeeded" : "failed"));
}
internal void ImportNotificationData()
{
var payload = new ImportNotificationDataPayload()
{
topic = "Тема новости",
isImportant = true,
content = "Содержимое новости",
destinations =
[
new(ItemsChoiceType29.IsAll, true)
],
isNotLimit = true,
isShipOff = true
};
var result = client.HouseManagement.ImportNotificationDataAsync(payload).Result;
Console.WriteLine("Scenario execution " + (result ? "succeeded" : "failed"));
}
}
}