diff --git a/api/src/main/scala/app/softnetwork/notification/api/AllNotificationsApi.scala b/api/src/main/scala/app/softnetwork/notification/api/AllNotificationsApi.scala index 4afe3c1..c5b7b6b 100644 --- a/api/src/main/scala/app/softnetwork/notification/api/AllNotificationsApi.scala +++ b/api/src/main/scala/app/softnetwork/notification/api/AllNotificationsApi.scala @@ -14,6 +14,7 @@ import app.softnetwork.notification.persistence.typed.{ } import app.softnetwork.persistence.jdbc.query.{JdbcJournalProvider, JdbcSchema, JdbcSchemaProvider} import app.softnetwork.scheduler.api.SchedulerApi +import app.softnetwork.scheduler.config.SchedulerSettings trait AllNotificationsApi extends SchedulerApi with NotificationApplication[Notification] { @@ -28,7 +29,7 @@ trait AllNotificationsApi extends SchedulerApi with NotificationApplication[Noti with AllNotificationsHandler with JdbcJournalProvider with JdbcSchemaProvider { - override val tag = s"${AllNotificationsBehavior.persistenceId}-scheduler" + override val tag: String = SchedulerSettings.tag(AllNotificationsBehavior.persistenceId) override lazy val schemaType: JdbcSchema.SchemaType = jdbcSchemaType override implicit val system: ActorSystem[_] = sys } diff --git a/build.sbt b/build.sbt index 06dc6e6..2109c70 100644 --- a/build.sbt +++ b/build.sbt @@ -31,7 +31,7 @@ ThisBuild / organization := "app.softnetwork" name := "notification" -ThisBuild / version := "0.1.6.2" +ThisBuild / version := "0.2.0" ThisBuild / scalaVersion := "2.12.15" diff --git a/common/src/main/protobuf/api/notification.proto b/common/src/main/protobuf/api/notification.proto index 1a0ba6c..dff6749 100644 --- a/common/src/main/protobuf/api/notification.proto +++ b/common/src/main/protobuf/api/notification.proto @@ -22,15 +22,15 @@ service NotificationServiceApi { } message AddMailRequest{ - org.softnetwork.notification.model.Mail mail = 1; + app.softnetwork.notification.model.Mail mail = 1; } message AddSMSRequest{ - org.softnetwork.notification.model.SMS sms = 1; + app.softnetwork.notification.model.SMS sms = 1; } message AddPushRequest{ - org.softnetwork.notification.model.Push push = 1; + app.softnetwork.notification.model.Push push = 1; } message AddNotificationResponse{ @@ -46,19 +46,19 @@ message RemoveNotificationResponse{ } message SendMailRequest{ - org.softnetwork.notification.model.Mail mail = 1; + app.softnetwork.notification.model.Mail mail = 1; } message SendSMSRequest{ - org.softnetwork.notification.model.SMS sms = 1; + app.softnetwork.notification.model.SMS sms = 1; } message SendPushRequest{ - org.softnetwork.notification.model.Push push = 1; + app.softnetwork.notification.model.Push push = 1; } message SendNotificationResponse{ - repeated org.softnetwork.notification.model.NotificationStatusResult results = 1; + repeated app.softnetwork.notification.model.NotificationStatusResult results = 1; } message GetNotificationStatusRequest{ @@ -66,5 +66,5 @@ message GetNotificationStatusRequest{ } message GetNotificationStatusResponse{ - repeated org.softnetwork.notification.model.NotificationStatusResult results = 1; + repeated app.softnetwork.notification.model.NotificationStatusResult results = 1; } diff --git a/common/src/main/protobuf/message/notification.proto b/common/src/main/protobuf/message/notification.proto index 356883b..5337ea9 100644 --- a/common/src/main/protobuf/message/notification.proto +++ b/common/src/main/protobuf/message/notification.proto @@ -2,44 +2,32 @@ syntax = "proto2"; import "scalapb/scalapb.proto"; import "model/notifications.proto"; -import "message/schedule.proto"; -package org.softnetwork.notification.message; +package app.softnetwork.notification.message; option (scalapb.options) = { single_file: true flat_package: true import: "app.softnetwork.persistence.message._" - import: "org.softnetwork.akka.message.SchedulerEvents._" import: "app.softnetwork.persistence.model._" - import: "app.softnetwork.notification.message._" + import: "app.softnetwork.scheduler.message.SchedulerEvents._" import: "app.softnetwork.notification.model._" - import: "org.softnetwork.notification.model._" - preamble: "sealed trait NotificationEvent extends Event{def uuid: String}" - preamble: "sealed trait NotificationRecordedEvent[T<:Notification] extends NotificationEvent{def notification: T; val uuid = notification.uuid}" - preamble: "sealed trait NotificationToSchedulerEvent extends SchedulerEventWithCommand with NotificationEvent with Entity {val uuid = ALL_KEY}" - preamble: "trait NotificationCommandEvent extends NotificationEvent" - preamble: "trait AddNotificationCommandEvent extends NotificationCommandEvent {def notification: Notification; val uuid = notification.uuid}" - preamble: "trait WrapNotificationCommandEvent extends NotificationCommandEvent {def event: NotificationCommandEvent; lazy val uuid = event.uuid}" + preamble: "sealed trait NotificationEvent extends ExternalSchedulerEvent" + preamble: "trait ExternalNotificationEvent extends NotificationEvent" + preamble: "trait NotificationCommandEvent extends ExternalNotificationEvent {def command: Option[NotificationCommand]}" + preamble: "trait AddNotificationCommandEvent extends ExternalNotificationEvent {def notification: Notification}" preserve_unknown_fields: false }; -message MailRecordedEvent{ +message NotificationRecordedEvent { option (scalapb.message).extends = "ProtobufEvent"; - option (scalapb.message).extends = "NotificationRecordedEvent[Mail]"; - required org.softnetwork.notification.model.Mail notification = 1; -} - -message SMSRecordedEvent{ - option (scalapb.message).extends = "ProtobufEvent"; - option (scalapb.message).extends = "NotificationRecordedEvent[SMS]"; - required org.softnetwork.notification.model.SMS notification = 1; -} - -message PushRecordedEvent{ - option (scalapb.message).extends = "ProtobufEvent"; - option (scalapb.message).extends = "NotificationRecordedEvent[Push]"; - required org.softnetwork.notification.model.Push notification = 1; + option (scalapb.message).extends = "NotificationEvent"; + option (scalapb.message).extends = "NotificationRecordedEventDecorator"; + oneof wrapped { + app.softnetwork.notification.model.Mail mail = 1; + app.softnetwork.notification.model.SMS sms = 2; + app.softnetwork.notification.model.Push push = 3; + } } message NotificationRemovedEvent{ @@ -48,38 +36,38 @@ message NotificationRemovedEvent{ required string uuid = 1; } -message ScheduleForNotificationAdded{ +message ExternalEntityToNotificationEvent{ option (scalapb.message).extends = "ProtobufEvent"; - option (scalapb.message).extends = "NotificationToSchedulerEvent"; - required app.softnetwork.scheduler.message.AddSchedule command = 1; -} - -message ScheduleForNotificationRemoved{ - option (scalapb.message).extends = "ProtobufEvent"; - option (scalapb.message).extends = "NotificationToSchedulerEvent"; - required app.softnetwork.scheduler.message.RemoveSchedule command = 1; + option (scalapb.message).extends = "NotificationEvent"; + option (scalapb.message).extends = "ExternalEntityToNotificationEventDecorator"; + oneof wrapped { + app.softnetwork.notification.message.AddMailCommandEvent addMail = 1; + app.softnetwork.notification.message.AddSMSCommandEvent addSMS = 2; + app.softnetwork.notification.message.AddPushCommandEvent addPush = 3; + app.softnetwork.notification.message.RemoveNotificationCommandEvent removeNotification = 4; + } } message AddMailCommandEvent{ option (scalapb.message).extends = "ProtobufEvent"; option (scalapb.message).extends = "AddNotificationCommandEvent"; - required org.softnetwork.notification.model.Mail notification = 1; + required app.softnetwork.notification.model.Mail notification = 1; } message AddSMSCommandEvent{ option (scalapb.message).extends = "ProtobufEvent"; option (scalapb.message).extends = "AddNotificationCommandEvent"; - required org.softnetwork.notification.model.SMS notification = 1; + required app.softnetwork.notification.model.SMS notification = 1; } message AddPushCommandEvent{ option (scalapb.message).extends = "ProtobufEvent"; option (scalapb.message).extends = "AddNotificationCommandEvent"; - required org.softnetwork.notification.model.Push notification = 1; + required app.softnetwork.notification.model.Push notification = 1; } message RemoveNotificationCommandEvent{ option (scalapb.message).extends = "ProtobufEvent"; - option (scalapb.message).extends = "NotificationCommandEvent"; + option (scalapb.message).extends = "ExternalNotificationEvent"; required string uuid = 1; } \ No newline at end of file diff --git a/common/src/main/protobuf/model/notificationType.proto b/common/src/main/protobuf/model/notificationType.proto index cf2f6d8..34f6f38 100644 --- a/common/src/main/protobuf/model/notificationType.proto +++ b/common/src/main/protobuf/model/notificationType.proto @@ -2,7 +2,7 @@ syntax = "proto2"; import "scalapb/scalapb.proto"; -package org.softnetwork.notification.model; +package app.softnetwork.notification.model; option (scalapb.options) = { single_file: true diff --git a/common/src/main/protobuf/model/notifications.proto b/common/src/main/protobuf/model/notifications.proto index 9800826..ba582b9 100644 --- a/common/src/main/protobuf/model/notifications.proto +++ b/common/src/main/protobuf/model/notifications.proto @@ -5,7 +5,7 @@ import "model/platform.proto"; import "model/notificationType.proto"; import "google/protobuf/timestamp.proto"; -package org.softnetwork.notification.model; +package app.softnetwork.notification.model; option (scalapb.options) = { single_file: true @@ -14,7 +14,6 @@ option (scalapb.options) = { import: "app.softnetwork.persistence.model._" import: "app.softnetwork.serialization._" import: "app.softnetwork.protobuf.ScalaPBTypeMappers._" - import: "app.softnetwork.notification.model._" preserve_unknown_fields: false }; @@ -133,12 +132,12 @@ message Push{ required string id = 21 [default = ""]; required int32 badge = 22 [default = 0]; optional string sound = 23; - optional string app = 24; + optional string application = 24; } message PushPayload{ option (scalapb.message).extends = "ProtobufDomainObject"; - required string app = 1; + required string application = 1; required string title = 2; required string body = 3; required int32 badge = 4 [default = 0]; diff --git a/common/src/main/protobuf/model/platform.proto b/common/src/main/protobuf/model/platform.proto index 0b95598..c64be03 100644 --- a/common/src/main/protobuf/model/platform.proto +++ b/common/src/main/protobuf/model/platform.proto @@ -2,7 +2,7 @@ syntax = "proto2"; import "scalapb/scalapb.proto"; -package org.softnetwork.notification.model; +package app.softnetwork.notification.model; option (scalapb.options) = { single_file: true diff --git a/common/src/main/scala/app/softnetwork/notification/api/NotificationClient.scala b/common/src/main/scala/app/softnetwork/notification/api/NotificationClient.scala index ca65aa1..5898082 100644 --- a/common/src/main/scala/app/softnetwork/notification/api/NotificationClient.scala +++ b/common/src/main/scala/app/softnetwork/notification/api/NotificationClient.scala @@ -3,7 +3,7 @@ package app.softnetwork.notification.api import akka.actor.typed.ActorSystem import akka.grpc.GrpcClientSettings import app.softnetwork.api.server.client.{GrpcClient, GrpcClientFactory} -import org.softnetwork.notification.model.{Mail, NotificationStatusResult, Push, SMS} +import app.softnetwork.notification.model.{Mail, NotificationStatusResult, Push, SMS} import scala.concurrent.Future diff --git a/common/src/main/scala/app/softnetwork/notification/message/package.scala b/common/src/main/scala/app/softnetwork/notification/message/package.scala index 4e0c050..c4bc68c 100644 --- a/common/src/main/scala/app/softnetwork/notification/message/package.scala +++ b/common/src/main/scala/app/softnetwork/notification/message/package.scala @@ -1,9 +1,9 @@ package app.softnetwork.notification import app.softnetwork.persistence.message._ -import org.softnetwork.akka.model.Schedule +import app.softnetwork.scheduler.model.Schedule import app.softnetwork.notification.model.Notification -import org.softnetwork.notification.model.NotificationStatusResult +import app.softnetwork.notification.model.NotificationStatusResult /** Created by smanciot on 15/04/2020. */ @@ -89,4 +89,30 @@ package object message { case object Schedule4NotificationNotTriggered extends NotificationErrorMessage("Schedule4NotificationNotTriggered") + + trait NotificationRecordedEventDecorator { _: NotificationRecordedEvent => + def notification: Option[Notification] = + wrapped match { + case r: NotificationRecordedEvent.Wrapped.Mail => Some(r.value) + case r: NotificationRecordedEvent.Wrapped.Sms => Some(r.value) + case r: NotificationRecordedEvent.Wrapped.Push => Some(r.value) + case _ => None + } + } + + trait ExternalEntityToNotificationEventDecorator extends NotificationCommandEvent { + _: ExternalEntityToNotificationEvent => + override def command: Option[NotificationCommand] = + wrapped match { + case r: ExternalEntityToNotificationEvent.Wrapped.AddMail => + Some(AddNotification(r.value.notification)) + case r: ExternalEntityToNotificationEvent.Wrapped.AddSMS => + Some(AddNotification(r.value.notification)) + case r: ExternalEntityToNotificationEvent.Wrapped.AddPush => + Some(AddNotification(r.value.notification)) + case r: ExternalEntityToNotificationEvent.Wrapped.RemoveNotification => + Some(RemoveNotification(r.value.uuid)) + case _ => None + } + } } diff --git a/common/src/main/scala/app/softnetwork/notification/model/Notification.scala b/common/src/main/scala/app/softnetwork/notification/model/Notification.scala index 00c7294..e863f46 100644 --- a/common/src/main/scala/app/softnetwork/notification/model/Notification.scala +++ b/common/src/main/scala/app/softnetwork/notification/model/Notification.scala @@ -4,7 +4,7 @@ import java.util.Date import app.softnetwork.persistence.model.State -import org.softnetwork.notification.model._ +import app.softnetwork.notification.model._ import scala.language.reflectiveCalls diff --git a/common/src/main/scala/app/softnetwork/notification/serialization/package.scala b/common/src/main/scala/app/softnetwork/notification/serialization/package.scala index 67d6dc3..db127d2 100644 --- a/common/src/main/scala/app/softnetwork/notification/serialization/package.scala +++ b/common/src/main/scala/app/softnetwork/notification/serialization/package.scala @@ -4,7 +4,7 @@ import app.softnetwork.protobuf.ScalaPBSerializers import ScalaPBSerializers.GeneratedEnumSerializer import app.softnetwork.serialization._ import org.json4s.Formats -import org.softnetwork.notification.model.{MailType, NotificationStatus, NotificationType, Platform} +import app.softnetwork.notification.model.{MailType, NotificationStatus, NotificationType, Platform} import scala.language.implicitConversions diff --git a/common/src/main/scala/app/softnetwork/notification/spi/package.scala b/common/src/main/scala/app/softnetwork/notification/spi/package.scala index a11a8da..1c50cad 100644 --- a/common/src/main/scala/app/softnetwork/notification/spi/package.scala +++ b/common/src/main/scala/app/softnetwork/notification/spi/package.scala @@ -2,7 +2,7 @@ package app.softnetwork.notification import akka.actor.typed.ActorSystem import app.softnetwork.notification.model.Notification -import org.softnetwork.notification.model.{ +import app.softnetwork.notification.model.{ Mail, NotificationAck, NotificationStatus, @@ -52,8 +52,10 @@ package object spi { implicit def toPushPayload(notification: Push): PushPayload = { PushPayload.defaultInstance - .withApp( - notification.app.getOrElse(notification.from.alias.getOrElse(notification.from.value)) + .withApplication( + notification.application.getOrElse( + notification.from.alias.getOrElse(notification.from.value) + ) ) .withTitle(notification.subject) .withBody(notification.message) diff --git a/core/src/main/scala/app/softnetwork/notification/launch/NotificationApplication.scala b/core/src/main/scala/app/softnetwork/notification/launch/NotificationApplication.scala index 1703a8c..8100611 100644 --- a/core/src/main/scala/app/softnetwork/notification/launch/NotificationApplication.scala +++ b/core/src/main/scala/app/softnetwork/notification/launch/NotificationApplication.scala @@ -6,7 +6,7 @@ import app.softnetwork.api.server.launch.HealthCheckApplication import app.softnetwork.notification.api.NotificationServiceApiHandler import app.softnetwork.notification.model.Notification import app.softnetwork.persistence.query.SchemaProvider -import app.softnetwork.schedule.api.SchedulerServiceApiHandler +import app.softnetwork.scheduler.api.SchedulerServiceApiHandler import scala.concurrent.Future diff --git a/core/src/main/scala/app/softnetwork/notification/persistence/query/NotificationCommandProcessorStream.scala b/core/src/main/scala/app/softnetwork/notification/persistence/query/NotificationCommandProcessorStream.scala index d20567a..8faef9d 100644 --- a/core/src/main/scala/app/softnetwork/notification/persistence/query/NotificationCommandProcessorStream.scala +++ b/core/src/main/scala/app/softnetwork/notification/persistence/query/NotificationCommandProcessorStream.scala @@ -6,18 +6,12 @@ import akka.persistence.typed.PersistenceId import app.softnetwork.notification.config.NotificationSettings import app.softnetwork.notification.handlers.NotificationHandler import app.softnetwork.notification.message.{ - AddNotification, NotificationAdded, - NotificationRemoved, - RemoveNotification -} -import app.softnetwork.persistence.query.{EventProcessorStream, JournalProvider} -import org.softnetwork.notification.message.{ - AddNotificationCommandEvent, NotificationCommandEvent, - RemoveNotificationCommandEvent, - WrapNotificationCommandEvent + NotificationRemoved } +import app.softnetwork.persistence.query.{EventProcessorStream, JournalProvider} +import app.softnetwork.notification.message.NotificationCommandEvent import scala.concurrent.Future @@ -49,30 +43,27 @@ trait NotificationCommandProcessorStream extends EventProcessorStream[Notificati sequenceNr: Long ): Future[Done] = { event match { - case evt: WrapNotificationCommandEvent => processEvent(evt.event, persistenceId, sequenceNr) - case evt: AddNotificationCommandEvent => - val command = AddNotification(evt.notification) - !?(command) map { - case _: NotificationAdded => - if (forTests) system.eventStream.tell(Publish(event)) - Done - case other => - logger.error( - s"$platformEventProcessorId - command $command returns unexpectedly ${other.getClass}" - ) - Done - } - case evt: RemoveNotificationCommandEvent => - val command = RemoveNotification(evt.uuid) - !?(command) map { - case NotificationRemoved => - if (forTests) system.eventStream.tell(Publish(event)) - Done - case other => + case evt: NotificationCommandEvent => + evt.command match { + case Some(command) => + !?(command) map { + case _: NotificationAdded => + if (forTests) system.eventStream.tell(Publish(event)) + Done + case NotificationRemoved => + if (forTests) system.eventStream.tell(Publish(event)) + Done + case other => + logger.error( + s"$platformEventProcessorId - command $command returns unexpectedly ${other.getClass}" + ) + Done + } + case _ => logger.error( - s"$platformEventProcessorId - command $command returns unexpectedly ${other.getClass}" + s"$platformEventProcessorId - no command" ) - Done + Future.successful(Done) } case other => logger.warn(s"$platformEventProcessorId does not support event [${other.getClass}]") diff --git a/core/src/main/scala/app/softnetwork/notification/persistence/query/Scheduler2NotificationProcessorStream.scala b/core/src/main/scala/app/softnetwork/notification/persistence/query/Scheduler2NotificationProcessorStream.scala index 0172329..e021656 100644 --- a/core/src/main/scala/app/softnetwork/notification/persistence/query/Scheduler2NotificationProcessorStream.scala +++ b/core/src/main/scala/app/softnetwork/notification/persistence/query/Scheduler2NotificationProcessorStream.scala @@ -1,7 +1,7 @@ package app.softnetwork.notification.persistence.query import akka.actor.typed.eventstream.EventStream.Publish -import org.softnetwork.akka.model.Schedule +import app.softnetwork.scheduler.model.Schedule import app.softnetwork.persistence.query.JournalProvider import app.softnetwork.scheduler.persistence.query.Scheduler2EntityProcessorStream import app.softnetwork.notification.handlers.NotificationHandler diff --git a/core/src/main/scala/app/softnetwork/notification/persistence/typed/MailNotificationsBehavior.scala b/core/src/main/scala/app/softnetwork/notification/persistence/typed/MailNotificationsBehavior.scala index a827e19..c53f386 100644 --- a/core/src/main/scala/app/softnetwork/notification/persistence/typed/MailNotificationsBehavior.scala +++ b/core/src/main/scala/app/softnetwork/notification/persistence/typed/MailNotificationsBehavior.scala @@ -3,7 +3,7 @@ package app.softnetwork.notification.persistence.typed import akka.actor.typed.ActorSystem import app.softnetwork.notification.config.{DefaultConfig, InternalConfig} import app.softnetwork.notification.spi.{MailProvider, SimpleMailProvider} -import org.softnetwork.notification.model.{Mail, NotificationAck} +import app.softnetwork.notification.model.{Mail, NotificationAck} trait MailNotificationsBehavior extends NotificationBehavior[Mail] { _: MailProvider => override def persistenceId: String = "MailNotification" diff --git a/core/src/main/scala/app/softnetwork/notification/persistence/typed/NotificationBehavior.scala b/core/src/main/scala/app/softnetwork/notification/persistence/typed/NotificationBehavior.scala index b7f0647..49b215a 100644 --- a/core/src/main/scala/app/softnetwork/notification/persistence/typed/NotificationBehavior.scala +++ b/core/src/main/scala/app/softnetwork/notification/persistence/typed/NotificationBehavior.scala @@ -6,25 +6,33 @@ import akka.actor.typed.{ActorRef, ActorSystem} import akka.persistence.typed.scaladsl.Effect import app.softnetwork.notification.config.NotificationSettings import org.slf4j.Logger -import org.softnetwork.akka.message.SchedulerEvents.SchedulerEventWithCommand +import app.softnetwork.scheduler.message.SchedulerEvents.{ + ExternalEntityToSchedulerEvent, + ExternalSchedulerEvent, + SchedulerEventWithCommand +} import app.softnetwork.scheduler.message.{AddSchedule, RemoveSchedule} -import org.softnetwork.akka.model.Schedule +import app.softnetwork.scheduler.model.Schedule import app.softnetwork.persistence.now import app.softnetwork.persistence.typed._ import app.softnetwork.notification.message._ import app.softnetwork.notification.model._ import app.softnetwork.notification.spi.NotificationProvider -import org.softnetwork.notification.message._ -import org.softnetwork.notification.model._ +import app.softnetwork.notification.model._ import app.softnetwork.scheduler.config.SchedulerSettings -import org.softnetwork.notification.model.NotificationStatus._ +import app.softnetwork.notification.model.NotificationStatus._ import scala.language.{implicitConversions, postfixOps} /** Created by smanciot on 13/04/2020. */ trait NotificationBehavior[T <: Notification] - extends EntityBehavior[NotificationCommand, T, NotificationEvent, NotificationCommandResult] + extends EntityBehavior[ + NotificationCommand, + T, + ExternalSchedulerEvent, + NotificationCommandResult + ] with NotificationProvider { override type N = T @@ -47,7 +55,7 @@ trait NotificationBehavior[T <: Notification] * @return * event tags */ - override protected def tagEvent(entityId: String, event: NotificationEvent): Set[String] = { + override protected def tagEvent(entityId: String, event: ExternalSchedulerEvent): Set[String] = { event match { case _: SchedulerEventWithCommand => Set( @@ -75,7 +83,9 @@ trait NotificationBehavior[T <: Notification] command: NotificationCommand, replyTo: Option[ActorRef[NotificationCommandResult]], timers: TimerScheduler[NotificationCommand] - )(implicit context: ActorContext[NotificationCommand]): Effect[NotificationEvent, Option[T]] = { + )(implicit + context: ActorContext[NotificationCommand] + ): Effect[ExternalSchedulerEvent, Option[T]] = { implicit val log: Logger = context.log implicit val system: ActorSystem[Nothing] = context.system @@ -84,26 +94,28 @@ trait NotificationBehavior[T <: Notification] case cmd: AddNotification[T] => import cmd._ (notification match { - case n: Mail => Some(MailRecordedEvent(n)) - case n: SMS => Some(SMSRecordedEvent(n)) - case n: Push => Some(PushRecordedEvent(n)) + case n: Mail => Some(NotificationRecordedEvent.Wrapped.Mail(n)) + case n: SMS => Some(NotificationRecordedEvent.Wrapped.Sms(n)) + case n: Push => Some(NotificationRecordedEvent.Wrapped.Push(n)) case _ => None }) match { case Some(event) => Effect .persist( List( - event, - ScheduleForNotificationAdded( - AddSchedule( - Schedule( - persistenceId, - entityId, - notificationTimerKey, - delay, - Some(true), - Some(now()), - None + NotificationRecordedEvent(event), + ExternalEntityToSchedulerEvent( + ExternalEntityToSchedulerEvent.Wrapped.AddSchedule( + AddSchedule( + Schedule( + persistenceId, + entityId, + notificationTimerKey, + delay, + Some(true), + Some(now()), + None + ) ) ) ) @@ -120,11 +132,13 @@ trait NotificationBehavior[T <: Notification] NotificationRemovedEvent( entityId ), - ScheduleForNotificationRemoved( - RemoveSchedule( - persistenceId, - entityId, - notificationTimerKey + ExternalEntityToSchedulerEvent( + ExternalEntityToSchedulerEvent.Wrapped.RemoveSchedule( + RemoveSchedule( + persistenceId, + entityId, + notificationTimerKey + ) ) ) ) @@ -180,11 +194,13 @@ trait NotificationBehavior[T <: Notification] case _ => // should never be the case Effect .persist( - ScheduleForNotificationRemoved( - RemoveSchedule( - persistenceId, - entityId, - notificationTimerKey + ExternalEntityToSchedulerEvent( + ExternalEntityToSchedulerEvent.Wrapped.RemoveSchedule( + RemoveSchedule( + persistenceId, + entityId, + notificationTimerKey + ) ) ) ) @@ -202,20 +218,24 @@ trait NotificationBehavior[T <: Notification] * @return * new state */ - override def handleEvent(state: Option[T], event: NotificationEvent)(implicit + override def handleEvent(state: Option[T], event: ExternalSchedulerEvent)(implicit context: ActorContext[_] ): Option[T] = { import context._ event match { - case evt: NotificationRecordedEvent[T] => - log.info( - "Recording {}#{} in {} status with {} acknowledgment", - persistenceId, - evt.uuid, - evt.notification.status.name, - evt.notification.results - ) - Some(evt.notification) + case evt: NotificationRecordedEvent => + evt.notification match { + case Some(notification) => + log.info( + "Recording {}#{} in {} status with {} acknowledgment", + persistenceId, + notification.uuid, + notification.status.name, + notification.results + ) + Some(notification.asInstanceOf[T]) + case _ => None + } case evt: NotificationRemovedEvent => log.info(s"Removing $persistenceId#${evt.uuid}") @@ -225,38 +245,47 @@ trait NotificationBehavior[T <: Notification] } } - private[this] def scheduledNotificationEvent(entityId: String, notification: T) = { + private[this] def scheduledNotificationEvent( + entityId: String, + notification: T + ): ExternalEntityToSchedulerEvent = { import notification._ if (status.isSent || status.isDelivered) { // the notification has been sent/delivered - the schedule should be removed - ScheduleForNotificationRemoved( - RemoveSchedule( - persistenceId, - entityId, - notificationTimerKey + ExternalEntityToSchedulerEvent( + ExternalEntityToSchedulerEvent.Wrapped.RemoveSchedule( + RemoveSchedule( + persistenceId, + entityId, + notificationTimerKey + ) ) ) } else if ( maxTries > 0 && (nbTries < maxTries || (nbTries == maxTries && (status.isPending || status.isUnknownNotificationStatus))) ) { - ScheduleForNotificationAdded( - AddSchedule( - Schedule( - persistenceId, - entityId, - notificationTimerKey, - delay, - Some(true), - Some(now()), - None + ExternalEntityToSchedulerEvent( + ExternalEntityToSchedulerEvent.Wrapped.AddSchedule( + AddSchedule( + Schedule( + persistenceId, + entityId, + notificationTimerKey, + delay, + Some(true), + Some(now()), + None + ) ) ) ) } else { - ScheduleForNotificationRemoved( - RemoveSchedule( - persistenceId, - entityId, - notificationTimerKey + ExternalEntityToSchedulerEvent( + ExternalEntityToSchedulerEvent.Wrapped.RemoveSchedule( + RemoveSchedule( + persistenceId, + entityId, + notificationTimerKey + ) ) ) } @@ -266,7 +295,7 @@ trait NotificationBehavior[T <: Notification] _uuid: String, notification: T, replyTo: Option[ActorRef[NotificationCommandResult]] - )(implicit log: Logger, system: ActorSystem[_]): Effect[NotificationEvent, Option[T]] = { + )(implicit log: Logger, system: ActorSystem[_]): Effect[ExternalSchedulerEvent, Option[T]] = { import notification._ val notificationAck: NotificationAck = ackUuid match { case Some(_) => @@ -288,21 +317,21 @@ trait NotificationBehavior[T <: Notification] (notification match { case n: Mail => Some( - MailRecordedEvent(n.copyWithAck(notificationAck).asInstanceOf[Mail]) + NotificationRecordedEvent.Wrapped.Mail(n.copyWithAck(notificationAck).asInstanceOf[Mail]) ) case n: SMS => Some( - SMSRecordedEvent(n.copyWithAck(notificationAck).asInstanceOf[SMS]) + NotificationRecordedEvent.Wrapped.Sms(n.copyWithAck(notificationAck).asInstanceOf[SMS]) ) case n: Push => Some( - PushRecordedEvent(n.copyWithAck(notificationAck).asInstanceOf[Push]) + NotificationRecordedEvent.Wrapped.Push(n.copyWithAck(notificationAck).asInstanceOf[Push]) ) case _ => None }) match { case Some(event) => Effect - .persist(event) + .persist(NotificationRecordedEvent(event)) .thenRun(_ => { notificationAck.status match { @@ -326,7 +355,7 @@ trait NotificationBehavior[T <: Notification] )(implicit log: Logger, system: ActorSystem[_] - ): Effect[NotificationEvent, Option[T]] = { + ): Effect[ExternalSchedulerEvent, Option[T]] = { import notification._ val maybeAckWithNumberOfRetries: Option[(NotificationAck, Int)] = status match { case Sent | Delivered => None @@ -383,24 +412,30 @@ trait NotificationBehavior[T <: Notification] case _ => notification } - val event: Option[NotificationEvent] = + val event: Option[NotificationRecordedEvent] = notification match { case _: Mail => Some( - MailRecordedEvent(updatedNotification.asInstanceOf[Mail]) + NotificationRecordedEvent( + NotificationRecordedEvent.Wrapped.Mail(updatedNotification.asInstanceOf[Mail]) + ) ) case _: SMS => Some( - SMSRecordedEvent(updatedNotification.asInstanceOf[SMS]) + NotificationRecordedEvent( + NotificationRecordedEvent.Wrapped.Sms(updatedNotification.asInstanceOf[SMS]) + ) ) case _: Push => Some( - PushRecordedEvent(updatedNotification.asInstanceOf[Push]) + NotificationRecordedEvent( + NotificationRecordedEvent.Wrapped.Push(updatedNotification.asInstanceOf[Push]) + ) ) case _ => None } - val events: List[NotificationEvent] = + val events: List[ExternalSchedulerEvent] = List(event).flatten :+ scheduledNotificationEvent( entityId, updatedNotification.asInstanceOf[T] diff --git a/core/src/main/scala/app/softnetwork/notification/persistence/typed/PushNotificationsBehavior.scala b/core/src/main/scala/app/softnetwork/notification/persistence/typed/PushNotificationsBehavior.scala index e32d9eb..9cd0ca8 100644 --- a/core/src/main/scala/app/softnetwork/notification/persistence/typed/PushNotificationsBehavior.scala +++ b/core/src/main/scala/app/softnetwork/notification/persistence/typed/PushNotificationsBehavior.scala @@ -11,7 +11,7 @@ import app.softnetwork.notification.spi.{ IosProvider, PushProvider } -import org.softnetwork.notification.model.{NotificationAck, Push} +import app.softnetwork.notification.model.{NotificationAck, Push} trait PushNotificationsBehavior extends NotificationBehavior[Push] { _: PushProvider => override def send(notification: Push)(implicit system: ActorSystem[_]): NotificationAck = diff --git a/core/src/main/scala/app/softnetwork/notification/persistence/typed/SMSNotificationsBehavior.scala b/core/src/main/scala/app/softnetwork/notification/persistence/typed/SMSNotificationsBehavior.scala index 9fa7f18..e706171 100644 --- a/core/src/main/scala/app/softnetwork/notification/persistence/typed/SMSNotificationsBehavior.scala +++ b/core/src/main/scala/app/softnetwork/notification/persistence/typed/SMSNotificationsBehavior.scala @@ -3,7 +3,7 @@ package app.softnetwork.notification.persistence.typed import akka.actor.typed.ActorSystem import app.softnetwork.notification.config.{DefaultConfig, InternalConfig} import app.softnetwork.notification.spi.{SMSModeProvider, SMSProvider} -import org.softnetwork.notification.model.{NotificationAck, SMS} +import app.softnetwork.notification.model.{NotificationAck, SMS} trait SMSNotificationsBehavior extends NotificationBehavior[SMS] { _: SMSProvider => override def persistenceId: String = "SMSNotification" diff --git a/core/src/main/scala/app/softnetwork/notification/spi/ApnsProvider.scala b/core/src/main/scala/app/softnetwork/notification/spi/ApnsProvider.scala index d18900a..e0da5a0 100644 --- a/core/src/main/scala/app/softnetwork/notification/spi/ApnsProvider.scala +++ b/core/src/main/scala/app/softnetwork/notification/spi/ApnsProvider.scala @@ -12,7 +12,7 @@ import com.eatthepath.pushy.apns.util.{ SimpleApnsPushNotification } import com.typesafe.scalalogging.StrictLogging -import org.softnetwork.notification.model.{ +import app.softnetwork.notification.model.{ NotificationStatus, NotificationStatusResult, PushPayload @@ -31,17 +31,17 @@ trait ApnsProvider extends IosProvider with PushSettings with Completion with St system: ActorSystem[_] ): Seq[NotificationStatusResult] = { val config: ApnsConfig = - configs.get(payload.app) match { + configs.get(payload.application) match { case Some(config) => config case _ => - val apnsConfig: ApnsConfig = AppConfigs.get(payload.app).map(_.apns) match { + val apnsConfig: ApnsConfig = AppConfigs.get(payload.application).map(_.apns) match { case Some(apnsConfig) => apnsConfig case _ => DefaultConfig.apns } - configs = configs + (payload.app -> apnsConfig) + configs = configs + (payload.application -> apnsConfig) apnsConfig } - apns(config, client(payload.app, config), payload, devices, Seq.empty) + apns(config, client(payload.application, config), payload, devices, Seq.empty) } private[this] var clients: Map[String, ApnsClient] = Map.empty @@ -121,7 +121,7 @@ trait ApnsProvider extends IosProvider with PushSettings with Completion with St logger.info( s"""APNS -> about to send notification ${payload.title} - |\tfor ${payload.app} + |\tfor ${payload.application} |\tvia topic ${config.topic} |\tto token(s) [${tos.mkString(",")}] |\tusing keystore ${config.keystore.path}""".stripMargin diff --git a/core/src/main/scala/app/softnetwork/notification/spi/FcmProvider.scala b/core/src/main/scala/app/softnetwork/notification/spi/FcmProvider.scala index 18d6d11..0c9d05b 100644 --- a/core/src/main/scala/app/softnetwork/notification/spi/FcmProvider.scala +++ b/core/src/main/scala/app/softnetwork/notification/spi/FcmProvider.scala @@ -13,7 +13,7 @@ import com.google.firebase.messaging.{ } import com.google.firebase.{FirebaseApp, FirebaseOptions} import com.typesafe.scalalogging.StrictLogging -import org.softnetwork.notification.model.{ +import app.softnetwork.notification.model.{ NotificationStatus, NotificationStatusResult, PushPayload @@ -30,8 +30,8 @@ trait FcmProvider extends AndroidProvider with PushSettings with StrictLogging { system: ActorSystem[_] ): Seq[NotificationStatusResult] = { val config = - AppConfigs.get(payload.app).map(_.fcm).getOrElse(DefaultConfig.fcm) - val firebaseMessaging: FirebaseMessaging = messaging(payload.app, config) + AppConfigs.get(payload.application).map(_.fcm).getOrElse(DefaultConfig.fcm) + val firebaseMessaging: FirebaseMessaging = messaging(payload.application, config) fcm(config, firebaseMessaging, payload, devices, Seq.empty) } @@ -91,7 +91,7 @@ trait FcmProvider extends AndroidProvider with PushSettings with StrictLogging { logger.info( s"""FCM -> about to send notification ${payload.title} - |\tfor ${payload.app} + |\tfor ${payload.application} |\tvia url ${config.databaseUrl} |\tto token(s) [${tokens.mkString(",")}] |\tusing credentials ${config.googleCredentials.getOrElse( diff --git a/core/src/main/scala/app/softnetwork/notification/spi/SMSModeProvider.scala b/core/src/main/scala/app/softnetwork/notification/spi/SMSModeProvider.scala index ce2d1e6..6f86434 100644 --- a/core/src/main/scala/app/softnetwork/notification/spi/SMSModeProvider.scala +++ b/core/src/main/scala/app/softnetwork/notification/spi/SMSModeProvider.scala @@ -5,7 +5,7 @@ import app.softnetwork.notification.config.{InternalConfig, SMSMode, SMSSettings import app.softnetwork.persistence.now import com.typesafe.scalalogging.StrictLogging import org.apache.commons.text.StringEscapeUtils -import org.softnetwork.notification.model.{ +import app.softnetwork.notification.model.{ NotificationAck, NotificationStatus, NotificationStatusResult, diff --git a/core/src/main/scala/app/softnetwork/notification/spi/SimpleMailProvider.scala b/core/src/main/scala/app/softnetwork/notification/spi/SimpleMailProvider.scala index 411f874..65125e6 100644 --- a/core/src/main/scala/app/softnetwork/notification/spi/SimpleMailProvider.scala +++ b/core/src/main/scala/app/softnetwork/notification/spi/SimpleMailProvider.scala @@ -7,8 +7,8 @@ import akka.actor.typed.ActorSystem import app.softnetwork.notification.config.{InternalConfig, MailConfig, MailSettings} import com.typesafe.scalalogging.StrictLogging import org.apache.commons.mail._ -import org.softnetwork.notification.model.MailType._ -import org.softnetwork.notification.model._ +import app.softnetwork.notification.model.MailType._ +import app.softnetwork.notification.model._ import java.util.Date import javax.activation.FileDataSource diff --git a/project/src/main/scala/app/softnetwork/sbt/build/Versions.scala b/project/src/main/scala/app/softnetwork/sbt/build/Versions.scala index c51e793..b4d292e 100644 --- a/project/src/main/scala/app/softnetwork/sbt/build/Versions.scala +++ b/project/src/main/scala/app/softnetwork/sbt/build/Versions.scala @@ -4,7 +4,7 @@ object Versions { val genericPersistence = "0.2.5.15" - val scheduler = "0.1.4" + val scheduler = "0.2.0" val server = "0.2.6.2" diff --git a/testkit/src/main/scala/app/softnetwork/notification/scalatest/AllNotificationsTestKit.scala b/testkit/src/main/scala/app/softnetwork/notification/scalatest/AllNotificationsTestKit.scala index 8926cc7..bbbda53 100644 --- a/testkit/src/main/scala/app/softnetwork/notification/scalatest/AllNotificationsTestKit.scala +++ b/testkit/src/main/scala/app/softnetwork/notification/scalatest/AllNotificationsTestKit.scala @@ -19,6 +19,7 @@ import app.softnetwork.notification.persistence.typed.{ } import app.softnetwork.notification.spi.FcmMockProvider import app.softnetwork.persistence.query.InMemoryJournalProvider +import app.softnetwork.scheduler.config.SchedulerSettings import com.typesafe.config.Config import org.scalatest.Suite @@ -85,7 +86,7 @@ trait AllNotificationsTestKit new Scheduler2NotificationProcessorStream with AllNotificationsHandler with InMemoryJournalProvider { - override val tag: String = s"${AllNotificationsBehavior.persistenceId}-scheduler" + override val tag: String = SchedulerSettings.tag(AllNotificationsBehavior.persistenceId) override val forTests: Boolean = true override implicit def system: ActorSystem[_] = sys } diff --git a/testkit/src/main/scala/app/softnetwork/notification/scalatest/ApnsNotificationsTestKit.scala b/testkit/src/main/scala/app/softnetwork/notification/scalatest/ApnsNotificationsTestKit.scala index f533a6f..fe318a0 100644 --- a/testkit/src/main/scala/app/softnetwork/notification/scalatest/ApnsNotificationsTestKit.scala +++ b/testkit/src/main/scala/app/softnetwork/notification/scalatest/ApnsNotificationsTestKit.scala @@ -17,9 +17,10 @@ import app.softnetwork.notification.persistence.typed.{ NotificationBehavior } import app.softnetwork.persistence.query.InMemoryJournalProvider +import app.softnetwork.scheduler.config.SchedulerSettings import com.typesafe.config.Config import org.scalatest.Suite -import org.softnetwork.notification.model.Push +import app.softnetwork.notification.model.Push trait ApnsNotificationsTestKit extends NotificationGrpcServer[Push] @@ -58,7 +59,7 @@ trait ApnsNotificationsTestKit new Scheduler2NotificationProcessorStream with ApnsNotificationsHandler with InMemoryJournalProvider { - override val tag: String = s"${ApnsNotificationsBehavior.persistenceId}-scheduler" + override val tag: String = SchedulerSettings.tag(ApnsNotificationsBehavior.persistenceId) override val forTests: Boolean = true override implicit def system: ActorSystem[_] = sys } diff --git a/testkit/src/main/scala/app/softnetwork/notification/scalatest/FcmAndApnsNotificationsTestKit.scala b/testkit/src/main/scala/app/softnetwork/notification/scalatest/FcmAndApnsNotificationsTestKit.scala index ac7b6d9..d8786a0 100644 --- a/testkit/src/main/scala/app/softnetwork/notification/scalatest/FcmAndApnsNotificationsTestKit.scala +++ b/testkit/src/main/scala/app/softnetwork/notification/scalatest/FcmAndApnsNotificationsTestKit.scala @@ -18,9 +18,10 @@ import app.softnetwork.notification.persistence.typed.{ } import app.softnetwork.notification.spi.FcmMockAndApnsProvider import app.softnetwork.persistence.query.InMemoryJournalProvider +import app.softnetwork.scheduler.config.SchedulerSettings import com.typesafe.config.Config import org.scalatest.Suite -import org.softnetwork.notification.model.Push +import app.softnetwork.notification.model.Push trait FcmAndApnsNotificationsTestKit extends NotificationGrpcServer[Push] @@ -62,7 +63,7 @@ trait FcmAndApnsNotificationsTestKit with FcmAndApnsNotificationsHandler with InMemoryJournalProvider { override val tag: String = - s"${FcmAndApnsNotificationsBehavior.persistenceId}-scheduler" + SchedulerSettings.tag(FcmAndApnsNotificationsBehavior.persistenceId) override val forTests: Boolean = true override implicit def system: ActorSystem[_] = sys } diff --git a/testkit/src/main/scala/app/softnetwork/notification/scalatest/FcmNotificationsTestKit.scala b/testkit/src/main/scala/app/softnetwork/notification/scalatest/FcmNotificationsTestKit.scala index 2b4556b..105a6fa 100644 --- a/testkit/src/main/scala/app/softnetwork/notification/scalatest/FcmNotificationsTestKit.scala +++ b/testkit/src/main/scala/app/softnetwork/notification/scalatest/FcmNotificationsTestKit.scala @@ -18,9 +18,10 @@ import app.softnetwork.notification.persistence.typed.{ } import app.softnetwork.notification.spi.FcmMockProvider import app.softnetwork.persistence.query.InMemoryJournalProvider +import app.softnetwork.scheduler.config.SchedulerSettings import com.typesafe.config.Config import org.scalatest.Suite -import org.softnetwork.notification.model.Push +import app.softnetwork.notification.model.Push trait FcmNotificationsTestKit extends NotificationGrpcServer[Push] with NotificationTestKit[Push] { _: Suite => @@ -39,7 +40,7 @@ trait FcmNotificationsTestKit extends NotificationGrpcServer[Push] with Notifica new Scheduler2NotificationProcessorStream with FcmNotificationsHandler with InMemoryJournalProvider { - override val tag: String = s"${FcmNotificationsBehavior.persistenceId}-scheduler" + override val tag: String = SchedulerSettings.tag(FcmNotificationsBehavior.persistenceId) override val forTests: Boolean = true override implicit def system: ActorSystem[_] = sys } diff --git a/testkit/src/main/scala/app/softnetwork/notification/scalatest/NotificationTestKit.scala b/testkit/src/main/scala/app/softnetwork/notification/scalatest/NotificationTestKit.scala index 6d2b956..a795a65 100644 --- a/testkit/src/main/scala/app/softnetwork/notification/scalatest/NotificationTestKit.scala +++ b/testkit/src/main/scala/app/softnetwork/notification/scalatest/NotificationTestKit.scala @@ -12,7 +12,7 @@ import app.softnetwork.notification.model.Notification import app.softnetwork.scheduler.scalatest.SchedulerTestKit import com.typesafe.config.Config import org.scalatest.Suite -import org.softnetwork.notification.model.{BasicDevice, From, Mail, Platform, Push, SMS} +import app.softnetwork.notification.model.{BasicDevice, From, Mail, Platform, Push, SMS} import java.net.ServerSocket @@ -62,7 +62,7 @@ trait NotificationTestKit[T <: Notification] .withSubject(subject) .withMessage(message) .withDevices(devices) - .withApp("mock") + .withApplication("mock") val iosDevice: BasicDevice = BasicDevice(generateRandomDeviceToken, Platform.IOS) diff --git a/testkit/src/main/scala/app/softnetwork/notification/scalatest/SMSModeNotificationsTestKit.scala b/testkit/src/main/scala/app/softnetwork/notification/scalatest/SMSModeNotificationsTestKit.scala index 0f5b8dd..b1daf98 100644 --- a/testkit/src/main/scala/app/softnetwork/notification/scalatest/SMSModeNotificationsTestKit.scala +++ b/testkit/src/main/scala/app/softnetwork/notification/scalatest/SMSModeNotificationsTestKit.scala @@ -17,9 +17,10 @@ import app.softnetwork.notification.persistence.typed.{ SMSModeNotificationsBehavior } import app.softnetwork.persistence.query.InMemoryJournalProvider +import app.softnetwork.scheduler.config.SchedulerSettings import com.typesafe.config.Config import org.scalatest.Suite -import org.softnetwork.notification.model.SMS +import app.softnetwork.notification.model.SMS trait SMSModeNotificationsTestKit extends NotificationGrpcServer[SMS] @@ -59,7 +60,8 @@ trait SMSModeNotificationsTestKit new Scheduler2NotificationProcessorStream with SMSModeNotificationsHandler with InMemoryJournalProvider { - override val tag: String = s"${SMSModeNotificationsBehavior.persistenceId}-scheduler" + override val tag: String = + SchedulerSettings.tag(SMSModeNotificationsBehavior.persistenceId) override val forTests: Boolean = true override implicit def system: ActorSystem[_] = sys } diff --git a/testkit/src/main/scala/app/softnetwork/notification/scalatest/SimpleMailNotificationsTestKit.scala b/testkit/src/main/scala/app/softnetwork/notification/scalatest/SimpleMailNotificationsTestKit.scala index 29bcbf3..6c55f77 100644 --- a/testkit/src/main/scala/app/softnetwork/notification/scalatest/SimpleMailNotificationsTestKit.scala +++ b/testkit/src/main/scala/app/softnetwork/notification/scalatest/SimpleMailNotificationsTestKit.scala @@ -17,9 +17,10 @@ import app.softnetwork.notification.persistence.typed.{ SimpleMailNotificationsBehavior } import app.softnetwork.persistence.query.InMemoryJournalProvider +import app.softnetwork.scheduler.config.SchedulerSettings import com.typesafe.config.Config import org.scalatest.Suite -import org.softnetwork.notification.model.Mail +import app.softnetwork.notification.model.Mail trait SimpleMailNotificationsTestKit extends NotificationGrpcServer[Mail] @@ -60,7 +61,8 @@ trait SimpleMailNotificationsTestKit new Scheduler2NotificationProcessorStream with SimpleMailNotificationsHandler with InMemoryJournalProvider { - override val tag: String = s"${SimpleMailNotificationsBehavior.persistenceId}-scheduler" + override val tag: String = + SchedulerSettings.tag(SimpleMailNotificationsBehavior.persistenceId) override val forTests: Boolean = true override implicit def system: ActorSystem[_] = sys } diff --git a/testkit/src/test/scala/app/softnetwork/notification/handlers/ApnsNotificationsHandlerSpec.scala b/testkit/src/test/scala/app/softnetwork/notification/handlers/ApnsNotificationsHandlerSpec.scala index 86aef4f..fc3e3dc 100644 --- a/testkit/src/test/scala/app/softnetwork/notification/handlers/ApnsNotificationsHandlerSpec.scala +++ b/testkit/src/test/scala/app/softnetwork/notification/handlers/ApnsNotificationsHandlerSpec.scala @@ -3,7 +3,7 @@ package app.softnetwork.notification.handlers import app.softnetwork.notification.message._ import app.softnetwork.notification.scalatest.ApnsNotificationsTestKit import org.scalatest.wordspec.AnyWordSpecLike -import org.softnetwork.notification.model.NotificationStatus +import app.softnetwork.notification.model.NotificationStatus /** Created by smanciot on 07/12/2022. */ diff --git a/testkit/src/test/scala/app/softnetwork/notification/handlers/FcmAndApnsNotificationsHandlerSpec.scala b/testkit/src/test/scala/app/softnetwork/notification/handlers/FcmAndApnsNotificationsHandlerSpec.scala index b97ef4b..a6b00ce 100644 --- a/testkit/src/test/scala/app/softnetwork/notification/handlers/FcmAndApnsNotificationsHandlerSpec.scala +++ b/testkit/src/test/scala/app/softnetwork/notification/handlers/FcmAndApnsNotificationsHandlerSpec.scala @@ -3,7 +3,7 @@ package app.softnetwork.notification.handlers import app.softnetwork.notification.message._ import app.softnetwork.notification.scalatest.FcmAndApnsNotificationsTestKit import org.scalatest.wordspec.AnyWordSpecLike -import org.softnetwork.notification.model.NotificationStatus +import app.softnetwork.notification.model.NotificationStatus /** Created by smanciot on 07/12/2022. */ diff --git a/testkit/src/test/scala/app/softnetwork/notification/handlers/FcmNotificationsHandlerSpec.scala b/testkit/src/test/scala/app/softnetwork/notification/handlers/FcmNotificationsHandlerSpec.scala index 763094e..dcf8238 100644 --- a/testkit/src/test/scala/app/softnetwork/notification/handlers/FcmNotificationsHandlerSpec.scala +++ b/testkit/src/test/scala/app/softnetwork/notification/handlers/FcmNotificationsHandlerSpec.scala @@ -3,7 +3,7 @@ package app.softnetwork.notification.handlers import app.softnetwork.notification.message._ import app.softnetwork.notification.scalatest.FcmNotificationsTestKit import org.scalatest.wordspec.AnyWordSpecLike -import org.softnetwork.notification.model.NotificationStatus +import app.softnetwork.notification.model.NotificationStatus /** Created by smanciot on 07/12/2022. */