Skip to content

Commit

Permalink
feat(pollux): finalise VerificationPolicy model and queries in Pollux #2
Browse files Browse the repository at this point in the history
  • Loading branch information
yshyn-iohk committed Feb 10, 2023
1 parent a6665f0 commit b4fda68
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait VerificationPolicyService {
def create(
name: String,
description: String,
constraints: Vector[VerificationPolicyConstraint] = Vector.empty
constraints: Seq[VerificationPolicyConstraint] = Seq.empty
): IO[VerificationPolicyError, VerificationPolicy]

def get(id: UUID): IO[VerificationPolicyError, Option[VerificationPolicy]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class VerificationPolicyServiceImpl(
override def create(
name: String,
description: String,
constraints: Vector[VerificationPolicyConstraint]
constraints: Seq[VerificationPolicyConstraint]
): IO[VerificationPolicyError, VerificationPolicy] = {
for {
verificationPolicy <- VerificationPolicy.make(name, description, constraints)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ object VerificationPolicySqlIntegrationSpec extends ZIOSpecDefault {
name = "new name",
description = "new description"
)
actualUpdated <- repo.update(
actualCreated.id,
actualCreated.hashCode(),
expectedUpdated
).map(_.get)
actualUpdated <- repo
.update(
actualCreated.id,
actualCreated.hashCode(),
expectedUpdated
)
.map(_.get)
getByIdUpdated <- repo.get(expectedUpdated.id).map(_.get)

isUpdated = assert(actualUpdated)(equalTo(expectedUpdated.copy(updatedAt = actualUpdated.updatedAt))) &&
Expand Down

0 comments on commit b4fda68

Please sign in to comment.