Skip to content

Commit

Permalink
Fikset bug der kollektiv skiftefullmakt ble satt feil
Browse files Browse the repository at this point in the history
  • Loading branch information
larsolavk committed Nov 21, 2024
1 parent a62ef35 commit 7b14db2
Show file tree
Hide file tree
Showing 4 changed files with 257 additions and 206 deletions.
17 changes: 9 additions & 8 deletions src/oed-authz/Services/ProxyManagementService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ private static List<string> GetEligibleCollectiveProxyRecipients(
var heirsWithProbateRoles = heirRoleAssignments
.Select(x => x.RecipientSsn)
.Distinct()
.ToList();
.ToArray();

var eligibleCollectiveProxyRecipients = individualProxyRoleAssignments
.GroupBy(x => x.RecipientSsn)
.Where(x => x.Count() == heirsWithProbateRoles.Count)
.Where(x => x.Count() == heirsWithProbateRoles.Length)
.Select(x => x.Key)
.ToList();

Expand All @@ -193,16 +193,17 @@ private static List<string> GetEligibleCollectiveProxyRecipients(
{
var otherHeirsWithProbateRoles = heirsWithProbateRoles
.Where(x => x != heirWithProbateRole)
.ToList();
.ToArray();

var otherHeirsWithProbateRolesThatHaveGivenProxyRoleToHeir = individualProxyRoleAssignments
.Where(x => otherHeirsWithProbateRoles
.Contains(x.RecipientSsn))
.Select(x => x.RecipientSsn)
.Where(x =>
x.RecipientSsn == heirWithProbateRole
&& otherHeirsWithProbateRoles.Contains(x.HeirSsn!))
.Select(x => x.HeirSsn)
.Distinct()
.ToList();
.ToArray();

if (otherHeirsWithProbateRolesThatHaveGivenProxyRoleToHeir.Count == otherHeirsWithProbateRoles.Count)
if (otherHeirsWithProbateRolesThatHaveGivenProxyRoleToHeir.Length == otherHeirsWithProbateRoles.Length)
{
eligibleCollectiveProxyRecipients.Add(heirWithProbateRole);
}
Expand Down
187 changes: 0 additions & 187 deletions test/oed-authz.UnitTests/Services/ProxyManagementServiceTests.cs

This file was deleted.

Loading

0 comments on commit 7b14db2

Please sign in to comment.