1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2020 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.api.technical.graphql
21 
22 import java.time.ZonedDateTime
23 
24 import cats.data.NonEmptyList
25 import enumeratum.{Circe, Enum, EnumEntry}
26 import io.circe.Decoder
27 import org.make.api.proposal.{ContextFilterRequest, ProposalContextResponse, ProposalResponse, VoteResponse}
28 import org.make.api.technical.MakeRandom
29 import org.make.api.technical.graphql.GraphQLRuntimeComponent.RuntimeType
30 import org.make.core.common.indexed.Sort
31 import org.make.core.idea.IdeaId
32 import org.make.core.operation.{OperationId, OperationKind}
33 import org.make.core.proposal._
34 import org.make.core.proposal.indexed.ProposalElasticsearchFieldName
35 import org.make.core.question.QuestionId
36 import org.make.core.reference.{Country, Language}
37 import org.make.core.tag.TagId
38 import org.make.core.user.UserType
39 import org.make.core.{Order, RequestContext}
40 import zio.RIO
41 import zio.query.{DataSource, ZQuery}
42 import org.make.core.technical.Pagination
43 
44 final case class GraphQLProposal(
45   id: ProposalId,
46   content: String,
47   slug: String,
48   status: ProposalStatus,
49   createdAt: ZonedDateTime,
50   updatedAt: Option[ZonedDateTime],
51   myProposal: Boolean,
52   votes: Seq[VoteResponse],
53   context: Option[ProposalContextResponse],
54   proposalKey: String,
55   author: Option[ZQuery[Any, Throwable, GraphQLAuthor]],
56   question: Option[ZQuery[Any, Throwable, GraphQLQuestion]],
57   organisations: ZQuery[Any, Throwable, Seq[GraphQLOrganisation]],
58   tags: ZQuery[Any, Throwable, Seq[GraphQLTag]],
59   selectedStakeTag: Option[GraphQLTag],
60   idea: Option[ZQuery[Any, Throwable, GraphQLIdea]]
61 )
62 
63 object GraphQLProposal {
64 
65   def fromProposalResponse(proposal: ProposalResponse)(
66     userDataSource: DataSource[Any, GetAuthor],
67     questionDataSource: DataSource[Any, GetQuestion],
68     organisationDataSource: DataSource[Any, GetOrganisations],
69     tagDataSource: DataSource[Any, GetTags],
70     ideaDataSource: DataSource[Any, GetIdea]
71   ): GraphQLProposal = {
72     GraphQLProposal(
73       id = proposal.id,
74       content = proposal.content,
75       slug = proposal.slug,
76       status = proposal.status,
77       createdAt = proposal.createdAt,
78       updatedAt = proposal.updatedAt,
79       myProposal = proposal.myProposal,
80       votes = proposal.votes,
81       context = proposal.context,
82       proposalKey = proposal.proposalKey,
83       author = proposal.author.map(u => ZQuery.fromRequest(GetAuthor(u.userId))(userDataSource)),
84       question = proposal.question.map { question =>
85         ZQuery.fromRequest(GetQuestion(question.questionId))(questionDataSource)
86       },
87       organisations = ZQuery
88         .fromRequest(GetOrganisations(proposal.organisations.map(_.organisationId).toList))(organisationDataSource),
89       tags = ZQuery.fromRequest(GetTags(proposal.tags.map(_.tagId).toList))(tagDataSource),
90       selectedStakeTag = proposal.selectedStakeTag.map(GraphQLTag.fromTag),
91       idea = proposal.idea.map { ideaId =>
92         ZQuery.fromRequest(GetIdea(ideaId))(ideaDataSource)
93       }
94     )
95   }
96 }
97 
98 object GraphQLProposalQuery {
99 
100   sealed abstract class ProposalSortableFieldNames(val value: String) extends EnumEntry
101 
102   object ProposalSortableFieldNames extends Enum[ProposalSortableFieldNames] {
103 
104     case object Slug extends ProposalSortableFieldNames(ProposalElasticsearchFieldName.slug.value)
105     case object CreatedAt extends ProposalSortableFieldNames(ProposalElasticsearchFieldName.createdAt.value)
106     case object UpdatedAt extends ProposalSortableFieldNames(ProposalElasticsearchFieldName.updatedAt.value)
107     case object Country extends ProposalSortableFieldNames(ProposalElasticsearchFieldName.country.value)
108     case object Language extends ProposalSortableFieldNames(ProposalElasticsearchFieldName.language.value)
109     case object TopScoreAjustedWithVotes
110         extends ProposalSortableFieldNames(ProposalElasticsearchFieldName.scoreLowerBound.value)
111 
112     override val values: IndexedSeq[ProposalSortableFieldNames] = findValues
113     implicit val decoder: Decoder[ProposalSortableFieldNames] = Circe.decodeCaseInsensitive(this)
114 
115   }
116 
117   final case class ProposalSearchParams(
118     proposalIds: Option[Seq[ProposalId]],
119     questionIds: Option[Seq[QuestionId]],
120     tagsIds: Option[Seq[TagId]],
121     operationId: Option[OperationId],
122     content: Option[String],
123     slug: Option[String],
124     seed: Option[Int],
125     source: Option[String],
126     location: Option[String],
127     question: Option[String],
128     languages: Option[NonEmptyList[Language]],
129     country: Option[Country],
130     sort: Option[ProposalSortableFieldNames],
131     order: Option[Order],
132     limit: Option[Pagination.Limit],
133     offset: Option[Pagination.Offset],
134     sortAlgorithm: Option[AlgorithmSelector],
135     operationKinds: Option[Seq[OperationKind]],
136     userTypes: Option[Seq[UserType]],
137     ideaIds: Option[Seq[IdeaId]]
138   ) {
139     def toSearchQuery(requestContext: RequestContext): SearchQuery = {
140       val context: Option[ContextFilterRequest] = ContextFilterRequest.parse(operationId, source, location, question)
141 
142       val filters: Option[SearchFilters] =
143         SearchFilters.parse(
144           proposals = proposalIds.map(ProposalSearchFilter.apply),
145           tags = tagsIds.map(TagsSearchFilter.apply),
146           operation = operationId.map(opId => OperationSearchFilter(Seq(opId))),
147           question = questionIds.map(QuestionSearchFilter.apply),
148           content = content.map(ContentSearchFilter.apply),
149           slug = slug.map(value => SlugSearchFilter(value)),
150           context = context.map(_.toContext),
151           languages = languages.map(_.map(LanguageSearchFilter.apply)),
152           country = country.map(CountrySearchFilter.apply),
153           operationKinds = operationKinds.map(OperationKindsSearchFilter.apply),
154           userTypes = userTypes.map(UserTypesSearchFilter.apply),
155           idea = ideaIds.map(IdeaSearchFilter.apply)
156         )
157 
158       SearchQuery(
159         filters = filters,
160         sort = Sort.parse(sort.map(_.value), order),
161         limit = limit,
162         offset = offset,
163         language = requestContext.languageContext.language,
164         sortAlgorithm = sortAlgorithm.map(_.build(seed.getOrElse(MakeRandom.nextInt())))
165       )
166     }
167   }
168 
169   final case class GraphQLProposalQueries(search: ProposalSearchParams => RIO[RuntimeType, Seq[GraphQLProposal]])
170 
171 }
Line Stmt Id Pos Tree Symbol Tests Code
72 44023 2662 - 3690 Apply org.make.api.technical.graphql.GraphQLProposal.apply GraphQLProposal.apply(proposal.id, proposal.content, proposal.slug, proposal.status, proposal.createdAt, proposal.updatedAt, proposal.myProposal, proposal.votes, proposal.context, proposal.proposalKey, proposal.author.map[zio.query.ZQuery[Any,Throwable,org.make.api.technical.graphql.GraphQLAuthor]](((u: org.make.api.proposal.AuthorResponse) => zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetAuthor, org.make.api.technical.graphql.GraphQLAuthor](GetAuthor.apply(u.userId))(userDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetAuthor]))), proposal.question.map[zio.query.ZQuery[Any,Throwable,org.make.api.technical.graphql.GraphQLQuestion]](((question: org.make.api.question.SimpleQuestionResponse) => zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetQuestion, org.make.api.technical.graphql.GraphQLQuestion](GetQuestion.apply(question.questionId))(questionDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetQuestion]))), zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetOrganisations, Seq[org.make.api.technical.graphql.GraphQLOrganisation]](GetOrganisations.apply(proposal.organisations.map[org.make.core.user.UserId](((x$1: org.make.api.proposal.OrganisationInfoResponse) => x$1.organisationId)).toList))(organisationDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetOrganisations]), zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetTags, Seq[org.make.api.technical.graphql.GraphQLTag]](GetTags.apply(proposal.tags.map[org.make.core.tag.TagId](((x$2: org.make.core.proposal.indexed.IndexedTag) => x$2.tagId)).toList))(tagDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetTags]), proposal.selectedStakeTag.map[org.make.api.technical.graphql.GraphQLTag](((tag: org.make.core.proposal.indexed.IndexedTag) => GraphQLTag.fromTag(tag))), proposal.idea.map[zio.query.ZQuery[Any,Throwable,org.make.api.technical.graphql.GraphQLIdea]](((ideaId: org.make.core.idea.IdeaId) => zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetIdea, org.make.api.technical.graphql.GraphQLIdea](GetIdea.apply(ideaId))(ideaDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetIdea]))))
73 47703 2690 - 2701 Select org.make.api.proposal.ProposalResponse.id proposal.id
74 40889 2719 - 2735 Select org.make.api.proposal.ProposalResponse.content proposal.content
75 31975 2750 - 2763 Select org.make.api.proposal.ProposalResponse.slug proposal.slug
76 45781 2780 - 2795 Select org.make.api.proposal.ProposalResponse.status proposal.status
77 41920 2815 - 2833 Select org.make.api.proposal.ProposalResponse.createdAt proposal.createdAt
78 34395 2853 - 2871 Select org.make.api.proposal.ProposalResponse.updatedAt proposal.updatedAt
79 47402 2892 - 2911 Select org.make.api.proposal.ProposalResponse.myProposal proposal.myProposal
80 38519 2927 - 2941 Select org.make.api.proposal.ProposalResponse.votes proposal.votes
81 31410 2959 - 2975 Select org.make.api.proposal.ProposalResponse.context proposal.context
82 48448 2997 - 3017 Select org.make.api.proposal.ProposalResponse.proposalKey proposal.proposalKey
83 40926 3088 - 3096 Select org.make.api.proposal.AuthorResponse.userId u.userId
83 33542 3034 - 3115 Apply scala.Option.map proposal.author.map[zio.query.ZQuery[Any,Throwable,org.make.api.technical.graphql.GraphQLAuthor]](((u: org.make.api.proposal.AuthorResponse) => zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetAuthor, org.make.api.technical.graphql.GraphQLAuthor](GetAuthor.apply(u.userId))(userDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetAuthor])))
83 45821 3098 - 3098 TypeApply scala.<:<.refl scala.this.<:<.refl[org.make.api.technical.graphql.GetAuthor]
83 33045 3078 - 3097 Apply org.make.api.technical.graphql.GetAuthor.apply GetAuthor.apply(u.userId)
83 38234 3059 - 3114 ApplyToImplicitArgs zio.query.ZQuery.fromRequest zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetAuthor, org.make.api.technical.graphql.GraphQLAuthor](GetAuthor.apply(u.userId))(userDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetAuthor])
84 40070 3134 - 3258 Apply scala.Option.map proposal.question.map[zio.query.ZQuery[Any,Throwable,org.make.api.technical.graphql.GraphQLQuestion]](((question: org.make.api.question.SimpleQuestionResponse) => zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetQuestion, org.make.api.technical.graphql.GraphQLQuestion](GetQuestion.apply(question.questionId))(questionDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetQuestion])))
85 31449 3230 - 3230 TypeApply scala.<:<.refl scala.this.<:<.refl[org.make.api.technical.graphql.GetQuestion]
85 39050 3197 - 3229 Apply org.make.api.technical.graphql.GetQuestion.apply GetQuestion.apply(question.questionId)
85 47441 3209 - 3228 Select org.make.api.question.SimpleQuestionResponse.questionId question.questionId
85 48490 3178 - 3250 ApplyToImplicitArgs zio.query.ZQuery.fromRequest zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetQuestion, org.make.api.technical.graphql.GraphQLQuestion](GetQuestion.apply(question.questionId))(questionDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetQuestion])
88 45573 3327 - 3378 Select scala.collection.IterableOnceOps.toList proposal.organisations.map[org.make.core.user.UserId](((x$1: org.make.api.proposal.OrganisationInfoResponse) => x$1.organisationId)).toList
88 46590 3282 - 3404 ApplyToImplicitArgs zio.query.ZQuery.fromRequest zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetOrganisations, Seq[org.make.api.technical.graphql.GraphQLOrganisation]](GetOrganisations.apply(proposal.organisations.map[org.make.core.user.UserId](((x$1: org.make.api.proposal.OrganisationInfoResponse) => x$1.organisationId)).toList))(organisationDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetOrganisations])
88 37995 3310 - 3379 Apply org.make.api.technical.graphql.GetOrganisations.apply GetOrganisations.apply(proposal.organisations.map[org.make.core.user.UserId](((x$1: org.make.api.proposal.OrganisationInfoResponse) => x$1.organisationId)).toList)
88 33585 3380 - 3380 TypeApply scala.<:<.refl scala.this.<:<.refl[org.make.api.technical.graphql.GetOrganisations]
88 33083 3354 - 3370 Select org.make.api.proposal.OrganisationInfoResponse.organisationId x$1.organisationId
89 31484 3446 - 3479 Select scala.collection.IterableOnceOps.toList proposal.tags.map[org.make.core.tag.TagId](((x$2: org.make.core.proposal.indexed.IndexedTag) => x$2.tagId)).toList
89 47693 3438 - 3480 Apply org.make.api.technical.graphql.GetTags.apply GetTags.apply(proposal.tags.map[org.make.core.tag.TagId](((x$2: org.make.core.proposal.indexed.IndexedTag) => x$2.tagId)).toList)
89 40107 3481 - 3481 TypeApply scala.<:<.refl scala.this.<:<.refl[org.make.api.technical.graphql.GetTags]
89 39081 3464 - 3471 Select org.make.core.proposal.indexed.IndexedTag.tagId x$2.tagId
89 32998 3419 - 3496 ApplyToImplicitArgs zio.query.ZQuery.fromRequest zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetTags, Seq[org.make.api.technical.graphql.GraphQLTag]](GetTags.apply(proposal.tags.map[org.make.core.tag.TagId](((x$2: org.make.core.proposal.indexed.IndexedTag) => x$2.tagId)).toList))(tagDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetTags])
90 45609 3553 - 3571 Apply org.make.api.technical.graphql.GraphQLTag.fromTag GraphQLTag.fromTag(tag)
90 38033 3523 - 3572 Apply scala.Option.map proposal.selectedStakeTag.map[org.make.api.technical.graphql.GraphQLTag](((tag: org.make.core.proposal.indexed.IndexedTag) => GraphQLTag.fromTag(tag)))
91 31233 3587 - 3684 Apply scala.Option.map proposal.idea.map[zio.query.ZQuery[Any,Throwable,org.make.api.technical.graphql.GraphQLIdea]](((ideaId: org.make.core.idea.IdeaId) => zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetIdea, org.make.api.technical.graphql.GraphQLIdea](GetIdea.apply(ideaId))(ideaDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetIdea])))
92 33332 3644 - 3659 Apply org.make.api.technical.graphql.GetIdea.apply GetIdea.apply(ideaId)
92 46630 3660 - 3660 TypeApply scala.<:<.refl scala.this.<:<.refl[org.make.api.technical.graphql.GetIdea]
92 39539 3625 - 3676 ApplyToImplicitArgs zio.query.ZQuery.fromRequest zio.query.ZQuery.fromRequest[Any, Throwable, org.make.api.technical.graphql.GetIdea, org.make.api.technical.graphql.GraphQLIdea](GetIdea.apply(ideaId))(ideaDataSource)(scala.this.<:<.refl[org.make.api.technical.graphql.GetIdea])
113 39870 4707 - 4740 Apply enumeratum.Circe.decodeCaseInsensitive enumeratum.Circe.decodeCaseInsensitive[org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSortableFieldNames](this)
140 45038 5666 - 5672 Select org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSearchParams.source ProposalSearchParams.this.source
140 47146 5626 - 5693 Apply org.make.api.proposal.ContextFilterRequest.parse org.make.api.proposal.ContextFilterRequest.parse(ProposalSearchParams.this.operationId, ProposalSearchParams.this.source, ProposalSearchParams.this.location, ProposalSearchParams.this.question)
140 33039 5653 - 5664 Select org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSearchParams.operationId ProposalSearchParams.this.operationId
140 37246 5674 - 5682 Select org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSearchParams.location ProposalSearchParams.this.location
140 33370 5684 - 5692 Select org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSearchParams.question ProposalSearchParams.this.question
143 39362 5746 - 6543 Apply org.make.core.proposal.SearchFilters.parse org.make.core.proposal.SearchFilters.parse(x$1, x$13, x$2, x$14, x$3, x$4, x$5, x$15, x$6, x$7, x$12, x$8, x$9, x$16, x$17, x$18, x$19, x$20, x$21, x$22, x$23, x$10, x$24, x$25, x$11, x$26, x$27, x$28, x$29, x$30, x$31)
143 31012 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$23 org.make.core.proposal.SearchFilters.parse$default$23
143 45854 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$28 org.make.core.proposal.SearchFilters.parse$default$28
143 39403 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$4 org.make.core.proposal.SearchFilters.parse$default$4
143 36209 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$15 org.make.core.proposal.SearchFilters.parse$default$15
143 32013 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$16 org.make.core.proposal.SearchFilters.parse$default$16
143 44343 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$24 org.make.core.proposal.SearchFilters.parse$default$24
143 37566 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$29 org.make.core.proposal.SearchFilters.parse$default$29
143 37533 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$18 org.make.core.proposal.SearchFilters.parse$default$18
143 46424 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$20 org.make.core.proposal.SearchFilters.parse$default$20
143 45395 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$17 org.make.core.proposal.SearchFilters.parse$default$17
143 32054 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$27 org.make.core.proposal.SearchFilters.parse$default$27
143 30980 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$8 org.make.core.proposal.SearchFilters.parse$default$8
143 44312 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$14 org.make.core.proposal.SearchFilters.parse$default$14
143 35962 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$26 org.make.core.proposal.SearchFilters.parse$default$26
143 50347 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$30 org.make.core.proposal.SearchFilters.parse$default$30
143 50311 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$19 org.make.core.proposal.SearchFilters.parse$default$19
143 39323 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$21 org.make.core.proposal.SearchFilters.parse$default$21
143 46384 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$2 org.make.core.proposal.SearchFilters.parse$default$2
143 46169 5760 - 5760 Select org.make.core.proposal.SearchFilters.parse$default$31 org.make.core.proposal.SearchFilters.parse$default$31
144 39574 5805 - 5831 Apply org.make.core.proposal.ProposalSearchFilter.apply org.make.core.proposal.ProposalSearchFilter.apply(proposalIds)
144 30656 5789 - 5832 Apply scala.Option.map ProposalSearchParams.this.proposalIds.map[org.make.core.proposal.ProposalSearchFilter](((proposalIds: Seq[org.make.core.proposal.ProposalId]) => org.make.core.proposal.ProposalSearchFilter.apply(proposalIds)))
145 43780 5863 - 5885 Apply org.make.core.proposal.TagsSearchFilter.apply org.make.core.proposal.TagsSearchFilter.apply(tagIds)
145 39904 5851 - 5886 Apply scala.Option.map ProposalSearchParams.this.tagsIds.map[org.make.core.proposal.TagsSearchFilter](((tagIds: Seq[org.make.core.tag.TagId]) => org.make.core.proposal.TagsSearchFilter.apply(tagIds)))
146 46096 5934 - 5966 Apply org.make.core.proposal.OperationSearchFilter.apply org.make.core.proposal.OperationSearchFilter.apply(scala.`package`.Seq.apply[org.make.core.operation.OperationId](opId))
146 33077 5956 - 5965 Apply scala.collection.SeqFactory.Delegate.apply scala.`package`.Seq.apply[org.make.core.operation.OperationId](opId)
146 37985 5910 - 5967 Apply scala.Option.map ProposalSearchParams.this.operationId.map[org.make.core.proposal.OperationSearchFilter](((opId: org.make.core.operation.OperationId) => org.make.core.proposal.OperationSearchFilter.apply(scala.`package`.Seq.apply[org.make.core.operation.OperationId](opId))))
147 47183 5990 - 6033 Apply scala.Option.map ProposalSearchParams.this.questionIds.map[org.make.core.proposal.QuestionSearchFilter](((questionIds: Seq[org.make.core.question.QuestionId]) => org.make.core.proposal.QuestionSearchFilter.apply(questionIds)))
147 50323 6006 - 6032 Apply org.make.core.proposal.QuestionSearchFilter.apply org.make.core.proposal.QuestionSearchFilter.apply(questionIds)
148 39613 6067 - 6092 Apply org.make.core.proposal.ContentSearchFilter.apply org.make.core.proposal.ContentSearchFilter.apply(text)
148 31185 6055 - 6093 Apply scala.Option.map ProposalSearchParams.this.content.map[org.make.core.proposal.ContentSearchFilter](((text: String) => org.make.core.proposal.ContentSearchFilter.apply(text)))
149 40420 6112 - 6154 Apply scala.Option.map ProposalSearchParams.this.slug.map[org.make.core.proposal.SlugSearchFilter](((value: String) => org.make.core.proposal.SlugSearchFilter.apply(value)))
149 44516 6130 - 6153 Apply org.make.core.proposal.SlugSearchFilter.apply org.make.core.proposal.SlugSearchFilter.apply(value)
150 46135 6176 - 6200 Apply scala.Option.map context.map[org.make.core.proposal.ContextSearchFilter](((x$3: org.make.api.proposal.ContextFilterRequest) => x$3.toContext))
150 32826 6188 - 6199 Select org.make.api.proposal.ContextFilterRequest.toContext x$3.toContext
151 51052 6238 - 6271 Apply cats.data.NonEmptyList.map x$4.map[org.make.core.proposal.LanguageSearchFilter](((language: org.make.core.reference.Language) => org.make.core.proposal.LanguageSearchFilter.apply(language)))
151 37739 6244 - 6270 Apply org.make.core.proposal.LanguageSearchFilter.apply org.make.core.proposal.LanguageSearchFilter.apply(language)
151 47219 6224 - 6272 Apply scala.Option.map ProposalSearchParams.this.languages.map[cats.data.NonEmptyList[org.make.core.proposal.LanguageSearchFilter]](((x$4: cats.data.NonEmptyList[org.make.core.reference.Language]) => x$4.map[org.make.core.proposal.LanguageSearchFilter](((language: org.make.core.reference.Language) => org.make.core.proposal.LanguageSearchFilter.apply(language)))))
152 31224 6294 - 6332 Apply scala.Option.map ProposalSearchParams.this.country.map[org.make.core.proposal.CountrySearchFilter](((country: org.make.core.reference.Country) => org.make.core.proposal.CountrySearchFilter.apply(country)))
152 39366 6306 - 6331 Apply org.make.core.proposal.CountrySearchFilter.apply org.make.core.proposal.CountrySearchFilter.apply(country)
153 39863 6361 - 6413 Apply scala.Option.map ProposalSearchParams.this.operationKinds.map[org.make.core.proposal.OperationKindsSearchFilter](((kinds: Seq[org.make.core.operation.OperationKind]) => org.make.core.proposal.OperationKindsSearchFilter.apply(kinds)))
153 44273 6380 - 6412 Apply org.make.core.proposal.OperationKindsSearchFilter.apply org.make.core.proposal.OperationKindsSearchFilter.apply(kinds)
154 45355 6437 - 6479 Apply scala.Option.map ProposalSearchParams.this.userTypes.map[org.make.core.proposal.UserTypesSearchFilter](((userTypes: Seq[org.make.core.user.UserType]) => org.make.core.proposal.UserTypesSearchFilter.apply(userTypes)))
154 32864 6451 - 6478 Apply org.make.core.proposal.UserTypesSearchFilter.apply org.make.core.proposal.UserTypesSearchFilter.apply(userTypes)
155 37777 6510 - 6532 Apply org.make.core.proposal.IdeaSearchFilter.apply org.make.core.proposal.IdeaSearchFilter.apply(ideaIds)
155 50556 6498 - 6533 Apply scala.Option.map ProposalSearchParams.this.ideaIds.map[org.make.core.proposal.IdeaSearchFilter](((ideaIds: Seq[org.make.core.idea.IdeaId]) => org.make.core.proposal.IdeaSearchFilter.apply(ideaIds)))
158 32600 6551 - 6848 Apply org.make.core.proposal.SearchQuery.apply org.make.core.proposal.SearchQuery.apply(x$32, x$38, x$33, x$34, x$35, x$36, x$37)
158 35750 6551 - 6551 Select org.make.core.proposal.SearchQuery.apply$default$2 org.make.core.proposal.SearchQuery.apply$default$2
160 43561 6617 - 6634 Apply scala.Option.map ProposalSearchParams.this.sort.map[String](((x$5: org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSortableFieldNames) => x$5.value))
160 36000 6636 - 6641 Select org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSearchParams.order ProposalSearchParams.this.order
160 32563 6606 - 6642 Apply org.make.core.common.indexed.Sort.parse org.make.core.common.indexed.Sort.parse(ProposalSearchParams.this.sort.map[String](((x$5: org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSortableFieldNames) => x$5.value)), ProposalSearchParams.this.order)
160 31483 6626 - 6633 Select org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSortableFieldNames.value x$5.value
161 45894 6660 - 6665 Select org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSearchParams.limit ProposalSearchParams.this.limit
162 38315 6684 - 6690 Select org.make.api.technical.graphql.GraphQLProposalQuery.ProposalSearchParams.offset ProposalSearchParams.this.offset
163 50099 6711 - 6750 Select org.make.core.RequestContextLanguage.language requestContext.languageContext.language
164 42511 6817 - 6837 Apply org.make.api.technical.MakeRandom.nextInt org.make.api.technical.MakeRandom.nextInt()
164 31522 6794 - 6839 Apply scala.Function1.apply x$6.build.apply(ProposalSearchParams.this.seed.getOrElse[Int](org.make.api.technical.MakeRandom.nextInt()))
164 39115 6802 - 6838 Apply scala.Option.getOrElse ProposalSearchParams.this.seed.getOrElse[Int](org.make.api.technical.MakeRandom.nextInt())
164 44303 6776 - 6840 Apply scala.Option.map ProposalSearchParams.this.sortAlgorithm.map[org.make.core.proposal.SortAlgorithm](((x$6: org.make.core.proposal.AlgorithmSelector) => x$6.build.apply(ProposalSearchParams.this.seed.getOrElse[Int](org.make.api.technical.MakeRandom.nextInt()))))