Skip to content

Commit

Permalink
add columns goal and goal code
Browse files Browse the repository at this point in the history
Signed-off-by: mineme0110 <[email protected]>
  • Loading branch information
mineme0110 committed Nov 13, 2023
1 parent f952a42 commit df0ee32
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import java.util.UUID
* @param updatedAt
* @param thid
* @param label
* @param goalCode
* @param goal
* @param role
* @param protocolState
* @param invitation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

-- Introduce a goal and goal code for connection
ALTER TABLE public.connection_records
ADD COLUMN "goal_code" TEXT,
ADD COLUMN "goal" TEXT;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder}

import java.time.{OffsetDateTime, ZoneOffset}
import java.util.UUID
import io.iohk.atala.connect.controller.http.Connection.annotations.goalcode

case class Connection(
@description(annotations.connectionId.description)
Expand All @@ -22,6 +23,12 @@ case class Connection(
@description(annotations.label.description)
@encodedExample(annotations.label.example)
label: Option[String] = None,
@description(annotations.goalcode.description)
@encodedExample(annotations.goalcode.example)
goalCode: Option[String] = None,
@description(annotations.goal.description)
@encodedExample(annotations.goal.example)
goal: Option[String] = None,
@description(annotations.myDid.description)
@encodedExample(annotations.myDid.example)
myDid: Option[String] = None,
Expand Down Expand Up @@ -66,6 +73,8 @@ object Connection {
connectionId = domain.id,
thid = domain.thid,
label = domain.label,
goalCode = domain.goalCode,
goal = domain.goal,
myDid = domain.role match
case Role.Inviter =>
domain.connectionResponse.map(_.from).orElse(domain.connectionRequest.map(_.to)).map(_.value)
Expand Down Expand Up @@ -110,6 +119,18 @@ object Connection {
example = "Peter"
)

object goalcode
extends Annotation[String](
description =
"A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message.",
example = "issue-vc"
)
object goal
extends Annotation[String](
description =
"A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message.",
example = "To issue a Peter College Graduate credential"
)
object myDid
extends Annotation[String](
description = "The DID representing me as the inviter or invitee in this specific connection.",
Expand Down

0 comments on commit df0ee32

Please sign in to comment.