• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / atala-prism-building-blocks / 6404528552

04 Oct 2023 10:06AM UTC coverage: 30.823% (+1.8%) from 29.015%
6404528552

Pull #693

bvoiturier
test(prism-agent): declare 'credentialFormat' field in e2e tests

Signed-off-by: Benjamin Voiturier <benjamin.voiturier@iohk.io>
Pull Request #693: feat(prism-agent): implement AnonCreds issuance flow

777 of 777 new or added lines in 52 files covered. (100.0%)

3831 of 12429 relevant lines covered (30.82%)

0.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pollux/lib/core/src/main/scala/io/iohk/atala/pollux/core/service/CredentialDefinitionService.scala
1
package io.iohk.atala.pollux.core.service
2

3
import io.iohk.atala.pollux.core.model.error.CredentialSchemaError
4
import io.iohk.atala.pollux.core.model.schema.CredentialDefinition
5
import io.iohk.atala.pollux.core.model.schema.CredentialDefinition.*
6
import io.iohk.atala.shared.models.WalletAccessContext
7
import zio.{IO, ZIO}
8

9
import java.util.UUID
10

11
trait CredentialDefinitionService {
12
  type Result[T] = ZIO[WalletAccessContext, CredentialDefinitionService.Error, T]
13

14
  /** @param in
15
    *   CredentialDefinition form for creating the instance
16
    * @return
17
    *   Created instance of the Credential Definition
18
    */
19
  def create(in: Input): Result[CredentialDefinition]
20

21
  /** @param guid
22
    *   Globally unique UUID of the credential definition
23
    * @return
24
    *   The instance of the credential definition or credential service error
25
    */
26
  def getByGUID(guid: UUID): IO[CredentialDefinitionService.Error, CredentialDefinition]
27

28
  def delete(guid: UUID): Result[CredentialDefinition]
29

30
  def lookup(filter: Filter, skip: Int, limit: Int): Result[FilteredEntries]
31
}
32

33
object CredentialDefinitionService {
34
  sealed trait Error
35

36
  object Error {
×
37
    def apply(throwable: Throwable): Error = RepositoryError(throwable)
×
38

39
    final case class RepositoryError(cause: Throwable) extends Error
40

41
    final case class NotFoundError(guid: Option[UUID] = None, id: Option[UUID] = None, message: String) extends Error
42

43
    object NotFoundError {
44
      def byGuid(guid: UUID): NotFoundError =
45
        NotFoundError(guid = Option(guid), message = s"Credential Definition record cannot be found by `guid`=$guid")
46

47
      def byId(id: UUID): NotFoundError =
48
        NotFoundError(id = Option(id), message = s"Credential Definition record cannot be found by `id`=$id")
49
    }
50

51
    final case class UpdateError(id: UUID, version: String, author: String, message: String) extends Error
52

53
    final case class UnexpectedError(msg: String) extends Error
54

55
    final case class CredentialDefinitionValidationError(cause: CredentialSchemaError) extends Error
56

57
    final case class CredentialDefinitionCreationError(msg: String) extends Error
58
  }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc