Skip to content

Commit

Permalink
PIN-4279 Added filteredTenants
Browse files Browse the repository at this point in the history
  • Loading branch information
nttdata-rtorsoli committed Mar 22, 2024
1 parent 34a6444 commit acbba9e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ object Utils {
attributesIndex: Map[UUID, AttributeInfo]
): TenantActions = {

val filteredTenant: List[PersistentTenant] = tenants.filter(_.selfcareId.isDefined)

val originsFromPartyRegistry: List[String] = institutions.map(_.origin).distinct

val filteredAttributesIndex: Map[UUID, AttributeInfo] =
attributesIndex.filter(a => originsFromPartyRegistry.contains(a._2.origin))

val tenantsMap: Map[PersistentExternalId, String] = tenants.map(t => (t.externalId, t.name)).toMap
val tenantsMap: Map[PersistentExternalId, String] = filteredTenant.map(t => (t.externalId, t.name)).toMap

val fromRegistry: List[TenantSeed] = institutions
.filter(institution => institution.id.nonEmpty)
Expand All @@ -82,7 +84,7 @@ object Utils {
.map(prepareTenantSeedForUpdate)

val fromTenant: Map[PersistentExternalId, List[AttributeInfo]] =
tenants
filteredTenant
.map(tenant =>
tenant.externalId -> tenant.attributes.flatMap(AttributeInfo.addRevocationTimeStamp(filteredAttributesIndex))
)
Expand Down

0 comments on commit acbba9e

Please sign in to comment.