Skip to content

Commit

Permalink
Add archived status to legacy request (#400)
Browse files Browse the repository at this point in the history
* add archived status to legacy request

* Optimization

---------

Co-authored-by: Hammerbeck <[email protected]>
  • Loading branch information
Andreass2 and Hammerbeck authored Oct 25, 2024
1 parent a0c6af4 commit f53c711
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public async Task<OneOf<LegacyGetCorrespondencesResponse, Error>> Process(Legacy
{
var purgedStatus = correspondence.GetPurgedStatus();
var owner = resourceOwners.SingleOrDefault(r => r.OrgNumber == correspondence.Sender)?.Party;
Console.WriteLine("dueDateTime: " + correspondence.Published);
correspondenceItems.Add(
new LegacyCorrespondenceItem()
{
Expand All @@ -109,7 +108,8 @@ public async Task<OneOf<LegacyGetCorrespondencesResponse, Error>> Process(Legacy
Published = correspondence.Published,
PurgedStatus = purgedStatus?.Status,
Purged = purgedStatus?.StatusChanged,
DueDate = correspondence.DueDateTime
DueDate = correspondence.DueDateTime,
Archived = correspondence.Statuses?.FirstOrDefault(s => s.Status == CorrespondenceStatus.Archived)?.StatusChanged,
}
);
}
Expand All @@ -127,10 +127,6 @@ public async Task<OneOf<LegacyGetCorrespondencesResponse, Error>> Process(Legacy
return response;
}
}
// Get Authorized Parties
// https://docs.altinn.studio/api/accessmanagement/resourceowneropenapi/#/Authorized%20Parties/post_resourceowner_authorizedparties
// https://github.com/Altinn/altinn-resource-registry/blob/main/src/Altinn.ResourceRegistry/Controllers/ResourceController.cs#L258


// TODO: Get All Resources these parties can access. I do think these resources is included in authorized parties response
// <https://docs.altinn.studio/api/resourceregistry/spec/#/Resource/post_resource_bysubjects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ public class LegacyCorrespondenceItem
public DateTimeOffset? Purged { get; set; }
public int InstanceOwnerPartyId { get; set; }
public DateTimeOffset? DueDate { get; set; }
public DateTimeOffset? Archived { get; set; }
}
}

0 comments on commit f53c711

Please sign in to comment.