Energinet-DataHub / ARCHIVED-geh-charges

Apache License 2.0
7 stars 3 forks source link

Bug: ChargeOwner in NotifyBillingMasterData (RSM-031) is incorrect #760

Closed prtandrup closed 3 years ago

prtandrup commented 3 years ago

Current Behavior

Incorrect ChargeOwner value sent to Grid Access Provider in NotifyBillingMasterData (RSM-031) It seems like the inbound ChargeLinkRequest's Sender Id is used as ChargeOwner in the outbound message.

Expected behavior

The ChargeOwner in the outbound NotifyBillingMasterData (RSM-031) is the actual charge owner registered (in storage)

How to reproduce

Do the following via Postman: 1) Submit a new Charge Link for a tax tariff (as DDQ with a Sender ID that different from the ChargeOwner) 2) Do a Peek POST request with no body but with params marketoperator:8100000000030 + bundleid:use a guid 3) Observe that the following xml element holds the wrong owner:

WrongOwner ### Logs Charge Link request: ~~~~ DocId{{$isoTimestamp}} D05 D17 23 8100000000115 DDQ 5790001330552 EZ {{$isoTimestamp}} clId{{$isoTimestamp}} 571313180000000005 2021-09-27T22:00:00Z 5790000432752 D03 EA-001 1 ~~~~ Response: ~~~~ 9ed829ad-e27b-4c27-b715-ffaaa1ce536c D07 D17 23 5790001330552 DDZ 8100000000030 DDM 2021-10-28T13:32:08Z b1a7ef80-088d-4b34-b05b-7b539ad99cae 571313180000000005 2021-09-27T22:00:00Z 8100000000115 D03 EA-001 1 ~~~~ ### Environment Charges-T ### Possible Solution ### Additional context/screenshots
BjarkeMeier commented 3 years ago

@Mech0z, it's on line 38 of source/GreenEnergyHub.Charges/source/GreenEnergyHub.Charges.Domain/AvailableChargeLinksData/AvailableChargeLinksDataFactory.cs, where we pass sender ID instead of charge owner. According to team agreement we must remember to add tests.

prtandrup commented 3 years ago

Verified as fixed in T:

<?xml version="1.0" encoding="utf-8"?>

a3b5d0d7-a3f9-4d5a-a3a0-631ac0031be1 D07 D17 23 5790001330552 DDZ 8100000000030 DDM 2021-10-29T07:09:08Z 163eae02-4844-4992-942c-0f86e8d9b131 571313180000000012 2021-09-27T22:00:00Z **5790000432752** D03 EA-001 1