Skip to content

Commit

Permalink
Merge branch 'main' into feat-notifications-center-v1
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhavat authored Oct 2, 2024
2 parents ff3130c + 2ad98c2 commit d42fd73
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Energinet.DataHub.WebApi.Clients.MarketParticipant.v1;
using Energinet.DataHub.WebApi.Clients.Wholesale.SettlementReports;
using Energinet.DataHub.WebApi.Clients.Wholesale.SettlementReports.Dto;
using Energinet.DataHub.WebApi.GraphQL.Types.SettlementReports;
Expand All @@ -22,8 +23,13 @@ public partial class Mutation
{
public async Task<bool> RequestSettlementReportAsync(
RequestSettlementReportInput requestSettlementReportInput,
[Service] IMarketParticipantClient_V1 marketPartClient,
[Service] ISettlementReportsClient client)
{
var requestAsActor = Guid.TryParse(requestSettlementReportInput.RequestAsActorId, out var actorNumber)
? await marketPartClient.ActorGetAsync(actorNumber)
: null;

var requestFilter = new SettlementReportRequestFilterDto(
requestSettlementReportInput.GridAreasWithCalculations.ToDictionary(
x => x.GridAreaCode,
Expand All @@ -42,7 +48,7 @@ await client.RequestAsync(
requestSettlementReportInput.IncludeMonthlySums,
requestSettlementReportInput.UseApi,
requestFilter,
requestSettlementReportInput.RequestAsActorId,
requestAsActor?.ActorNumber.Value,
requestSettlementReportInput.RequestAsMarketRole),
default);

Expand Down

0 comments on commit d42fd73

Please sign in to comment.