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.user
21 
22 import akka.actor.typed.{ActorSystem, Behavior}
23 import akka.util.Timeout
24 import grizzled.slf4j.Logging
25 import org.make.api.technical.KafkaConsumerBehavior.Protocol
26 import org.make.api.technical.{KafkaConsumerBehavior, TimeSettings}
27 import org.make.api.userhistory._
28 
29 import scala.concurrent.ExecutionContext.Implicits.global
30 import scala.concurrent.Future
31 
32 class UserHistoryConsumerBehavior(
33   userHistoryCoordinatorService: UserHistoryCoordinatorService,
34   userService: UserService
35 ) extends KafkaConsumerBehavior[UserEventWrapper]
36     with Logging {
37 
38   override protected val topicKey: String = UserProducerBehavior.topicKey
39   override val groupId = "user-history"
40 
41   implicit val timeout: Timeout = TimeSettings.defaultTimeout
42 
43   override def handleMessage(message: UserEventWrapper)(system: ActorSystem[_]): Future[Unit] = {
44     message.event match {
45       case event: ResetPasswordEvent              => doNothing(event)
46       case event: UserRegisteredEvent             => handleUserRegisteredEvent(event)
47       case event: UserConnectedEvent              => handleUserConnectedEvent(event)
48       case event: UserUpdatedTagEvent             => doNothing(event)
49       case event: ResendValidationEmailEvent      => doNothing(event)
50       case event: UserValidatedAccountEvent       => doNothing(event)
51       case event: OrganisationRegisteredEvent     => doNothing(event)
52       case event: OrganisationUpdatedEvent        => doNothing(event)
53       case event: OrganisationEmailChangedEvent   => handleOrganisationEmailChangedEvent(event)
54       case event: PersonalityEmailChangedEvent    => handlePersonalityEmailChangedEvent(event)
55       case event: OrganisationInitializationEvent => doNothing(event)
56       case event: UserUpdatedOptInNewsletterEvent => handleUserUpdatedOptInNewsletterEvent(event)
57       case event: UserAnonymizedEvent             => handleUserAnonymizedEvent(event)
58       case event: UserFollowEvent                 => doNothing(event)
59       case event: UserUnfollowEvent               => doNothing(event)
60       case event: UserUploadAvatarEvent           => doNothing(event)
61       case event: PersonalityRegisteredEvent      => doNothing(event)
62       case event: VoteOnlyEvent                   => doNothing(event)
63       case event: VoteOnlyTestEvent               => doNothing(event)
64     }
65   }
66 
67   def handleUserRegisteredEvent(event: UserRegisteredEvent): Future[Unit] = {
68     userHistoryCoordinatorService.logHistory(
69       LogRegisterCitizenEvent(
70         userId = event.userId,
71         requestContext = event.requestContext,
72         action = UserAction(
73           date = event.eventDate,
74           actionType = LogRegisterCitizenEvent.action,
75           arguments = UserRegistered(firstName = event.firstName, country = event.country)
76         )
77       )
78     )
79 
80     Future.unit
81   }
82 
83   def handleUserConnectedEvent(event: UserConnectedEvent): Future[Unit] = {
84     userService.getUser(event.userId).map {
85       case Some(_) =>
86         userHistoryCoordinatorService.logHistory(
87           LogUserConnectedEvent(
88             userId = event.userId,
89             requestContext = event.requestContext,
90             action = UserAction(
91               date = event.eventDate,
92               actionType = LogUserConnectedEvent.action,
93               arguments = UserHasConnected()
94             )
95           )
96         )
97       case None =>
98         warn(s"User not found after UserConnectedEvent: $event")
99     }
100   }
101 
102   def handleUserUpdatedOptInNewsletterEvent(event: UserUpdatedOptInNewsletterEvent): Future[Unit] = {
103     if (event.optInNewsletter) {
104       userHistoryCoordinatorService.logHistory(
105         LogUserOptInNewsletterEvent(
106           userId = event.userId,
107           requestContext = event.requestContext,
108           action = UserAction(
109             date = event.eventDate,
110             actionType = LogUserOptInNewsletterEvent.action,
111             arguments = UserUpdatedOptIn(newOptIn = event.optInNewsletter)
112           )
113         )
114       )
115     } else {
116       userHistoryCoordinatorService.logHistory(
117         LogUserOptOutNewsletterEvent(
118           userId = event.userId,
119           requestContext = event.requestContext,
120           action = UserAction(
121             date = event.eventDate,
122             actionType = LogUserOptOutNewsletterEvent.action,
123             arguments = UserUpdatedOptIn(newOptIn = event.optInNewsletter)
124           )
125         )
126       )
127     }
128 
129     Future.unit
130   }
131 
132   def handleUserAnonymizedEvent(event: UserAnonymizedEvent): Future[Unit] = {
133     userHistoryCoordinatorService.logHistory(
134       LogUserAnonymizedEvent(
135         userId = event.userId,
136         requestContext = event.requestContext,
137         action = UserAction(
138           date = event.eventDate,
139           actionType = LogUserAnonymizedEvent.action,
140           arguments = UserAnonymized(userId = event.userId, adminId = event.adminId, mode = event.mode)
141         )
142       )
143     )
144 
145     Future.unit
146   }
147 
148   def handleOrganisationEmailChangedEvent(event: OrganisationEmailChangedEvent): Future[Unit] = {
149     userHistoryCoordinatorService.logHistory(
150       LogOrganisationEmailChangedEvent(
151         userId = event.userId,
152         requestContext = event.requestContext,
153         action = UserAction(
154           date = event.eventDate,
155           actionType = LogOrganisationEmailChangedEvent.action,
156           arguments = OrganisationEmailChanged(oldEmail = event.oldEmail, newEmail = event.newEmail)
157         )
158       )
159     )
160 
161     Future.unit
162   }
163 
164   def handlePersonalityEmailChangedEvent(event: PersonalityEmailChangedEvent): Future[Unit] = {
165     userHistoryCoordinatorService.logHistory(
166       LogPersonalityEmailChangedEvent(
167         userId = event.userId,
168         requestContext = event.requestContext,
169         action = UserAction(
170           date = event.eventDate,
171           actionType = LogPersonalityEmailChangedEvent.action,
172           arguments = PersonalityEmailChanged(oldEmail = event.oldEmail, newEmail = event.newEmail)
173         )
174       )
175     )
176 
177     Future.unit
178   }
179 }
180 
181 object UserHistoryConsumerBehavior {
182   def apply(
183     userHistoryCoordinatorService: UserHistoryCoordinatorService,
184     userService: UserService
185   ): Behavior[Protocol] =
186     new UserHistoryConsumerBehavior(userHistoryCoordinatorService, userService)
187       .createBehavior(name)
188   val name: String = "user-history-consumer"
189 }
Line Stmt Id Pos Tree Symbol Tests Code
38 5723 1369 - 1398 Select org.make.api.user.UserProducerBehavior.topicKey UserProducerBehavior.topicKey
39 7147 1424 - 1438 Literal <nosymbol> "user-history"
41 6643 1474 - 1501 Select org.make.api.technical.TimeSettings.defaultTimeout org.make.api.technical.TimeSettings.defaultTimeout
44 5827 1605 - 1618 Select org.make.api.userhistory.UserEventWrapper.event message.event
45 7210 1680 - 1696 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
46 6437 1750 - 1782 Apply org.make.api.user.UserHistoryConsumerBehavior.handleUserRegisteredEvent UserHistoryConsumerBehavior.this.handleUserRegisteredEvent(event)
47 6055 1836 - 1867 Apply org.make.api.user.UserHistoryConsumerBehavior.handleUserConnectedEvent UserHistoryConsumerBehavior.this.handleUserConnectedEvent(event)
48 7343 1921 - 1937 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
49 6510 1991 - 2007 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
50 5778 2061 - 2077 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
51 7151 2131 - 2147 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
52 6746 2201 - 2217 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
53 5811 2271 - 2313 Apply org.make.api.user.UserHistoryConsumerBehavior.handleOrganisationEmailChangedEvent UserHistoryConsumerBehavior.this.handleOrganisationEmailChangedEvent(event)
54 7305 2367 - 2408 Apply org.make.api.user.UserHistoryConsumerBehavior.handlePersonalityEmailChangedEvent UserHistoryConsumerBehavior.this.handlePersonalityEmailChangedEvent(event)
55 6477 2462 - 2478 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
56 7758 2532 - 2576 Apply org.make.api.user.UserHistoryConsumerBehavior.handleUserUpdatedOptInNewsletterEvent UserHistoryConsumerBehavior.this.handleUserUpdatedOptInNewsletterEvent(event)
57 7349 2630 - 2662 Apply org.make.api.user.UserHistoryConsumerBehavior.handleUserAnonymizedEvent UserHistoryConsumerBehavior.this.handleUserAnonymizedEvent(event)
58 6564 2716 - 2732 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
59 5780 2786 - 2802 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
60 7143 2856 - 2872 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
61 6751 2926 - 2942 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
62 5816 2996 - 3012 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
63 7276 3066 - 3082 Apply org.make.api.technical.KafkaConsumerBehavior.doNothing UserHistoryConsumerBehavior.this.doNothing(event)
68 6465 3176 - 3559 Apply org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogRegisterCitizenEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserRegistered](event.eventDate, org.make.api.userhistory.LogRegisterCitizenEvent.action, org.make.api.userhistory.UserRegistered.apply(event.firstName, event.country))))
69 7280 3224 - 3553 Apply org.make.api.userhistory.LogRegisterCitizenEvent.apply org.make.api.userhistory.LogRegisterCitizenEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserRegistered](event.eventDate, org.make.api.userhistory.LogRegisterCitizenEvent.action, org.make.api.userhistory.UserRegistered.apply(event.firstName, event.country)))
70 6478 3266 - 3278 Select org.make.api.userhistory.UserRegisteredEvent.userId event.userId
71 7836 3305 - 3325 Select org.make.api.userhistory.UserRegisteredEvent.requestContext event.requestContext
72 5840 3344 - 3545 Apply org.make.api.userhistory.UserAction.apply org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserRegistered](event.eventDate, org.make.api.userhistory.LogRegisterCitizenEvent.action, org.make.api.userhistory.UserRegistered.apply(event.firstName, event.country))
73 7445 3373 - 3388 Select org.make.api.userhistory.UserRegisteredEvent.eventDate event.eventDate
74 6567 3413 - 3443 Select org.make.api.userhistory.LogRegisterCitizenEvent.action org.make.api.userhistory.LogRegisterCitizenEvent.action
75 6707 3467 - 3535 Apply org.make.api.userhistory.UserRegistered.apply org.make.api.userhistory.UserRegistered.apply(event.firstName, event.country)
75 7146 3521 - 3534 Select org.make.api.userhistory.UserRegisteredEvent.country event.country
75 5761 3494 - 3509 Select org.make.api.userhistory.UserRegisteredEvent.firstName event.firstName
80 7825 3565 - 3576 Select scala.concurrent.Future.unit scala.concurrent.Future.unit
84 7383 3682 - 3694 Select org.make.api.userhistory.UserConnectedEvent.userId event.userId
84 6497 3700 - 3700 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
84 5728 3662 - 4191 ApplyToImplicitArgs scala.concurrent.Future.map UserHistoryConsumerBehavior.this.userService.getUser(event.userId).map[Unit](((x0$1: Option[org.make.core.user.User]) => x0$1 match { case (value: org.make.core.user.User): Some[org.make.core.user.User](_) => UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogUserConnectedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserHasConnected](event.eventDate, org.make.api.userhistory.LogUserConnectedEvent.action, org.make.api.userhistory.UserHasConnected.apply()))) case scala.None => UserHistoryConsumerBehavior.this.warn(("User not found after UserConnectedEvent: ".+(event): String)) }))(scala.concurrent.ExecutionContext.Implicits.global)
86 7826 3732 - 4101 Apply org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogUserConnectedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserHasConnected](event.eventDate, org.make.api.userhistory.LogUserConnectedEvent.action, org.make.api.userhistory.UserHasConnected.apply())))
87 6399 3784 - 4091 Apply org.make.api.userhistory.LogUserConnectedEvent.apply org.make.api.userhistory.LogUserConnectedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserHasConnected](event.eventDate, org.make.api.userhistory.LogUserConnectedEvent.action, org.make.api.userhistory.UserHasConnected.apply()))
88 6533 3828 - 3840 Select org.make.api.userhistory.UserConnectedEvent.userId event.userId
89 5763 3871 - 3891 Select org.make.api.userhistory.UserConnectedEvent.requestContext event.requestContext
90 7243 3914 - 4079 Apply org.make.api.userhistory.UserAction.apply org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserHasConnected](event.eventDate, org.make.api.userhistory.LogUserConnectedEvent.action, org.make.api.userhistory.UserHasConnected.apply())
91 7149 3947 - 3962 Select org.make.api.userhistory.UserConnectedEvent.eventDate event.eventDate
92 6285 3991 - 4019 Select org.make.api.userhistory.LogUserConnectedEvent.action org.make.api.userhistory.LogUserConnectedEvent.action
93 5810 4047 - 4065 Apply org.make.api.userhistory.UserHasConnected.apply org.make.api.userhistory.UserHasConnected.apply()
98 7437 4129 - 4185 Apply grizzled.slf4j.Logging.warn UserHistoryConsumerBehavior.this.warn(("User not found after UserConnectedEvent: ".+(event): String))
103 7113 4307 - 4328 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.optInNewsletter event.optInNewsletter
104 7118 4338 - 4731 Apply org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogUserOptInNewsletterEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserUpdatedOptIn](event.eventDate, org.make.api.userhistory.LogUserOptInNewsletterEvent.action, org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter))))
104 6334 4338 - 4731 Block org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogUserOptInNewsletterEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserUpdatedOptIn](event.eventDate, org.make.api.userhistory.LogUserOptInNewsletterEvent.action, org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter))))
105 5760 4388 - 4723 Apply org.make.api.userhistory.LogUserOptInNewsletterEvent.apply org.make.api.userhistory.LogUserOptInNewsletterEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserUpdatedOptIn](event.eventDate, org.make.api.userhistory.LogUserOptInNewsletterEvent.action, org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter)))
106 6286 4436 - 4448 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.userId event.userId
107 5908 4477 - 4497 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.requestContext event.requestContext
108 6607 4518 - 4713 Apply org.make.api.userhistory.UserAction.apply org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserUpdatedOptIn](event.eventDate, org.make.api.userhistory.LogUserOptInNewsletterEvent.action, org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter))
109 7190 4549 - 4564 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.eventDate event.eventDate
110 6401 4591 - 4625 Select org.make.api.userhistory.LogUserOptInNewsletterEvent.action org.make.api.userhistory.LogUserOptInNewsletterEvent.action
111 6928 4651 - 4701 Apply org.make.api.userhistory.UserUpdatedOptIn.apply org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter)
111 7803 4679 - 4700 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.optInNewsletter event.optInNewsletter
116 6339 4751 - 5146 Apply org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogUserOptOutNewsletterEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserUpdatedOptIn](event.eventDate, org.make.api.userhistory.LogUserOptOutNewsletterEvent.action, org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter))))
116 5869 4751 - 5146 Block org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogUserOptOutNewsletterEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserUpdatedOptIn](event.eventDate, org.make.api.userhistory.LogUserOptOutNewsletterEvent.action, org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter))))
117 7166 4801 - 5138 Apply org.make.api.userhistory.LogUserOptOutNewsletterEvent.apply org.make.api.userhistory.LogUserOptOutNewsletterEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserUpdatedOptIn](event.eventDate, org.make.api.userhistory.LogUserOptOutNewsletterEvent.action, org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter)))
118 5916 4850 - 4862 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.userId event.userId
119 7194 4891 - 4911 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.requestContext event.requestContext
120 5762 4932 - 5128 Apply org.make.api.userhistory.UserAction.apply org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserUpdatedOptIn](event.eventDate, org.make.api.userhistory.LogUserOptOutNewsletterEvent.action, org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter))
121 6464 4963 - 4978 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.eventDate event.eventDate
122 7806 5005 - 5040 Select org.make.api.userhistory.LogUserOptOutNewsletterEvent.action org.make.api.userhistory.LogUserOptOutNewsletterEvent.action
123 6615 5066 - 5116 Apply org.make.api.userhistory.UserUpdatedOptIn.apply org.make.api.userhistory.UserUpdatedOptIn.apply(event.optInNewsletter)
123 7031 5094 - 5115 Select org.make.api.userhistory.UserUpdatedOptInNewsletterEvent.optInNewsletter event.optInNewsletter
129 7241 5158 - 5169 Select scala.concurrent.Future.unit scala.concurrent.Future.unit
133 7801 5257 - 5651 Apply org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogUserAnonymizedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserAnonymized](event.eventDate, org.make.api.userhistory.LogUserAnonymizedEvent.action, org.make.api.userhistory.UserAnonymized.apply(event.userId, event.adminId, event.mode))))
134 6444 5305 - 5645 Apply org.make.api.userhistory.LogUserAnonymizedEvent.apply org.make.api.userhistory.LogUserAnonymizedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserAnonymized](event.eventDate, org.make.api.userhistory.LogUserAnonymizedEvent.action, org.make.api.userhistory.UserAnonymized.apply(event.userId, event.adminId, event.mode)))
135 6466 5346 - 5358 Select org.make.api.userhistory.UserAnonymizedEvent.userId event.userId
136 7798 5385 - 5405 Select org.make.api.userhistory.UserAnonymizedEvent.requestContext event.requestContext
137 7246 5424 - 5637 Apply org.make.api.userhistory.UserAction.apply org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.UserAnonymized](event.eventDate, org.make.api.userhistory.LogUserAnonymizedEvent.action, org.make.api.userhistory.UserAnonymized.apply(event.userId, event.adminId, event.mode))
138 7035 5453 - 5468 Select org.make.api.userhistory.UserAnonymizedEvent.eventDate event.eventDate
139 6621 5493 - 5522 Select org.make.api.userhistory.LogUserAnonymizedEvent.action org.make.api.userhistory.LogUserAnonymizedEvent.action
140 7727 5546 - 5627 Apply org.make.api.userhistory.UserAnonymized.apply org.make.api.userhistory.UserAnonymized.apply(event.userId, event.adminId, event.mode)
140 6267 5616 - 5626 Select org.make.api.userhistory.UserAnonymizedEvent.mode event.mode
140 7167 5594 - 5607 Select org.make.api.userhistory.UserAnonymizedEvent.adminId event.adminId
140 5727 5570 - 5582 Select org.make.api.userhistory.UserAnonymizedEvent.userId event.userId
145 6946 5657 - 5668 Select scala.concurrent.Future.unit scala.concurrent.Future.unit
149 6614 5776 - 6187 Apply org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogOrganisationEmailChangedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.OrganisationEmailChanged](event.eventDate, org.make.api.userhistory.LogOrganisationEmailChangedEvent.action, org.make.api.userhistory.OrganisationEmailChanged.apply(event.oldEmail, event.newEmail))))
150 6947 5824 - 6181 Apply org.make.api.userhistory.LogOrganisationEmailChangedEvent.apply org.make.api.userhistory.LogOrganisationEmailChangedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.OrganisationEmailChanged](event.eventDate, org.make.api.userhistory.LogOrganisationEmailChangedEvent.action, org.make.api.userhistory.OrganisationEmailChanged.apply(event.oldEmail, event.newEmail)))
151 6513 5875 - 5887 Select org.make.api.userhistory.OrganisationEmailChangedEvent.userId event.userId
152 5732 5914 - 5934 Select org.make.api.userhistory.OrganisationEmailChangedEvent.requestContext event.requestContext
153 7763 5953 - 6173 Apply org.make.api.userhistory.UserAction.apply org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.OrganisationEmailChanged](event.eventDate, org.make.api.userhistory.LogOrganisationEmailChangedEvent.action, org.make.api.userhistory.OrganisationEmailChanged.apply(event.oldEmail, event.newEmail))
154 7154 5982 - 5997 Select org.make.api.userhistory.OrganisationEmailChangedEvent.eventDate event.eventDate
155 6269 6022 - 6061 Select org.make.api.userhistory.LogOrganisationEmailChangedEvent.action org.make.api.userhistory.LogOrganisationEmailChangedEvent.action
156 6450 6085 - 6163 Apply org.make.api.userhistory.OrganisationEmailChanged.apply org.make.api.userhistory.OrganisationEmailChanged.apply(event.oldEmail, event.newEmail)
156 7640 6121 - 6135 Select org.make.api.userhistory.OrganisationEmailChangedEvent.oldEmail event.oldEmail
156 7213 6148 - 6162 Select org.make.api.userhistory.OrganisationEmailChangedEvent.newEmail event.newEmail
161 5692 6193 - 6204 Select scala.concurrent.Future.unit scala.concurrent.Future.unit
165 7183 6310 - 6718 Apply org.make.api.userhistory.UserHistoryCoordinatorService.logHistory UserHistoryConsumerBehavior.this.userHistoryCoordinatorService.logHistory(org.make.api.userhistory.LogPersonalityEmailChangedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.PersonalityEmailChanged](event.eventDate, org.make.api.userhistory.LogPersonalityEmailChangedEvent.action, org.make.api.userhistory.PersonalityEmailChanged.apply(event.oldEmail, event.newEmail))))
166 5786 6358 - 6712 Apply org.make.api.userhistory.LogPersonalityEmailChangedEvent.apply org.make.api.userhistory.LogPersonalityEmailChangedEvent.apply(event.userId, event.requestContext, org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.PersonalityEmailChanged](event.eventDate, org.make.api.userhistory.LogPersonalityEmailChangedEvent.action, org.make.api.userhistory.PersonalityEmailChanged.apply(event.oldEmail, event.newEmail)))
167 7073 6408 - 6420 Select org.make.api.userhistory.PersonalityEmailChangedEvent.userId event.userId
168 6272 6447 - 6467 Select org.make.api.userhistory.PersonalityEmailChangedEvent.requestContext event.requestContext
169 6198 6486 - 6704 Apply org.make.api.userhistory.UserAction.apply org.make.api.userhistory.UserAction.apply[org.make.api.userhistory.PersonalityEmailChanged](event.eventDate, org.make.api.userhistory.LogPersonalityEmailChangedEvent.action, org.make.api.userhistory.PersonalityEmailChanged.apply(event.oldEmail, event.newEmail))
170 7722 6515 - 6530 Select org.make.api.userhistory.PersonalityEmailChangedEvent.eventDate event.eventDate
171 7316 6555 - 6593 Select org.make.api.userhistory.LogPersonalityEmailChangedEvent.action org.make.api.userhistory.LogPersonalityEmailChangedEvent.action
172 7766 6679 - 6693 Select org.make.api.userhistory.PersonalityEmailChangedEvent.newEmail event.newEmail
172 6949 6617 - 6694 Apply org.make.api.userhistory.PersonalityEmailChanged.apply org.make.api.userhistory.PersonalityEmailChanged.apply(event.oldEmail, event.newEmail)
172 6409 6652 - 6666 Select org.make.api.userhistory.PersonalityEmailChangedEvent.oldEmail event.oldEmail
177 6246 6724 - 6735 Select scala.concurrent.Future.unit scala.concurrent.Future.unit
187 7725 7016 - 7020 Select org.make.api.user.UserHistoryConsumerBehavior.name UserHistoryConsumerBehavior.this.name
187 7285 6918 - 7021 Apply org.make.api.technical.KafkaConsumerBehavior.createBehavior new UserHistoryConsumerBehavior(userHistoryCoordinatorService, userService).createBehavior(UserHistoryConsumerBehavior.this.name)
188 6442 7043 - 7066 Literal <nosymbol> "user-history-consumer"