Skip to content

Commit

Permalink
Merge branch 'main' into feat/392-data-element-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorntore committed Sep 10, 2024
2 parents da21f21 + 7a50cca commit 0ea4599
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Services/Storage/Implementation/DataRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public async Task<List<DataElement>> ReadAll(Guid instanceGuid)
dataElements.Add(instance);
}
}
return dataElements;
return dataElements.OrderBy(x => x.Created).ToList();
}

public async Task<Stream> ReadDataFromStorage(string org, string blobStoragePath)
Expand Down
12 changes: 8 additions & 4 deletions src/Services/Storage/Implementation/InstanceRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public async Task<Instance> GetOne(int instanceOwnerPartyId, Guid instanceGuid)
return null;
}

public Task<InstanceQueryResponse> GetInstancesFromQuery(Dictionary<string, StringValues> queryParams, string continuationToken, int size)
public async Task<InstanceQueryResponse> GetInstancesFromQuery(Dictionary<string, StringValues> queryParams, string continuationToken, int size)
{
List<string> validQueryParams = new List<string>
{
Expand Down Expand Up @@ -199,16 +199,20 @@ public Task<InstanceQueryResponse> GetInstancesFromQuery(Dictionary<string, Stri
{
RemoveForDateTime(instances, $"{nameof(Instance.Process)}.{nameof(Instance.Process.Ended)}", queryParams.GetValueOrDefault("process.ended"));
}
if (queryParams.ContainsKey("process.currentTask"))
{
instances.RemoveAll(i => !queryParams["process.currentTask"].Contains(i.Process.CurrentTask?.ElementId));
}

instances.RemoveAll(i => i.Status.IsHardDeleted == true);

instances.ForEach(async i => await PostProcess(i));
await Task.WhenAll(instances.Select(async i => await PostProcess(i)));

return Task.FromResult(new InstanceQueryResponse
return new InstanceQueryResponse
{
Instances = instances,
Count = instances.Count,
});
};
}

public async Task<Instance> Update(Instance instance)
Expand Down
12 changes: 12 additions & 0 deletions testdata/Profile/User/1004.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"UserId": 1004,
"UserName": "SelvRegistrert",
"PhoneNumber": null,
"Email": "[email protected]",
"PartyId": 510004,
"Party": {},
"UserType": 2,
"ProfileSettingPreference": {
"Language": "nb"
}
}
13 changes: 13 additions & 0 deletions testdata/Register/Party/510004.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"partyId": "510004",
"partyTypeName": 3,
"orgNumber": null,
"ssn": null,
"unitType": null,
"name": "Selvregistrert Bruker",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
}
13 changes: 13 additions & 0 deletions testdata/authorization/partylist/1004.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"partyId": "510004",
"partyTypeName": 3,
"ssn": null,
"name": "Selvregistrert Bruker",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"Type": "altinn",
"value": "seln"
}
]

0 comments on commit 0ea4599

Please sign in to comment.