Skip to content

Commit

Permalink
feat: settlement report - include previous grid owners take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmajgaard committed Dec 13, 2024
1 parent 3435da3 commit c00034a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ limitations under the License.
<EmbeddedResource Include="Scripts\202409081607_Add_JobId_To_SettlementReport.sql" />
<EmbeddedResource Include="Scripts\202410261405_Add_IsNotificationSent_to_SettlementReport.sql" />
<EmbeddedResource Include="Scripts\202412021100_Add_GridAreaOwner.sql" />
<EmbeddedResource Include="Scripts\202412131100_Update_GridAreaOwner_ValidFrom.sql" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if not exists(select 1 from sys.tables where name = 'GridAreaOwnerBak')
begin
select *
into settlementreports.GridAreaOwnerBak
from settlementreports.gridareaowner
end

update settlementreports.gridareaowner
set validfrom = '2020-01-01'
where id in (select g.id
from settlementreports.gridareaowner g
join (select code, min(validfrom) as validfrom
from settlementreports.gridareaowner
group by code) temp
on g.code = temp.code and g.validfrom = temp.validfrom)
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public RequestSettlementReportHandler(

public async Task<JobRunId> HandleAsync(RequestSettlementReportCommand request)
{
if (request.MarketRole == MarketRole.GridAccessProvider)
if (request.MarketRole == MarketRole.GridAccessProvider && request.RequestDto.Filter.GridAreas.Count > 0)
{
JobRunId? firstRunId = null;

Expand Down

0 comments on commit c00034a

Please sign in to comment.