diff --git a/src/Altinn.App.Api/Controllers/InstancesController.cs b/src/Altinn.App.Api/Controllers/InstancesController.cs index ee9eb882a..b2ab1c337 100644 --- a/src/Altinn.App.Api/Controllers/InstancesController.cs +++ b/src/Altinn.App.Api/Controllers/InstancesController.cs @@ -438,7 +438,7 @@ await instance.WithOnlyAccessibleDataElements(_dataElementAccessChecker), /// /// unique identifier of the organisation responsible for the app /// application identifier which is unique within an organisation - /// instansiation information + /// instansiation information /// The currently active user language /// The new instance [HttpPost("create")] @@ -450,7 +450,7 @@ await instance.WithOnlyAccessibleDataElements(_dataElementAccessChecker), public async Task> PostSimplified( [FromRoute] string org, [FromRoute] string app, - [FromBody] InstansiationInstance instansiationInstance, + [FromBody] InstantiationInstance InstantiationInstance, [FromQuery] string? language = null ) { @@ -464,7 +464,7 @@ public async Task> PostSimplified( return BadRequest("The path parameter 'app' cannot be empty"); } - bool isCopyRequest = !string.IsNullOrEmpty(instansiationInstance.SourceInstanceId); + bool isCopyRequest = !string.IsNullOrEmpty(InstantiationInstance.SourceInstanceId); ApplicationMetadata application = await _appMetadata.GetApplicationMetadata(); if (VerifyInstantiationPermissions(application, org, app, isCopy: isCopyRequest) is { } verificationResult) @@ -479,7 +479,7 @@ public async Task> PostSimplified( ); } - InstanceOwner lookup = instansiationInstance.InstanceOwner; + InstanceOwner lookup = InstantiationInstance.InstanceOwner; if ( lookup == null @@ -494,8 +494,8 @@ public async Task> PostSimplified( Party party; try { - party = await LookupParty(instansiationInstance.InstanceOwner) ?? throw new Exception("Unknown party"); - instansiationInstance.InstanceOwner = InstantiationHelper.PartyToInstanceOwner(party); + party = await LookupParty(InstantiationInstance.InstanceOwner) ?? throw new Exception("Unknown party"); + InstantiationInstance.InstanceOwner = InstantiationHelper.PartyToInstanceOwner(party); } catch (Exception partyLookupException) { @@ -513,7 +513,7 @@ public async Task> PostSimplified( if ( isCopyRequest && party.PartyId.ToString(CultureInfo.InvariantCulture) - != instansiationInstance.SourceInstanceId.Split("/")[0] + != InstantiationInstance.SourceInstanceId.Split("/")[0] ) { return BadRequest("It is not possible to copy instances between instance owners."); @@ -536,9 +536,9 @@ public async Task> PostSimplified( Instance instanceTemplate = new() { - InstanceOwner = instansiationInstance.InstanceOwner, - VisibleAfter = instansiationInstance.VisibleAfter, - DueBefore = instansiationInstance.DueBefore, + InstanceOwner = InstantiationInstance.InstanceOwner, + VisibleAfter = InstantiationInstance.VisibleAfter, + DueBefore = InstantiationInstance.DueBefore, Org = application.Org, }; @@ -564,7 +564,7 @@ public async Task> PostSimplified( { Instance = instanceTemplate, User = User, - Prefill = instansiationInstance.Prefill, + Prefill = InstantiationInstance.Prefill, }; processResult = await _processEngine.GenerateProcessStartEvents(request); @@ -573,7 +573,7 @@ public async Task> PostSimplified( if (isCopyRequest) { - string[] sourceSplit = instansiationInstance.SourceInstanceId.Split("/"); + string[] sourceSplit = InstantiationInstance.SourceInstanceId.Split("/"); Guid sourceInstanceGuid = Guid.Parse(sourceSplit[1]); try @@ -604,7 +604,7 @@ public async Task> PostSimplified( instance = await _instanceClient.GetInstance(instance); await _processEngine.HandleEventsAndUpdateStorage( instance, - instansiationInstance.Prefill, + InstantiationInstance.Prefill, processResult.ProcessStateChange?.Events ); } diff --git a/src/Altinn.App.Api/Models/InstansiationInstance.cs b/src/Altinn.App.Api/Models/InstansiationInstance.cs index 12ff981fa..b7b8abd83 100644 --- a/src/Altinn.App.Api/Models/InstansiationInstance.cs +++ b/src/Altinn.App.Api/Models/InstansiationInstance.cs @@ -7,7 +7,7 @@ namespace Altinn.App.Api.Models; /// /// Specialized model for instansiation of instances /// -public class InstansiationInstance +public class InstantiationInstance { /// /// Gets or sets the instance owner information. diff --git a/test/Altinn.App.Api.Tests/OpenApi/OpenApiSpecChangeDetection.SaveJsonSwagger.verified.json b/test/Altinn.App.Api.Tests/OpenApi/OpenApiSpecChangeDetection.SaveJsonSwagger.verified.json index e5c3e528c..9d8178c43 100644 --- a/test/Altinn.App.Api.Tests/OpenApi/OpenApiSpecChangeDetection.SaveJsonSwagger.verified.json +++ b/test/Altinn.App.Api.Tests/OpenApi/OpenApiSpecChangeDetection.SaveJsonSwagger.verified.json @@ -2702,17 +2702,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InstansiationInstance" + "$ref": "#/components/schemas/InstantiationInstance" } }, "text/json": { "schema": { - "$ref": "#/components/schemas/InstansiationInstance" + "$ref": "#/components/schemas/InstantiationInstance" } }, "application/*+json": { "schema": { - "$ref": "#/components/schemas/InstansiationInstance" + "$ref": "#/components/schemas/InstantiationInstance" } } } @@ -8334,7 +8334,7 @@ }, "additionalProperties": false }, - "InstansiationInstance": { + "InstantiationInstance": { "type": "object", "properties": { "instanceOwner": { diff --git a/test/Altinn.App.Api.Tests/PublicApiTests.PublicApi_ShouldNotChange_Unintentionally.verified.txt b/test/Altinn.App.Api.Tests/PublicApiTests.PublicApi_ShouldNotChange_Unintentionally.verified.txt index 6c4a1a9a0..8f4436ad7 100644 --- a/test/Altinn.App.Api.Tests/PublicApiTests.PublicApi_ShouldNotChange_Unintentionally.verified.txt +++ b/test/Altinn.App.Api.Tests/PublicApiTests.PublicApi_ShouldNotChange_Unintentionally.verified.txt @@ -327,7 +327,7 @@ namespace Altinn.App.Api.Controllers [Microsoft.AspNetCore.Mvc.ProducesResponseType(400)] [Microsoft.AspNetCore.Mvc.ProducesResponseType(typeof(Altinn.App.Api.Models.InstanceResponse), 201)] [Microsoft.AspNetCore.Mvc.RequestSizeLimit(2097152000)] - public System.Threading.Tasks.Task> PostSimplified([Microsoft.AspNetCore.Mvc.FromRoute] string org, [Microsoft.AspNetCore.Mvc.FromRoute] string app, [Microsoft.AspNetCore.Mvc.FromBody] Altinn.App.Api.Models.InstansiationInstance instansiationInstance, [Microsoft.AspNetCore.Mvc.FromQuery] string? language = null) { } + public System.Threading.Tasks.Task> PostSimplified([Microsoft.AspNetCore.Mvc.FromRoute] string org, [Microsoft.AspNetCore.Mvc.FromRoute] string app, [Microsoft.AspNetCore.Mvc.FromBody] Altinn.App.Api.Models.InstantiationInstance InstantiationInstance, [Microsoft.AspNetCore.Mvc.FromQuery] string? language = null) { } [Microsoft.AspNetCore.Authorization.Authorize] [Microsoft.AspNetCore.Mvc.HttpPut("{instanceOwnerPartyId:int}/{instanceGuid:guid}/substatus")] [Microsoft.AspNetCore.Mvc.Produces("application/json", new string[0])] @@ -1028,9 +1028,9 @@ namespace Altinn.App.Api.Models public required System.DateTime? VisibleAfter { get; init; } public override string ToString() { } } - public class InstansiationInstance + public class InstantiationInstance { - public InstansiationInstance() { } + public InstantiationInstance() { } public System.DateTime? DueBefore { get; set; } public Altinn.Platform.Storage.Interface.Models.InstanceOwner InstanceOwner { get; set; } public System.Collections.Generic.Dictionary Prefill { get; set; } diff --git a/test/Altinn.App.Integration.Tests/Basic/BasicAppTests.cs b/test/Altinn.App.Integration.Tests/Basic/BasicAppTests.cs index 0322bb36f..598b3d154 100644 --- a/test/Altinn.App.Integration.Tests/Basic/BasicAppTests.cs +++ b/test/Altinn.App.Integration.Tests/Basic/BasicAppTests.cs @@ -99,11 +99,11 @@ TestCase testCase { TestCase.SimplifiedNoPrefill => await fixture.Instances.PostSimplified( token, - new InstansiationInstance { InstanceOwner = new InstanceOwner { PartyId = "501337" } } + new InstantiationInstance { InstanceOwner = new InstanceOwner { PartyId = "501337" } } ), TestCase.SimplifiedWithPrefill => await fixture.Instances.PostSimplified( token, - new InstansiationInstance + new InstantiationInstance { InstanceOwner = new InstanceOwner { PartyId = "501337" }, Prefill = new() { { "property1", "1" }, { "property2", "1" } }, diff --git a/test/Altinn.App.Integration.Tests/PartyTypesAllowed/SubunitOnlyAppTests.cs b/test/Altinn.App.Integration.Tests/PartyTypesAllowed/SubunitOnlyAppTests.cs index b2f20d1ab..151d24f44 100644 --- a/test/Altinn.App.Integration.Tests/PartyTypesAllowed/SubunitOnlyAppTests.cs +++ b/test/Altinn.App.Integration.Tests/PartyTypesAllowed/SubunitOnlyAppTests.cs @@ -23,7 +23,7 @@ public async Task Instantiate(string partyId) using var response = await fixture.Instances.PostSimplified( token, - new InstansiationInstance { InstanceOwner = new InstanceOwner { PartyId = partyId } } + new InstantiationInstance { InstanceOwner = new InstanceOwner { PartyId = partyId } } ); using var data = await response.Read(); diff --git a/test/Altinn.App.Integration.Tests/README.md b/test/Altinn.App.Integration.Tests/README.md index a1eb44b28..a1e331e96 100644 --- a/test/Altinn.App.Integration.Tests/README.md +++ b/test/Altinn.App.Integration.Tests/README.md @@ -50,7 +50,7 @@ public class MyIntegrationTests(ITestOutputHelper output) : IAsyncLifetime using var response = await fixture.Instances.PostSimplified( token, - new InstansiationInstance { InstanceOwner = new InstanceOwner { PartyId = "501337" } } + new InstantiationInstance { InstanceOwner = new InstanceOwner { PartyId = "501337" } } ); var readResponse = await response.Read(); @@ -147,7 +147,7 @@ The `ApiResponse` pattern provides structured HTTP response handling: ```csharp using var response = await fixture.Instances.PostSimplified( token, - new InstansiationInstance { InstanceOwner = new InstanceOwner { PartyId = "501337" } } + new InstantiationInstance { InstanceOwner = new InstanceOwner { PartyId = "501337" } } ); // Read typed response data diff --git a/test/Altinn.App.Integration.Tests/_fixture/Operations/AppFixture.Instances.cs b/test/Altinn.App.Integration.Tests/_fixture/Operations/AppFixture.Instances.cs index 542f17091..319644ece 100644 --- a/test/Altinn.App.Integration.Tests/_fixture/Operations/AppFixture.Instances.cs +++ b/test/Altinn.App.Integration.Tests/_fixture/Operations/AppFixture.Instances.cs @@ -24,7 +24,7 @@ internal sealed class InstancesOperations(AppFixture fixture) { private readonly AppFixture _fixture = fixture; - public async Task PostSimplified(string token, InstansiationInstance instansiation) + public async Task PostSimplified(string token, InstantiationInstance instansiation) { var client = _fixture.GetAppClient(); var endpoint = $"/ttd/{_fixture._app}/instances/create";