Skip to content

Commit

Permalink
Merge branch '1.0.x' into PIN-4292
Browse files Browse the repository at this point in the history
  • Loading branch information
beetlecrunch authored Feb 6, 2024
2 parents 73b8563 + 85b397a commit f253ef3
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import it.pagopa.interop.commons.utils.TypeConversions.{EitherOps, OptionOps}
import it.pagopa.interop.commons.utils.errors.ComponentError
import it.pagopa.interop.commons.utils.service.{OffsetDateTimeSupplier, UUIDSupplier}

import java.time.format.DateTimeFormatter
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, ExecutionContext, Future}
import akka.Done
Expand Down Expand Up @@ -535,6 +536,7 @@ class EServiceApiServiceImpl(
clonedInterface: Option[CatalogDocument],
clonedDocuments: Seq[CatalogDocument]
): Future[CatalogItem] = {
val now = offsetDateTimeSupplier.get()

for {
version <- VersionGenerator.next(None).toFuture
Expand All @@ -550,7 +552,7 @@ class EServiceApiServiceImpl(
dailyCallsPerConsumer = descriptorToClone.dailyCallsPerConsumer,
dailyCallsTotal = descriptorToClone.dailyCallsTotal,
agreementApprovalPolicy = descriptorToClone.agreementApprovalPolicy,
createdAt = offsetDateTimeSupplier.get(),
createdAt = now,
serverUrls = descriptorToClone.serverUrls,
publishedAt = None,
suspendedAt = None,
Expand All @@ -561,12 +563,12 @@ class EServiceApiServiceImpl(
} yield CatalogItem(
id = uuidSupplier.get(),
producerId = serviceToClone.producerId,
name = s"${serviceToClone.name} - clone",
name = s"${serviceToClone.name} - clone - ${now.format(DateTimeFormatter.ofPattern("dd/MM/yy HH:mm:ss"))}",
description = serviceToClone.description,
technology = serviceToClone.technology,
attributes = None,
descriptors = Seq(descriptor),
createdAt = offsetDateTimeSupplier.get(),
createdAt = now,
riskAnalysis = serviceToClone.riskAnalysis,
mode = serviceToClone.mode
)
Expand Down

0 comments on commit f253ef3

Please sign in to comment.