Skip to content

Commit

Permalink
Merge branch 'main' into feat/use-orchestration-types-for-calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
ManBearTM committed Jan 15, 2025
2 parents 98deec4 + 9f5b9e4 commit 1bd837c
Show file tree
Hide file tree
Showing 34 changed files with 1,109 additions and 319 deletions.
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,27 @@
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": "Launch Electricity Market",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build electricity market",
"program": "${workspaceFolder}/backend/geh-electricity-market/source/electricity-market/ElectricityMarket.WebAPI/bin/Debug/net8.0/ElectricityMarket.WebAPI.dll",
"args": [],
"cwd": "${workspaceFolder}/backend/geh-electricity-market/source/electricity-market/ElectricityMarket.WebAPI",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "https://localhost:6005"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"type": "node",
"name": "vscode-jest-tests",
Expand Down
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
],
"problemMatcher": "$msCompile"
},
{
"label": "build electricity market",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/backend/geh-electricity-market/source/electricity-market/ElectricityMarket.WebAPI/ElectricityMarket.WebAPI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ type CalculationsConnection {
edges: [CalculationsEdge!]
"A flattened list of the nodes."
nodes: [IOrchestrationInstanceOfCalculationInputV1!]
capacitySettlementsUploadUrl: String
}

"An edge in a connection."
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"runtime": "Net80",
"defaultVariables": null,
"documentGenerator": {
"fromDocument": {
"url": "https://localhost:7085/swagger/v1/swagger.json",
"output": "swagger.json",
"newLineBehavior": "Auto"
}
},
"codeGenerators": {
"openApiToCSharpClient": {
"namespace": "Energinet.DataHub.WebApi.Clients.ElectricityMarket.v1",
"className": "{controller}ElectricityMarketClient_V1",
"output": "ElectricityMarketClient.cs",
"generateOptionalParameters": false,
"classStyle": "Poco",
"excludedTypeNames": [ "Stream" ],
"additionalNamespaceUsages": [ "System.IO" ],
"clientBaseClass": null,
"configurationClass": null,
"generateClientClasses": true,
"generateClientInterfaces": true,
"clientBaseInterface": "",
"injectHttpClient": true,
"disposeHttpClient": true,
"protectedMethods": [],
"generateExceptionClasses": true,
"exceptionClass": "ApiException",
"wrapDtoExceptions": true,
"useHttpClientCreationMethod": false,
"httpClientType": "System.Net.Http.HttpClient",
"useHttpRequestMessageCreationMethod": false,
"useBaseUrl": true,
"generateBaseUrlProperty": true,
"generateSyncMethods": false,
"generatePrepareRequestAndProcessResponseAsAsyncMethods": false,
"exposeJsonSerializerSettings": true,
"clientClassAccessModifier": "public",
"typeAccessModifier": "public",
"generateContractsOutput": false,
"contractsNamespace": null,
"contractsOutputFilePath": null,
"parameterDateTimeFormat": "s",
"parameterDateFormat": "yyyy-MM-dd",
"generateUpdateJsonSerializerSettingsMethod": true,
"useRequestAndResponseSerializationSettings": false,
"serializeTypeInformation": false,
"queryNullValue": "",
"operationGenerationMode": "SingleClientFromPathSegments",
"additionalContractNamespaceUsages": [],
"generateJsonMethods": false,
"enforceFlagEnums": false,
"parameterArrayType": "System.Collections.Generic.IEnumerable",
"parameterDictionaryType": "System.Collections.Generic.IDictionary",
"responseArrayType": "System.Collections.Generic.ICollection",
"responseDictionaryType": "System.Collections.Generic.IDictionary",
"wrapResponses": false,
"wrapResponseMethods": [],
"generateResponseClasses": true,
"responseClass": "SwaggerResponse",
"requiredPropertiesMustBeDefined": true,
"dateType": "System.DateTimeOffset",
"jsonConverters": null,
"anyType": "object",
"dateTimeType": "System.DateTimeOffset",
"timeType": "System.TimeSpan",
"timeSpanType": "System.TimeSpan",
"arrayType": "System.Collections.Generic.ICollection",
"arrayInstanceType": "System.Collections.ObjectModel.Collection",
"dictionaryType": "System.Collections.Generic.IDictionary",
"dictionaryInstanceType": "System.Collections.Generic.Dictionary",
"arrayBaseType": "System.Collections.ObjectModel.Collection",
"dictionaryBaseType": "System.Collections.Generic.Dictionary",
"jsonLibrary": "NewtonsoftJson",
"generateDefaultValues": true,
"generateDataAnnotations": true,
"excludedParameterNames": [],
"handleReferences": false,
"generateImmutableArrayProperties": false,
"generateImmutableDictionaryProperties": false,
"jsonSerializerSettingsTransformationMethod": null,
"inlineNamedArrays": false,
"inlineNamedDictionaries": false,
"inlineNamedTuples": true,
"inlineNamedAny": false,
"generateDtoTypes": true,
"generateOptionalPropertiesAsNullable": false,
"generateNullableReferenceTypes": true,
"templateDirectory": null,
"typeNameGeneratorType": null,
"propertyNameGeneratorType": null,
"enumNameGeneratorType": null,
"serviceHost": null,
"serviceSchemes": null,
"newLineBehavior": "Auto"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"openapi": "3.0.1",
"info": {
"title": "electricity-market",
"version": "1.0"
},
"paths": {
"/electricity-market/{meteringPointId}": {
"get": {
"tags": [
"ElectricityMarket"
],
"operationId": "electricity-market",
"parameters": [
{
"name": "meteringPointId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "api-version",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MeteringPointDto"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MeteringPointDto"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MeteringPointDto"
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Instant": {
"type": "object",
"additionalProperties": false
},
"MeteringPointDto": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"identification": {
"type": "string"
},
"meteringPointPeriod": {
"allOf": [
{
"$ref": "#/components/schemas/MeteringPointPeriodDto"
}
]
}
}
},
"MeteringPointPeriodDto": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"validFrom": {
"allOf": [
{
"$ref": "#/components/schemas/Instant"
}
]
},
"validTo": {
"allOf": [
{
"$ref": "#/components/schemas/Instant"
}
]
},
"createdAt": {
"allOf": [
{
"$ref": "#/components/schemas/Instant"
}
]
},
"gridAreaCode": {
"type": "string"
},
"ownenBy": {
"type": "string"
},
"connectionState": {
"type": "string"
},
"type": {
"type": "string"
},
"subType": {
"type": "string"
},
"resolution": {
"type": "string"
},
"unit": {
"type": "string"
},
"productId": {
"type": "string"
},
"scheduledMeterReadingMonth": {
"type": "integer",
"format": "int32"
}
}
}
},
"securitySchemes": {
"Bearer": {
"type": "http",
"description": "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
"scheme": "Bearer"
}
}
},
"security": [
{
"Bearer": [
"Bearer"
]
}
]
}
1 change: 1 addition & 0 deletions apps/dh/api-dh/source/DataHub.WebApi/DataHub.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ limitations under the License.
<Exec WorkingDirectory="$(ProjectDir)" EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_Net80) run Clients/ESettExchange/V1/nswag.json /variables:Configuration=$(Configuration) &amp;&amp; powershell -File default-api-version-param.ps1 Clients/ESettExchange/V1/ESettExchangeClient.cs &amp;&amp; dotnet build" Condition="!Exists('Clients/ESettExchange/V1/swagger.json')" />
<Exec WorkingDirectory="$(ProjectDir)" EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_Net80) run Clients/ImbalancePrices/V1/nswag.json /variables:Configuration=$(Configuration) &amp;&amp; powershell -File default-api-version-param.ps1 Clients/ImbalancePrices/V1/ImbalancePricesClient.cs &amp;&amp; dotnet build" Condition="!Exists('Clients/ImbalancePrices/V1/swagger.json')" />
<Exec WorkingDirectory="$(ProjectDir)" EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_Net80) run Clients/MarketParticipant/V1/nswag.json /variables:Configuration=$(Configuration) &amp;&amp; powershell -File default-api-version-param.ps1 Clients/MarketParticipant/V1/MarketParticipantClient.cs &amp;&amp; dotnet build" Condition="!Exists('Clients/MarketParticipant/V1/swagger.json')" />
<Exec WorkingDirectory="$(ProjectDir)" EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_Net80) run Clients/ElectricityMarket/V1/nswag.json /variables:Configuration=$(Configuration) &amp;&amp; powershell -File default-api-version-param.ps1 Clients/ElectricityMarket/V1/ElectricityMarketClient.cs &amp;&amp; dotnet build" Condition="!Exists('Clients/ElectricityMarket/V1/swagger.json')" />
</Target>

<Target Name="SwaggerGen" AfterTargets="PostBuildEvent">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2020 Energinet DataHub A/S
//
// Licensed under the Apache License, Version 2.0 (the "License2");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Energinet.DataHub.WebApi.GraphQL.Types.Calculation;

[ExtendObjectType("CalculationsConnection")]
public class CalculationsExtension
{
public string? GetCapacitySettlementsUploadUrl(
[Service] IHttpContextAccessor httpContextAccessor,
[Service] LinkGenerator linkGenerator) =>
linkGenerator.GetUriByAction(
httpContextAccessor.HttpContext!,
"ImportCapacitySettlements",
"Dh2Bridge");
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// 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.GraphQL.Resolvers;

namespace Energinet.DataHub.WebApi.GraphQL.Types.Permission;

[ExtendObjectType("FilteredPermissionsConnection")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,12 @@
"search": "Søg på ID",
"new": "Ny beregning",
"scheduledCalculationTooltip": "Det faktiske tidspunkt kan afvige fra det planlagte tidspunkt",
"capacitySettlements": {
"uploadButton": "Upload fil til effektbetaling",
"uploadInProgress": "Upload i gang",
"uploadSuccess": "Fil uploadet",
"uploadError": "Noget gik galt. Filen blev ikke uploadet. Prøv igen"
},
"create": {
"title": "Ny beregning",
"periodWarning": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,12 @@
"search": "Search by ID",
"new": "New calculation",
"scheduledCalculationTooltip": "The actual time may differ from the scheduled time",
"capacitySettlements": {
"uploadButton": "Upload file for capacity settlements",
"uploadInProgress": "Upload in progress",
"uploadSuccess": "File uploaded",
"uploadError": "An error occurred while uploading the file. Please try again"
},
"create": {
"title": "New calculation",
"periodWarning": {
Expand Down
Loading

0 comments on commit 1bd837c

Please sign in to comment.