From 11fba20b60584c45c05f4b8d6f25043be10383bd Mon Sep 17 00:00:00 2001 From: Vitalie Belinschi Date: Fri, 20 Sep 2024 11:04:30 +0200 Subject: [PATCH] show GLN number for energy suppliers and grid access providers --- .../SettlementReportFileRequestHandler.cs | 6 +++++- .../SettlementReportFileRequestHandlerTests.cs | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/settlement-report/SettlementReports.Application/SettlementReports_v2/SettlementReportFileRequestHandler.cs b/source/settlement-report/SettlementReports.Application/SettlementReports_v2/SettlementReportFileRequestHandler.cs index 22683f3..7b12028 100644 --- a/source/settlement-report/SettlementReports.Application/SettlementReports_v2/SettlementReportFileRequestHandler.cs +++ b/source/settlement-report/SettlementReports.Application/SettlementReports_v2/SettlementReportFileRequestHandler.cs @@ -73,10 +73,14 @@ private static string GenerateFilename(SettlementReportFileRequestDto fileReques { filename += $"_{actorInfo.ChargeOwnerId}"; } + else if (actorInfo.MarketRole == MarketRole.EnergySupplier && !string.IsNullOrWhiteSpace(fileRequest.RequestFilter.EnergySupplier)) + { + filename += $"_{fileRequest.RequestFilter.EnergySupplier}"; + } if (!string.IsNullOrWhiteSpace(fileRequest.RequestFilter.EnergySupplier)) { - filename += $"_{fileRequest.RequestFilter.EnergySupplier}_DDQ"; + filename += $"_DDQ"; } else { diff --git a/source/settlement-report/SettlementReports.UnitTests/Application/SettlementReports_v2/SettlementReportFileRequestHandlerTests.cs b/source/settlement-report/SettlementReports.UnitTests/Application/SettlementReports_v2/SettlementReportFileRequestHandlerTests.cs index 6b25f4f..56ed7a3 100644 --- a/source/settlement-report/SettlementReports.UnitTests/Application/SettlementReports_v2/SettlementReportFileRequestHandlerTests.cs +++ b/source/settlement-report/SettlementReports.UnitTests/Application/SettlementReports_v2/SettlementReportFileRequestHandlerTests.cs @@ -64,7 +64,7 @@ public async Task RequestFile_EnergySupplier_ShouldAppearInFilename() settlementReportFileRepository.Object); // Act - var resultGeneratedSettlementReportFile = await sut.RequestFileAsync(fileRequest, new SettlementReportRequestedByActor(MarketRole.DataHubAdministrator, null)); + var resultGeneratedSettlementReportFile = await sut.RequestFileAsync(fileRequest, new SettlementReportRequestedByActor(MarketRole.EnergySupplier, null)); var resultedFileName = resultGeneratedSettlementReportFile.FileInfo.FileName; // Assert @@ -112,7 +112,7 @@ public async Task RequestFile_NoEnergySupplier_ShouldNotAppearInFilename(string? settlementReportFileRepository.Object); // Act - var resultGeneratedSettlementReportFile = await sut.RequestFileAsync(fileRequest, new SettlementReportRequestedByActor(MarketRole.SystemOperator, null)); + var resultGeneratedSettlementReportFile = await sut.RequestFileAsync(fileRequest, new SettlementReportRequestedByActor(MarketRole.EnergySupplier, null)); var resultedFileName = resultGeneratedSettlementReportFile.FileInfo.FileName; // Assert