Skip to content

Commit

Permalink
disable update of eservice if purpose in DRAFT
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterITA committed Sep 22, 2023
1 parent 4c6ea78 commit 0b90698
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 14 deletions.
4 changes: 0 additions & 4 deletions src/main/resources/interface-specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,6 @@ components:
type: boolean
freeOfChargeReason:
type: string
eserviceId:
type: string
format: uuid
dailyCalls:
description: 'maximum number of daily calls that this version can perform.'
type: integer
Expand All @@ -706,7 +703,6 @@ components:
- title
- description
- isFreeOfCharge
- eserviceId
- dailyCalls
PurposeVersion:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package object impl extends SprayJsonSupport with DefaultJsonProtocol {
jsonFormat2(RiskAnalysisMultiAnswerSeed)
implicit val riskAnalysisFormSeedFormat: RootJsonFormat[RiskAnalysisFormSeed] = jsonFormat3(RiskAnalysisFormSeed)
implicit val purposeSeedFormat: RootJsonFormat[PurposeSeed] = jsonFormat8(PurposeSeed)
implicit val PurposeUpdateContentFormat: RootJsonFormat[PurposeUpdateContent] = jsonFormat7(PurposeUpdateContent)
implicit val PurposeUpdateContentFormat: RootJsonFormat[PurposeUpdateContent] = jsonFormat6(PurposeUpdateContent)
implicit val versionDocumentFormat: RootJsonFormat[PurposeVersionDocument] = jsonFormat4(PurposeVersionDocument)
implicit val purposeVersionSeedFormat: RootJsonFormat[PurposeVersionSeed] = jsonFormat2(PurposeVersionSeed)
implicit val waitingForApprovalPurposeVersionUpdateFormat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import it.pagopa.interop.purposemanagement.model.persistence.Adapters._
import it.pagopa.interop.purposemanagement.model.purpose.PersistentRiskAnalysisForm

import java.time.OffsetDateTime
import java.util.UUID

final case class DraftPurposeVersionUpdate(dailyCalls: Integer, timestamp: OffsetDateTime)

final case class PurposeUpdate(
title: String,
description: String,
eserviceId: UUID,
isFreeOfCharge: Boolean,
freeOfChargeReason: Option[String],
riskAnalysisForm: Option[PersistentRiskAnalysisForm]
Expand All @@ -24,7 +22,6 @@ object PurposeUpdate {
PurposeUpdate(
title = payload.title,
description = payload.description,
eserviceId = payload.eserviceId,
isFreeOfCharge = payload.isFreeOfCharge,
freeOfChargeReason = payload.freeOfChargeReason,
riskAnalysisForm = payload.riskAnalysisForm.map(PersistentRiskAnalysisForm.fromSeed(uuidSupplier))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ object Adapters {
p.copy(
title = update.title,
description = update.description,
eserviceId = update.eserviceId,
isFreeOfCharge = update.isFreeOfCharge,
freeOfChargeReason = update.freeOfChargeReason,
riskAnalysisForm = update.riskAnalysisForm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ class PurposeSpec extends BaseIntegrationSpec {
val updateContent = PurposeUpdateContent(
title = "Another title",
description = "Another description",
eserviceId = eServiceId,
isFreeOfCharge = false,
freeOfChargeReason = None,
riskAnalysisForm = Some(riskAnalysisFormSeed.copy(version = "2.0")),
Expand Down Expand Up @@ -586,7 +585,6 @@ class PurposeSpec extends BaseIntegrationSpec {
val updateContent = PurposeUpdateContent(
title = "Another title",
description = "Another description",
eserviceId = eServiceId,
isFreeOfCharge = false,
freeOfChargeReason = None,
riskAnalysisForm = Some(riskAnalysisFormSeed.copy(version = "2.0")),
Expand All @@ -611,7 +609,6 @@ class PurposeSpec extends BaseIntegrationSpec {
val updateContent = PurposeUpdateContent(
title = "Another title",
description = "Another description",
eserviceId = UUID.randomUUID(),
isFreeOfCharge = false,
freeOfChargeReason = None,
riskAnalysisForm = Some(riskAnalysisFormSeed.copy(version = "2.0")),
Expand Down Expand Up @@ -654,7 +651,6 @@ class PurposeSpec extends BaseIntegrationSpec {
val updateContent = PurposeUpdateContent(
title = "Another title",
description = "Another description",
eserviceId = eServiceId,
isFreeOfCharge = false,
freeOfChargeReason = None,
riskAnalysisForm = Some(riskAnalysisFormSeed.copy(version = "2.0")),
Expand Down Expand Up @@ -702,7 +698,6 @@ class PurposeSpec extends BaseIntegrationSpec {
val updateContent = PurposeUpdateContent(
title = "Another title",
description = "Another description",
eserviceId = eServiceId,
riskAnalysisForm = Some(riskAnalysisFormSeed.copy(version = "2.0")),
isFreeOfCharge = false,
freeOfChargeReason = None,
Expand Down

0 comments on commit 0b90698

Please sign in to comment.