1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 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.operation
21 
22 import akka.Done
23 import akka.stream.scaladsl.{Sink, Source}
24 
25 import java.time.LocalDate
26 import io.circe.syntax._
27 import org.make.api.question.PersistentQuestionServiceComponent
28 import org.make.api.tag.PersistentTagServiceComponent
29 import org.make.api.technical.{ActorSystemComponent, IdGeneratorComponent, ShortenedNames}
30 import org.make.core.{DateHelper, Order}
31 import org.make.core.operation._
32 import org.make.core.operation.OperationActionType._
33 import org.make.core.operation.OperationKind.GreatCause
34 import org.make.core.reference.Country
35 import org.make.core.user.UserId
36 
37 import scala.concurrent.ExecutionContext.Implicits.global
38 import scala.concurrent.Future
39 import org.make.core.technical.Pagination._
40 
41 trait DefaultOperationServiceComponent extends OperationServiceComponent with ShortenedNames {
42   this: PersistentOperationServiceComponent
43     with IdGeneratorComponent
44     with PersistentTagServiceComponent
45     with PersistentQuestionServiceComponent
46     with OperationOfQuestionServiceComponent
47     with ActorSystemComponent =>
48 
49   override lazy val operationService: OperationService = new DefaultOperationService
50 
51   class DefaultOperationService extends OperationService {
52 
53     override def find(
54       operationIds: Option[Seq[OperationId]] = None,
55       slug: Option[String] = None,
56       country: Option[Country] = None,
57       openAt: Option[LocalDate] = None
58     ): Future[Seq[Operation]] = {
59 
60       persistentOperationService.find(operationIds = operationIds, slug = slug, country = country, openAt = openAt)
61     }
62 
63     override def findSimple(
64       offset: Offset = Offset.zero,
65       end: Option[End] = None,
66       sort: Option[String] = None,
67       order: Option[Order] = None,
68       slug: Option[String] = None,
69       operationKinds: Option[Seq[OperationKind]]
70     ): Future[Seq[SimpleOperation]] = {
71 
72       persistentOperationService.findSimple(
73         offset = offset,
74         end = end,
75         sort = sort,
76         order = order,
77         slug = slug,
78         operationKinds = operationKinds
79       )
80     }
81 
82     override def findOne(operationId: OperationId): Future[Option[Operation]] = {
83       persistentOperationService.getById(operationId)
84     }
85 
86     override def findOneSimple(operationId: OperationId): Future[Option[SimpleOperation]] = {
87       persistentOperationService.getSimpleById(operationId)
88     }
89 
90     override def findOneBySlug(slug: String): Future[Option[Operation]] = {
91       persistentOperationService.getBySlug(slug)
92     }
93 
94     override def create(
95       userId: UserId,
96       slug: String,
97       operationKind: OperationKind,
98       operationAuthentication: Option[OperationAuthentication]
99     ): Future[OperationId] = {
100       val now = DateHelper.now()
101 
102       val persist: Future[SimpleOperation] = persistentOperationService.persist(
103         SimpleOperation(
104           operationId = idGenerator.nextOperationId(),
105           slug = slug,
106           operationKind = operationKind,
107           operationAuthentication = operationAuthentication,
108           createdAt = Some(now),
109           updatedAt = Some(now)
110         )
111       )
112 
113       def addAction(persisted: SimpleOperation): Future[Boolean] =
114         persistentOperationService
115           .addActionToOperation(
116             OperationAction(
117               makeUserId = userId,
118               actionType = OperationCreateAction.value,
119               arguments = Map("operation" -> operationToString(persisted))
120             ),
121             persisted.operationId
122           )
123 
124       for {
125         persisted <- persist
126         _         <- addAction(persisted)
127       } yield persisted.operationId
128     }
129 
130     override def update(
131       operationId: OperationId,
132       userId: UserId,
133       slug: Option[String] = None,
134       operationKind: Option[OperationKind] = None,
135       operationAuthentication: Option[OperationAuthentication]
136     ): Future[Option[OperationId]] = {
137 
138       persistentOperationService
139         .getById(operationId)
140         .flatMap {
141           case None => Future.successful(None)
142           case Some(operation) =>
143             val modify = persistentOperationService.modify(
144               SimpleOperation(
145                 operationId = operationId,
146                 slug = slug.getOrElse(operation.slug),
147                 operationKind = operationKind.getOrElse(operation.operationKind),
148                 operationAuthentication = operationAuthentication.orElse(operation.operationAuthentication),
149                 createdAt = operation.createdAt,
150                 updatedAt = operation.updatedAt
151               )
152             )
153 
154             def addAction(updated: SimpleOperation): Future[Boolean] =
155               persistentOperationService
156                 .addActionToOperation(
157                   OperationAction(
158                     makeUserId = userId,
159                     actionType = OperationUpdateAction.value,
160                     arguments = Map("operation" -> operationToString(updated))
161                   ),
162                   updated.operationId
163                 )
164 
165             def updateQuestions(updated: SimpleOperation): Future[Done] =
166               Source(operation.questions)
167                 .mapAsync(5) { question =>
168                   operationOfQuestionService.update(
169                     question.details.copy(featured = question.details.featured || updated.operationKind == GreatCause)
170                   )
171                 }
172                 .runWith(Sink.ignore)
173 
174             for {
175               updated <- modify
176               _       <- addAction(updated)
177               _       <- updateQuestions(updated)
178             } yield Some(updated.operationId)
179         }
180     }
181 
182     private def operationToString(operation: SimpleOperation): String = {
183       scala.collection
184         .Map[String, String]("operationId" -> operation.operationId.value)
185         .asJson
186         .toString
187     }
188 
189     override def count(slug: Option[String], operationKinds: Option[Seq[OperationKind]]): Future[Int] = {
190       persistentOperationService.count(slug = slug, operationKinds = operationKinds)
191     }
192 
193   }
194 }
Line Stmt Id Pos Tree Symbol Tests Code
60 27827 2196 - 2305 Apply org.make.api.operation.PersistentOperationService.find DefaultOperationServiceComponent.this.persistentOperationService.find(operationIds, slug, country, openAt)
72 26647 2610 - 2805 Apply org.make.api.operation.PersistentOperationService.findSimple DefaultOperationServiceComponent.this.persistentOperationService.findSimple(offset, end, sort, order, slug, operationKinds)
83 24262 2901 - 2948 Apply org.make.api.operation.PersistentOperationService.getById DefaultOperationServiceComponent.this.persistentOperationService.getById(operationId)
87 28223 3056 - 3109 Apply org.make.api.operation.PersistentOperationService.getSimpleById DefaultOperationServiceComponent.this.persistentOperationService.getSimpleById(operationId)
91 25691 3199 - 3241 Apply org.make.api.operation.PersistentOperationService.getBySlug DefaultOperationServiceComponent.this.persistentOperationService.getBySlug(slug)
100 24776 3462 - 3478 Apply org.make.core.DefaultDateHelper.now org.make.api.operation.operationservicetest org.make.core.DateHelper.now()
102 26657 3525 - 3848 Apply org.make.api.operation.PersistentOperationService.persist org.make.api.operation.operationservicetest DefaultOperationServiceComponent.this.persistentOperationService.persist(org.make.core.operation.SimpleOperation.apply(DefaultOperationServiceComponent.this.idGenerator.nextOperationId(), slug, operationKind, operationAuthentication, scala.Some.apply[java.time.ZonedDateTime](now), scala.Some.apply[java.time.ZonedDateTime](now)))
103 27758 3569 - 3840 Apply org.make.core.operation.SimpleOperation.apply org.make.api.operation.operationservicetest org.make.core.operation.SimpleOperation.apply(DefaultOperationServiceComponent.this.idGenerator.nextOperationId(), slug, operationKind, operationAuthentication, scala.Some.apply[java.time.ZonedDateTime](now), scala.Some.apply[java.time.ZonedDateTime](now))
104 22510 3610 - 3639 Apply org.make.core.technical.IdGenerator.nextOperationId org.make.api.operation.operationservicetest DefaultOperationServiceComponent.this.idGenerator.nextOperationId()
108 26378 3788 - 3797 Apply scala.Some.apply org.make.api.operation.operationservicetest scala.Some.apply[java.time.ZonedDateTime](now)
109 23815 3821 - 3830 Apply scala.Some.apply org.make.api.operation.operationservicetest scala.Some.apply[java.time.ZonedDateTime](now)
115 26589 3925 - 4240 Apply org.make.api.operation.PersistentOperationService.addActionToOperation DefaultOperationServiceComponent.this.persistentOperationService.addActionToOperation({ <artifact> val x$1: org.make.core.user.UserId = userId; <artifact> val x$2: String = org.make.core.operation.OperationActionType.OperationCreateAction.value; <artifact> val x$3: scala.collection.immutable.Map[String,String] @scala.reflect.internal.annotations.uncheckedBounds = scala.Predef.Map.apply[String, String](scala.Predef.ArrowAssoc[String]("operation").->[String](DefaultOperationService.this.operationToString(persisted))); <artifact> val x$4: java.time.ZonedDateTime = org.make.core.operation.OperationAction.apply$default$1; org.make.core.operation.OperationAction.apply(x$4, x$1, x$2, x$3) }, persisted.operationId)
116 24118 3997 - 4193 Apply org.make.core.operation.OperationAction.apply org.make.core.operation.OperationAction.apply(x$4, x$1, x$2, x$3)
116 26132 3997 - 3997 Select org.make.core.operation.OperationAction.apply$default$1 org.make.core.operation.OperationAction.apply$default$1
118 24237 4076 - 4103 Select org.make.core.operation.OperationActionType.value org.make.core.operation.OperationActionType.OperationCreateAction.value
119 23631 4135 - 4178 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("operation").->[String](DefaultOperationService.this.operationToString(persisted))
119 22520 4131 - 4179 Apply scala.collection.MapFactory.apply scala.Predef.Map.apply[String, String](scala.Predef.ArrowAssoc[String]("operation").->[String](DefaultOperationService.this.operationToString(persisted)))
119 25920 4150 - 4178 Apply org.make.api.operation.DefaultOperationServiceComponent.DefaultOperationService.operationToString DefaultOperationService.this.operationToString(persisted)
119 28234 4135 - 4146 Literal <nosymbol> "operation"
121 27769 4207 - 4228 Select org.make.core.operation.SimpleOperation.operationId persisted.operationId
125 22299 4248 - 4360 ApplyToImplicitArgs scala.concurrent.Future.flatMap org.make.api.operation.operationservicetest persist.flatMap[org.make.core.operation.OperationId](((persisted: org.make.core.operation.SimpleOperation) => addAction(persisted).map[org.make.core.operation.OperationId](((x$1: Boolean) => (x$1: Boolean @unchecked) match { case _ => persisted.operationId }))(scala.concurrent.ExecutionContext.Implicits.global)))(scala.concurrent.ExecutionContext.Implicits.global)
125 23645 4272 - 4272 Select scala.concurrent.ExecutionContext.Implicits.global org.make.api.operation.operationservicetest scala.concurrent.ExecutionContext.Implicits.global
126 25859 4291 - 4360 ApplyToImplicitArgs scala.concurrent.Future.map addAction(persisted).map[org.make.core.operation.OperationId](((x$1: Boolean) => (x$1: Boolean @unchecked) match { case _ => persisted.operationId }))(scala.concurrent.ExecutionContext.Implicits.global)
126 28077 4301 - 4301 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
127 24251 4339 - 4360 Select org.make.core.operation.SimpleOperation.operationId persisted.operationId
140 25383 4716 - 4716 Select scala.concurrent.ExecutionContext.Implicits.global org.make.api.operation.operationservicetest scala.concurrent.ExecutionContext.Implicits.global
140 23208 4642 - 6360 ApplyToImplicitArgs scala.concurrent.Future.flatMap org.make.api.operation.operationservicetest DefaultOperationServiceComponent.this.persistentOperationService.getById(operationId).flatMap[Option[org.make.core.operation.OperationId]](((x0$1: Option[org.make.core.operation.Operation]) => x0$1 match { case scala.None => scala.concurrent.Future.successful[None.type](scala.None) case (value: org.make.core.operation.Operation): Some[org.make.core.operation.Operation]((operation @ _)) => { val modify: scala.concurrent.Future[org.make.core.operation.SimpleOperation] = DefaultOperationServiceComponent.this.persistentOperationService.modify(org.make.core.operation.SimpleOperation.apply(operationId, slug.getOrElse[String](operation.slug), operationKind.getOrElse[org.make.core.operation.OperationKind](operation.operationKind), operationAuthentication.orElse[org.make.core.operation.OperationAuthentication](operation.operationAuthentication), operation.createdAt, operation.updatedAt)); def addAction(updated: org.make.core.operation.SimpleOperation): scala.concurrent.Future[Boolean] = DefaultOperationServiceComponent.this.persistentOperationService.addActionToOperation({ <artifact> val x$1: org.make.core.user.UserId = userId; <artifact> val x$2: String = org.make.core.operation.OperationActionType.OperationUpdateAction.value; <artifact> val x$3: scala.collection.immutable.Map[String,String] @scala.reflect.internal.annotations.uncheckedBounds = scala.Predef.Map.apply[String, String](scala.Predef.ArrowAssoc[String]("operation").->[String](DefaultOperationService.this.operationToString(updated))); <artifact> val x$4: java.time.ZonedDateTime = org.make.core.operation.OperationAction.apply$default$1; org.make.core.operation.OperationAction.apply(x$4, x$1, x$2, x$3) }, updated.operationId); def updateQuestions(updated: org.make.core.operation.SimpleOperation): scala.concurrent.Future[akka.Done] = akka.stream.scaladsl.Source.apply[org.make.core.operation.QuestionWithDetails](operation.questions).mapAsync[org.make.core.operation.OperationOfQuestion](5)(((question: org.make.core.operation.QuestionWithDetails) => DefaultOperationServiceComponent.this.operationOfQuestionService.update({ <artifact> val x$1: Boolean = question.details.featured.||(updated.operationKind.==(org.make.core.operation.OperationKind.GreatCause)); <artifact> val x$2: org.make.core.question.QuestionId = question.details.copy$default$1; <artifact> val x$3: org.make.core.operation.OperationId = question.details.copy$default$2; <artifact> val x$4: java.time.ZonedDateTime = question.details.copy$default$3; <artifact> val x$5: java.time.ZonedDateTime = question.details.copy$default$4; <artifact> val x$6: org.make.core.technical.Multilingual[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$5; <artifact> val x$7: org.make.core.technical.Multilingual[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$6; <artifact> val x$8: Boolean = question.details.copy$default$7; <artifact> val x$9: org.make.core.operation.SequenceCardsConfiguration = question.details.copy$default$8; <artifact> val x$10: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$9; <artifact> val x$11: org.make.core.operation.Metas = question.details.copy$default$10; <artifact> val x$12: org.make.core.operation.QuestionTheme = question.details.copy$default$11; <artifact> val x$13: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$12; <artifact> val x$14: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$13; <artifact> val x$15: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$14; <artifact> val x$16: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$15; <artifact> val x$17: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$16; <artifact> val x$18: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$17; <artifact> val x$19: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$18; <artifact> val x$20: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$19; <artifact> val x$21: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$20; <artifact> val x$22: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$21; <artifact> val x$23: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$22; <artifact> val x$24: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$23; <artifact> val x$25: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$24; <artifact> val x$26: Option[org.make.core.operation.ResultsLink] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$25; <artifact> val x$27: Int = question.details.copy$default$26; <artifact> val x$28: Int = question.details.copy$default$27; <artifact> val x$29: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$28; <artifact> val x$30: Int = question.details.copy$default$30; <artifact> val x$31: Int = question.details.copy$default$31; <artifact> val x$32: org.make.core.operation.OperationOfQuestionTimeline = question.details.copy$default$32; <artifact> val x$33: java.time.ZonedDateTime = question.details.copy$default$33; <artifact> val x$34: Boolean = question.details.copy$default$34; <artifact> val x$35: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$35; <artifact> val x$36: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$36; question.details.copy(x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$20, x$21, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$29, x$1, x$30, x$31, x$32, x$33, x$34, x$35, x$36) }))).runWith[scala.concurrent.Future[akka.Done]](akka.stream.scaladsl.Sink.ignore)(stream.this.Materializer.matFromSystem(DefaultOperationServiceComponent.this.actorSystem)); modify.flatMap[Option[org.make.core.operation.OperationId]](((updated: org.make.core.operation.SimpleOperation) => addAction(updated).flatMap[Option[org.make.core.operation.OperationId]](((x$3: Boolean) => (x$3: Boolean @unchecked) match { case _ => updateQuestions(updated).map[Option[org.make.core.operation.OperationId]](((x$2: akka.Done) => (x$2: akka.Done @unchecked) match { case _ => scala.Some.apply[org.make.core.operation.OperationId](updated.operationId) }))(scala.concurrent.ExecutionContext.Implicits.global) }))(scala.concurrent.ExecutionContext.Implicits.global)))(scala.concurrent.ExecutionContext.Implicits.global) } }))(scala.concurrent.ExecutionContext.Implicits.global)
141 23795 4741 - 4764 Apply scala.concurrent.Future.successful scala.concurrent.Future.successful[None.type](scala.None)
141 26142 4759 - 4763 Select scala.None scala.None
143 27549 4824 - 5305 Apply org.make.api.operation.PersistentOperationService.modify DefaultOperationServiceComponent.this.persistentOperationService.modify(org.make.core.operation.SimpleOperation.apply(operationId, slug.getOrElse[String](operation.slug), operationKind.getOrElse[org.make.core.operation.OperationKind](operation.operationKind), operationAuthentication.orElse[org.make.core.operation.OperationAuthentication](operation.operationAuthentication), operation.createdAt, operation.updatedAt))
144 24106 4873 - 5291 Apply org.make.core.operation.SimpleOperation.apply org.make.core.operation.SimpleOperation.apply(operationId, slug.getOrElse[String](operation.slug), operationKind.getOrElse[org.make.core.operation.OperationKind](operation.operationKind), operationAuthentication.orElse[org.make.core.operation.OperationAuthentication](operation.operationAuthentication), operation.createdAt, operation.updatedAt)
146 26594 4956 - 4986 Apply scala.Option.getOrElse slug.getOrElse[String](operation.slug)
146 27708 4971 - 4985 Select org.make.core.operation.Operation.slug operation.slug
147 24259 5044 - 5067 Select org.make.core.operation.Operation.operationKind operation.operationKind
147 28002 5020 - 5068 Apply scala.Option.getOrElse operationKind.getOrElse[org.make.core.operation.OperationKind](operation.operationKind)
148 23574 5112 - 5177 Apply scala.Option.orElse operationAuthentication.orElse[org.make.core.operation.OperationAuthentication](operation.operationAuthentication)
148 25685 5143 - 5176 Select org.make.core.operation.Operation.operationAuthentication operation.operationAuthentication
149 22306 5207 - 5226 Select org.make.core.operation.Operation.createdAt operation.createdAt
150 26148 5256 - 5275 Select org.make.core.operation.Operation.updatedAt operation.updatedAt
156 27843 5392 - 5751 Apply org.make.api.operation.PersistentOperationService.addActionToOperation DefaultOperationServiceComponent.this.persistentOperationService.addActionToOperation({ <artifact> val x$1: org.make.core.user.UserId = userId; <artifact> val x$2: String = org.make.core.operation.OperationActionType.OperationUpdateAction.value; <artifact> val x$3: scala.collection.immutable.Map[String,String] @scala.reflect.internal.annotations.uncheckedBounds = scala.Predef.Map.apply[String, String](scala.Predef.ArrowAssoc[String]("operation").->[String](DefaultOperationService.this.operationToString(updated))); <artifact> val x$4: java.time.ZonedDateTime = org.make.core.operation.OperationAction.apply$default$1; org.make.core.operation.OperationAction.apply(x$4, x$1, x$2, x$3) }, updated.operationId)
157 26077 5476 - 5694 Apply org.make.core.operation.OperationAction.apply org.make.core.operation.OperationAction.apply(x$4, x$1, x$2, x$3)
157 22313 5476 - 5476 Select org.make.core.operation.OperationAction.apply$default$1 org.make.core.operation.OperationAction.apply$default$1
159 25312 5567 - 5594 Select org.make.core.operation.OperationActionType.value org.make.core.operation.OperationActionType.OperationUpdateAction.value
160 25987 5632 - 5673 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("operation").->[String](DefaultOperationService.this.operationToString(updated))
160 23423 5628 - 5674 Apply scala.collection.MapFactory.apply scala.Predef.Map.apply[String, String](scala.Predef.ArrowAssoc[String]("operation").->[String](DefaultOperationService.this.operationToString(updated)))
160 24194 5632 - 5643 Literal <nosymbol> "operation"
160 28010 5647 - 5673 Apply org.make.api.operation.DefaultOperationServiceComponent.DefaultOperationService.operationToString DefaultOperationService.this.operationToString(updated)
162 24115 5714 - 5733 Select org.make.core.operation.SimpleOperation.operationId updated.operationId
166 25518 5848 - 5867 Select org.make.core.operation.Operation.questions operation.questions
167 24202 5895 - 5896 Literal <nosymbol> 5
168 27489 5930 - 6103 Apply org.make.api.operation.OperationOfQuestionService.update DefaultOperationServiceComponent.this.operationOfQuestionService.update({ <artifact> val x$1: Boolean = question.details.featured.||(updated.operationKind.==(org.make.core.operation.OperationKind.GreatCause)); <artifact> val x$2: org.make.core.question.QuestionId = question.details.copy$default$1; <artifact> val x$3: org.make.core.operation.OperationId = question.details.copy$default$2; <artifact> val x$4: java.time.ZonedDateTime = question.details.copy$default$3; <artifact> val x$5: java.time.ZonedDateTime = question.details.copy$default$4; <artifact> val x$6: org.make.core.technical.Multilingual[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$5; <artifact> val x$7: org.make.core.technical.Multilingual[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$6; <artifact> val x$8: Boolean = question.details.copy$default$7; <artifact> val x$9: org.make.core.operation.SequenceCardsConfiguration = question.details.copy$default$8; <artifact> val x$10: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$9; <artifact> val x$11: org.make.core.operation.Metas = question.details.copy$default$10; <artifact> val x$12: org.make.core.operation.QuestionTheme = question.details.copy$default$11; <artifact> val x$13: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$12; <artifact> val x$14: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$13; <artifact> val x$15: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$14; <artifact> val x$16: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$15; <artifact> val x$17: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$16; <artifact> val x$18: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$17; <artifact> val x$19: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$18; <artifact> val x$20: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$19; <artifact> val x$21: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$20; <artifact> val x$22: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$21; <artifact> val x$23: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$22; <artifact> val x$24: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$23; <artifact> val x$25: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$24; <artifact> val x$26: Option[org.make.core.operation.ResultsLink] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$25; <artifact> val x$27: Int = question.details.copy$default$26; <artifact> val x$28: Int = question.details.copy$default$27; <artifact> val x$29: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$28; <artifact> val x$30: Int = question.details.copy$default$30; <artifact> val x$31: Int = question.details.copy$default$31; <artifact> val x$32: org.make.core.operation.OperationOfQuestionTimeline = question.details.copy$default$32; <artifact> val x$33: java.time.ZonedDateTime = question.details.copy$default$33; <artifact> val x$34: Boolean = question.details.copy$default$34; <artifact> val x$35: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$35; <artifact> val x$36: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$36; question.details.copy(x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$20, x$21, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$29, x$1, x$30, x$31, x$32, x$33, x$34, x$35, x$36) })
169 24056 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$3 question.details.copy$default$3
169 27854 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$4 question.details.copy$default$4
169 24337 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$15 question.details.copy$default$15
169 25461 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$23 question.details.copy$default$23
169 26074 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$20 question.details.copy$default$20
169 26065 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$11 question.details.copy$default$11
169 23571 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$9 question.details.copy$default$9
169 23816 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$21 question.details.copy$default$21
169 25395 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$33 question.details.copy$default$33
169 26086 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$2 question.details.copy$default$2
169 27925 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$16 question.details.copy$default$16
169 27847 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$32 question.details.copy$default$32
169 27336 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$28 question.details.copy$default$28
169 28170 6072 - 6082 Select org.make.core.operation.OperationKind.GreatCause org.make.core.operation.OperationKind.GreatCause
169 24324 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$6 question.details.copy$default$6
169 25930 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$36 question.details.copy$default$36
169 22440 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$1 question.details.copy$default$1
169 23726 5985 - 6083 Apply org.make.core.operation.OperationOfQuestion.copy question.details.copy(x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$20, x$21, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$29, x$1, x$30, x$31, x$32, x$33, x$34, x$35, x$36)
169 25933 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$8 question.details.copy$default$8
169 25529 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$5 question.details.copy$default$5
169 27326 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$19 question.details.copy$default$19
169 27649 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$22 question.details.copy$default$22
169 23561 6018 - 6082 Apply scala.Boolean.|| question.details.featured.||(updated.operationKind.==(org.make.core.operation.OperationKind.GreatCause))
169 27401 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$10 question.details.copy$default$10
169 25995 6047 - 6082 Apply java.lang.Object.== updated.operationKind.==(org.make.core.operation.OperationKind.GreatCause)
169 25941 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$17 question.details.copy$default$17
169 24066 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$12 question.details.copy$default$12
169 23055 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$34 question.details.copy$default$34
169 23046 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$24 question.details.copy$default$24
169 25447 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$14 question.details.copy$default$14
169 27717 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$13 question.details.copy$default$13
169 23581 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$18 question.details.copy$default$18
169 27944 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$35 question.details.copy$default$35
169 23826 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$31 question.details.copy$default$31
169 23512 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$27 question.details.copy$default$27
169 27938 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$25 question.details.copy$default$25
169 28180 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$7 question.details.copy$default$7
169 25991 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$26 question.details.copy$default$26
169 26386 6002 - 6002 Select org.make.core.operation.OperationOfQuestion.copy$default$30 question.details.copy$default$30
172 26394 6147 - 6158 Select akka.stream.scaladsl.Sink.ignore akka.stream.scaladsl.Sink.ignore
172 27781 6146 - 6146 ApplyToImplicitArgs akka.stream.Materializer.matFromSystem stream.this.Materializer.matFromSystem(DefaultOperationServiceComponent.this.actorSystem)
172 25618 5841 - 6159 ApplyToImplicitArgs akka.stream.scaladsl.Source.runWith akka.stream.scaladsl.Source.apply[org.make.core.operation.QuestionWithDetails](operation.questions).mapAsync[org.make.core.operation.OperationOfQuestion](5)(((question: org.make.core.operation.QuestionWithDetails) => DefaultOperationServiceComponent.this.operationOfQuestionService.update({ <artifact> val x$1: Boolean = question.details.featured.||(updated.operationKind.==(org.make.core.operation.OperationKind.GreatCause)); <artifact> val x$2: org.make.core.question.QuestionId = question.details.copy$default$1; <artifact> val x$3: org.make.core.operation.OperationId = question.details.copy$default$2; <artifact> val x$4: java.time.ZonedDateTime = question.details.copy$default$3; <artifact> val x$5: java.time.ZonedDateTime = question.details.copy$default$4; <artifact> val x$6: org.make.core.technical.Multilingual[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$5; <artifact> val x$7: org.make.core.technical.Multilingual[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$6; <artifact> val x$8: Boolean = question.details.copy$default$7; <artifact> val x$9: org.make.core.operation.SequenceCardsConfiguration = question.details.copy$default$8; <artifact> val x$10: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$9; <artifact> val x$11: org.make.core.operation.Metas = question.details.copy$default$10; <artifact> val x$12: org.make.core.operation.QuestionTheme = question.details.copy$default$11; <artifact> val x$13: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$12; <artifact> val x$14: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$13; <artifact> val x$15: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$14; <artifact> val x$16: Option[org.make.core.technical.Multilingual[String]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$15; <artifact> val x$17: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$16; <artifact> val x$18: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$17; <artifact> val x$19: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$18; <artifact> val x$20: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$19; <artifact> val x$21: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$20; <artifact> val x$22: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$21; <artifact> val x$23: Option[org.make.core.technical.Multilingual[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$22; <artifact> val x$24: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$23; <artifact> val x$25: Option[eu.timepit.refined.api.Refined[String,eu.timepit.refined.collection.MaxSize[Int(130)]]] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$24; <artifact> val x$26: Option[org.make.core.operation.ResultsLink] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$25; <artifact> val x$27: Int = question.details.copy$default$26; <artifact> val x$28: Int = question.details.copy$default$27; <artifact> val x$29: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$28; <artifact> val x$30: Int = question.details.copy$default$30; <artifact> val x$31: Int = question.details.copy$default$31; <artifact> val x$32: org.make.core.operation.OperationOfQuestionTimeline = question.details.copy$default$32; <artifact> val x$33: java.time.ZonedDateTime = question.details.copy$default$33; <artifact> val x$34: Boolean = question.details.copy$default$34; <artifact> val x$35: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$35; <artifact> val x$36: Option[String] @scala.reflect.internal.annotations.uncheckedBounds = question.details.copy$default$36; question.details.copy(x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$20, x$21, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$29, x$1, x$30, x$31, x$32, x$33, x$34, x$35, x$36) }))).runWith[scala.concurrent.Future[akka.Done]](akka.stream.scaladsl.Sink.ignore)(stream.this.Materializer.matFromSystem(DefaultOperationServiceComponent.this.actorSystem))
172 23835 6146 - 6146 Select org.make.api.technical.ActorSystemComponent.actorSystem DefaultOperationServiceComponent.this.actorSystem
175 24002 6201 - 6201 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
175 27792 6173 - 6350 ApplyToImplicitArgs scala.concurrent.Future.flatMap modify.flatMap[Option[org.make.core.operation.OperationId]](((updated: org.make.core.operation.SimpleOperation) => addAction(updated).flatMap[Option[org.make.core.operation.OperationId]](((x$3: Boolean) => (x$3: Boolean @unchecked) match { case _ => updateQuestions(updated).map[Option[org.make.core.operation.OperationId]](((x$2: akka.Done) => (x$2: akka.Done @unchecked) match { case _ => scala.Some.apply[org.make.core.operation.OperationId](updated.operationId) }))(scala.concurrent.ExecutionContext.Implicits.global) }))(scala.concurrent.ExecutionContext.Implicits.global)))(scala.concurrent.ExecutionContext.Implicits.global)
176 24952 6225 - 6350 ApplyToImplicitArgs scala.concurrent.Future.flatMap addAction(updated).flatMap[Option[org.make.core.operation.OperationId]](((x$3: Boolean) => (x$3: Boolean @unchecked) match { case _ => updateQuestions(updated).map[Option[org.make.core.operation.OperationId]](((x$2: akka.Done) => (x$2: akka.Done @unchecked) match { case _ => scala.Some.apply[org.make.core.operation.OperationId](updated.operationId) }))(scala.concurrent.ExecutionContext.Implicits.global) }))(scala.concurrent.ExecutionContext.Implicits.global)
176 27320 6233 - 6233 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
177 23655 6269 - 6350 ApplyToImplicitArgs scala.concurrent.Future.map updateQuestions(updated).map[Option[org.make.core.operation.OperationId]](((x$2: akka.Done) => (x$2: akka.Done @unchecked) match { case _ => scala.Some.apply[org.make.core.operation.OperationId](updated.operationId) }))(scala.concurrent.ExecutionContext.Implicits.global)
177 25937 6277 - 6277 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
178 23367 6330 - 6349 Select org.make.core.operation.SimpleOperation.operationId updated.operationId
178 28252 6325 - 6350 Apply scala.Some.apply scala.Some.apply[org.make.core.operation.OperationId](updated.operationId)
186 27887 6448 - 6573 Apply io.circe.Json.toString io.circe.syntax.`package`.EncoderOps[scala.collection.Map[String,String]](scala.collection.Map.apply[String, String](scala.Predef.ArrowAssoc[String]("operationId").->[String](operation.operationId.value))).asJson(circe.this.Encoder.encodeMapLike[String, String, scala.collection.Map](circe.this.KeyEncoder.encodeKeyString, circe.this.Encoder.encodeString, scala.Predef.$conforms[scala.collection.Map[String,String]])).toString()
190 25881 6693 - 6771 Apply org.make.api.operation.PersistentOperationService.count DefaultOperationServiceComponent.this.persistentOperationService.count(slug, operationKinds)