Skip to content

Commit

Permalink
PIN-4488 Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
nttdata-rtorsoli committed Feb 7, 2024
1 parent 2683e00 commit 1193ee0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ object ReadModelCatalogQueries extends ReadModelQuery {
offset: Int,
limit: Int,
exactMatchOnName: Boolean = false,
isSupervisor: Boolean
isSuperVisor: Boolean
)(implicit ec: ExecutionContext, readModel: ReadModelService): Future[PaginatedResult[CatalogItem]] = {

val query =
Expand All @@ -137,7 +137,7 @@ object ReadModelCatalogQueries extends ReadModelQuery {
eServices <- readModel.aggregate[CatalogItem](
"eservices",
Seq(
addFields(Field("isSuperVisor", isSupervisor)),
addFields(Field("isSuperVisor", isSuperVisor)),
`match`(query),
project(fields(include("data"), computed("lowerName", Document("""{ "$toLower" : "$data.name" }""")))),
sort(ascending("lowerName"))
Expand All @@ -151,7 +151,7 @@ object ReadModelCatalogQueries extends ReadModelQuery {
count <- readModel.aggregate[TotalCountResult](
"eservices",
Seq(
addFields(Field("isSuperVisor", isSupervisor)),
addFields(Field("isSuperVisor", isSuperVisor)),
`match`(query),
count("totalCount"),
project(computed("data", Document("""{ "totalCount" : "$totalCount" }""")))
Expand Down Expand Up @@ -209,11 +209,11 @@ object ReadModelCatalogQueries extends ReadModelQuery {
Some(
Filters.nor(
Filters.and(
Filters.and(Filters.eq("isSuperVisor", false), Filters.ne("data.producerId", requesterId.toString)),
Filters.and(Filters.ne("isSuperVisor", false), Filters.ne("data.producerId", requesterId.toString)),
Filters.size("data.descriptors", 0)
),
Filters.and(
Filters.and(Filters.eq("isSuperVisor", false), Filters.ne("data.producerId", requesterId.toString)),
Filters.and(Filters.ne("isSuperVisor", false), Filters.ne("data.producerId", requesterId.toString)),
Filters.size("data.descriptors", 1),
Filters.eq("data.descriptors.state", Draft.toString())
)
Expand Down

0 comments on commit 1193ee0

Please sign in to comment.