This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PropTypes from 'prop-types'; | |
import React, {useCallback, useEffect, useState} from "react"; | |
import { | |
Badge, | |
Box, Button, | |
Checkbox, | |
Container, | |
Divider, | |
Grid, | |
InputAdornment, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PropTypes from 'prop-types'; | |
import React, {useCallback, useEffect, useState} from "react"; | |
import { | |
Badge, | |
Box, Button, | |
Checkbox, | |
Container, | |
Divider, | |
Grid, | |
IconButton, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.typed.scaladsl.Behaviors | |
import akka.actor.typed.{ActorRef, Behavior} | |
import scala.collection.immutable | |
import scala.concurrent.duration.{DurationLong, FiniteDuration} | |
import scala.reflect.ClassTag | |
trait MessageCollector[Aggregate <: Timestamp] { | |
type Message <: Timestamp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
val days = 3 | |
val lastTimestamp = OffsetDateTime | |
.ofInstant( | |
Instant | |
.ofEpochSecond(timestamp), | |
ZoneId.systemDefault() | |
) | |
.truncatedTo(ChronoUnit.DAYS) | |
val nextScheduleTimestamp = lastTimestamp.plusSeconds(days * 24 * 60 * 60) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import java.time.temporal.ChronoUnit | |
import java.time.{Instant, OffsetDateTime, ZoneId} | |
import akka.actor.typed.scaladsl.{ | |
ActorContext, | |
Behaviors, | |
StashBuffer, | |
TimerScheduler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.typed.scaladsl.{ | |
ActorContext, | |
Behaviors, | |
StashBuffer, | |
TimerScheduler | |
} | |
import akka.actor.typed.{ActorRef, Behavior, SupervisorStrategy} | |
import akka.pattern.StatusReply | |
import models.{Business, BusinessUser, UserProfile} | |
import play.api.Configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class AdAccount(id: String, name: Option[String] = None) extends Entity | |
implicit class adAccount2AttributeValue(adAccount: AdAccount) { | |
def asPutItemRequest( | |
tableName: String, | |
criteria: Option[Criteria], | |
status: String | |
): PutItemRequest = | |
PutItemRequest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def updateCriteria( | |
id: String, | |
adAccount: AdAccount, | |
criteria: Option[Criteria], | |
activate: Boolean | |
): Future[ | |
( | |
AdAccount, | |
Criteria, | |
Seq[(Campaign, Criteria, Seq[(AdSet, Criteria)])] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState} from 'react'; | |
import * as Yup from 'yup'; | |
import {Formik} from 'formik'; | |
import {Box, Grid, Switch, TextField, Typography} from '@material-ui/core'; | |
import {Alert} from '@material-ui/lab'; | |
import wait from 'src/utils/wait'; | |
import {isEqual} from 'lodash' | |
const SubmitListener = ( | |
{formik} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tailrec | |
private def criteria( | |
baseCriteria: Criteria, | |
criteriaList: Option[Criteria]* | |
): Criteria = { | |
criteriaList match { | |
case head :: tail => | |
criteria( | |
head.fold(baseCriteria) { criteria => | |
baseCriteria.copy(startDateTime = |