Skip to content

Commit

Permalink
Merge branch 'PIN-4020' into PIN-4023
Browse files Browse the repository at this point in the history
  • Loading branch information
nttdata-rtorsoli authored Sep 27, 2023
2 parents 13bd7ee + 2de6778 commit b7f3b07
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,22 +739,22 @@ object ProcessApiServiceImpl {

def isRiskAnalysisFormValid(riskAnalysisForm: Commons.RiskAnalysisForm, schemaOnlyValidation: Boolean)(
kind: Commons.RiskAnalysisTenantKind
)(implicit ec: ExecutionContext): Future[Unit] =
Future
.failed(RiskAnalysisNotValid)
.unlessA(
RiskAnalysisValidation
.validate(riskAnalysisForm, schemaOnlyValidation)(kind)
.isValid
)
): Future[Unit] =
if (
RiskAnalysisValidation
.validate(riskAnalysisForm, schemaOnlyValidation)(kind)
.isValid
) Future.unit
else Future.failed(RiskAnalysisNotValid)

def isReceiveEService(eService: CatalogItem)(implicit ec: ExecutionContext): Future[Unit] =
Future.failed(EServiceNotInReceiveMode(eService.id)).unlessA(eService.mode == Receive)

def isDraftEService(eService: CatalogItem)(implicit ec: ExecutionContext): Future[Unit] =
Future
.failed(EServiceNotInDraftState(eService.id))
.unlessA(eService.descriptors.map(_.state) == Seq(Draft))
def isDraftEService(eService: CatalogItem): Future[Unit] =
if (eService.descriptors.map(_.state) == Seq(Draft)) Future.unit
else
Future
.failed(EServiceNotInDraftState(eService.id))

def assertRequesterAllowed(resourceId: UUID)(requesterId: UUID)(implicit ec: ExecutionContext): Future[Unit] =
Future.failed(GenericComponentErrors.OperationForbidden).unlessA(resourceId == requesterId)
Expand Down

0 comments on commit b7f3b07

Please sign in to comment.