Skip to content

Commit

Permalink
Merge f9194d3 into 25ecb58
Browse files Browse the repository at this point in the history
  • Loading branch information
defectiveAi authored Oct 2, 2024
2 parents 25ecb58 + f9194d3 commit 0270953
Showing 1 changed file with 14 additions and 5 deletions.
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 CsvHelper;
using CsvHelper.Configuration;
using Energinet.DataHub.SettlementReport.Application.SettlementReports_v2;
using Energinet.DataHub.SettlementReport.Common.Interfaces.Models;
Expand Down Expand Up @@ -42,9 +43,14 @@ protected override IAsyncEnumerable<SettlementReportMonthlyAmountRow> GetAsync(S
return _dataSource.GetAsync(filter, actorInfo, skipChunks, takeChunks);
}

public sealed class SettlementReportMonthlyAmountRowMap : ClassMap<SettlementReportMonthlyAmountRow>
protected override void RegisterClassMap(CsvWriter csvHelper, SettlementReportRequestFilterDto filter, SettlementReportRequestedByActor actorInfo)
{
public SettlementReportMonthlyAmountRowMap()
csvHelper.Context.RegisterClassMap(new SettlementReportTotalMonthlyAmountRowMap(actorInfo));
}

public sealed class SettlementReportTotalMonthlyAmountRowMap : ClassMap<SettlementReportMonthlyAmountRow>
{
public SettlementReportTotalMonthlyAmountRowMap(SettlementReportRequestedByActor actorInfo)
{
Map(r => r.EnergyBusinessProcess)
.Name("ENERGYBUSINESSPROCESS")
Expand Down Expand Up @@ -118,9 +124,12 @@ public SettlementReportMonthlyAmountRowMap()
.Name("CHARGEID")
.Index(10);

Map(r => r.ChargeOwnerId)
.Name("CHARGEOWNER")
.Index(11);
if (actorInfo.MarketRole is not MarketRole.SystemOperator)
{
Map(r => r.ChargeOwnerId)
.Name("CHARGEOWNER")
.Index(11);
}
}
}
}

0 comments on commit 0270953

Please sign in to comment.