Energinet-DataHub / ARCHIVED-geh-charges

Apache License 2.0
7 stars 3 forks source link

Data fix: add a `ChargePeriod` to charges without any #1792

Closed prtandrup closed 2 years ago

prtandrup commented 2 years ago

Description

Early on, it was possible to create a new charge and subsequently stop it on the same date it was created. This resulted in the charge not having a charge period in the persistence layer. This is no longer the case, but the data remains.

This PR adds a SQL seed script, which finds all charges without any charge, and adds a charge period.

This data fix is needed in order for Charges Web API to deliver charge data to frontend in B-002.

References

codecov[bot] commented 2 years ago

Codecov Report

Merging #1792 (ccc66f9) into main (ac830fb) will increase coverage by 50.75%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main    #1792       +/-   ##
===========================================
+ Coverage   34.51%   85.27%   +50.75%     
===========================================
  Files          24      514      +490     
  Lines         478     9317     +8839     
  Branches       22       22               
===========================================
+ Hits          165     7945     +7780     
- Misses        298     1223      +925     
- Partials       15      149      +134     
Flag Coverage Δ
business 88.01% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...tionHost/Configuration/HealthCheckConfiguration.cs 100.00% <100.00%> (ø)
...ges.TestCore/Builders/Command/ChargeLinkBuilder.cs 100.00% <0.00%> (ø)
...Handlers/MarketParticipantCreatedCommandHandler.cs 96.15% <0.00%> (ø)
...ailableChargePriceReceiptValidationErrorFactory.cs 0.00% <0.00%> (ø)
...lidation/ValidationRules/ChargeNameRequiredRule.cs 80.00% <0.00%> (ø)
...tionRules/ChargeDescriptionHasMaximumLengthRule.cs 100.00% <0.00%> (ø)
...ptData/AvailableChargeLinksRejectionDataFactory.cs 100.00% <0.00%> (ø)
...tCore/Builders/Command/MarketParticipantBuilder.cs 78.94% <0.00%> (ø)
...n/ChargeInformationCommandReceivedConfiguration.cs 100.00% <0.00%> (ø)
...MustBeUpdateChargeInformationOrChargePricesRule.cs 100.00% <0.00%> (ø)
... and 481 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication