Skip to content

Commit

Permalink
Merge pull request #912 from hmrc/BDOG-3170
Browse files Browse the repository at this point in the history
Fix outbound service ordering
  • Loading branch information
colin-lamed committed Jun 28, 2024
2 parents 2065605 + ef6941c commit 8016737
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ class ServiceConfigsService @Inject()(
.map: repo =>
serviceCommissioningConnector
.getLifecycle(service)
.map(status => ServiceRelationship(service, hasRepo = true, status.map(_.lifecycleStatus), repo.endOfLifeDate))
.map: status =>
ServiceRelationship(service, hasRepo = true, status.map(_.lifecycleStatus), repo.endOfLifeDate)
.getOrElse(Future.successful(ServiceRelationship(service, hasRepo = false, lifecycleStatus = None, endOfLifeDate = None)))
.map(_ +: acc)
inbound = srs.inboundServices
.filterNot(_ == serviceName)
.sorted
.map: service =>
ServiceRelationship(service, hasRepo = repos.exists(_.name == service.asString), lifecycleStatus = None, endOfLifeDate = None)
yield
ServiceRelationshipsEnriched(
inbound
inbound.sortBy(_.service)
, outbound.sortBy: a =>
( if a.lifecycleStatus.contains(LifecycleStatus.DecommissionInProgress) then 0 else 1
, a.service.asString.toLowerCase
( !List(LifecycleStatus.Deprecated, LifecycleStatus.DecommissionInProgress).contains(a.lifecycleStatus)
, a.service
)
)

Expand Down

0 comments on commit 8016737

Please sign in to comment.