From e36dec81159833025449f7dc24bd143a483671f1 Mon Sep 17 00:00:00 2001
From: anushaGarg <anusha.garg@ayanworks.com>
Date: Mon, 13 Jun 2022 14:45:31 +0530
Subject: [PATCH] Added Sequence Daigrams

---
 .../create-credential-definition.md           |  7 ++++
 aw-design-diagram/create-schema-sequence.md   |  7 ++++
 .../issue-credential-sequence.md              | 12 +++++++
 aw-design-diagram/out-of-band-sequence.md     | 14 ++++++++
 .../principal-user-registration-sequence.md   | 35 +++++++++++++++++++
 .../proof-verification-sequence.md            | 12 +++++++
 aw-design-diagram/subscription-sequence.md    | 18 ++++++++++
 7 files changed, 105 insertions(+)
 create mode 100644 aw-design-diagram/create-credential-definition.md
 create mode 100644 aw-design-diagram/create-schema-sequence.md
 create mode 100644 aw-design-diagram/issue-credential-sequence.md
 create mode 100644 aw-design-diagram/out-of-band-sequence.md
 create mode 100644 aw-design-diagram/principal-user-registration-sequence.md
 create mode 100644 aw-design-diagram/proof-verification-sequence.md
 create mode 100644 aw-design-diagram/subscription-sequence.md

diff --git a/aw-design-diagram/create-credential-definition.md b/aw-design-diagram/create-credential-definition.md
new file mode 100644
index 0000000..bb00c27
--- /dev/null
+++ b/aw-design-diagram/create-credential-definition.md
@@ -0,0 +1,7 @@
+sequenceDiagram
+participant OCM Admin
+participant OCM Attestation Manager
+  par
+  OCM Admin ->> OCM Attestation Manager: Calls the POST method credentialDef with relevant attributes.
+  OCM Attestation Manager ->> OCM Admin: Responds with status code 201, with message 'Credential definition created successfully', if credential definition is created on ledger successfully
+  end
diff --git a/aw-design-diagram/create-schema-sequence.md b/aw-design-diagram/create-schema-sequence.md
new file mode 100644
index 0000000..33fedce
--- /dev/null
+++ b/aw-design-diagram/create-schema-sequence.md
@@ -0,0 +1,7 @@
+sequenceDiagram
+participant OCM Admin
+participant OCM Attestation Manager
+  par
+  OCM Admin ->> OCM Attestation Manager: Calls the POST method Schemas with relevant attributes.
+  OCM Attestation Manager ->> OCM Admin: Responds with status code 201, with message 'Schema created successfully', if schema is created on ledger successfully
+  end
\ No newline at end of file
diff --git a/aw-design-diagram/issue-credential-sequence.md b/aw-design-diagram/issue-credential-sequence.md
new file mode 100644
index 0000000..d4b61aa
--- /dev/null
+++ b/aw-design-diagram/issue-credential-sequence.md
@@ -0,0 +1,12 @@
+sequenceDiagram
+participant PCM User
+participant PCM App
+participant OCM Admin
+participant OCM Attestation Manager
+  par
+  OCM Admin ->> OCM Attestation Manager: Calls the POST method create-offer-Credential with connectionId, credentialDefinitionId and relevant attributes and their values.
+  OCM Attestation Manager ->> PCM App: Offers the Credential to the corresponding PCM
+  PCM User->> PCM App: Accepts the Credential
+  PCM App ->> OCM Attestation Manager: Sends acknowledgement
+  OCM Attestation Manager ->> PCM App: Accepts the acknowledgement on accept-request API, and issues the Verifiable Credential, which gets stored in PCM wallet.
+  end
diff --git a/aw-design-diagram/out-of-band-sequence.md b/aw-design-diagram/out-of-band-sequence.md
new file mode 100644
index 0000000..0eab60d
--- /dev/null
+++ b/aw-design-diagram/out-of-band-sequence.md
@@ -0,0 +1,14 @@
+sequenceDiagram
+participant PCM User
+participant PCM App
+participant OCM Admin
+participant OCM Proof Manager
+ par
+ OCM Admin ->> OCM Proof Manager: Calls the POST method send-out-of-band-presentation-request, with either schemaId or credentialDefinitionId and required attributes.
+ OCM Proof Manager ->> OCM Admin: Sends the URL generated of proof presentation request
+ OCM Admin->> OCM Admin: Receives the URL and converts it to QR code and displays the same.
+ PCM App ->> OCM Admin: Scans the QR code for Out of Band Proof Presentation.
+ PCM User ->> PCM App: The User accepts to share the requested attributes of specified credential.
+ PCM App ->> OCM Proof Manager: Sends the requested attributes, if proof verification is successful it sets isVerified as true and state as done in the database.
+ OCM Admin ->> OCM Proof Manager: Calls Get method find-by-presentation-id API, against the presentation-id of proof request, and confirms the status of isVerified and state.
+ end
diff --git a/aw-design-diagram/principal-user-registration-sequence.md b/aw-design-diagram/principal-user-registration-sequence.md
new file mode 100644
index 0000000..822481b
--- /dev/null
+++ b/aw-design-diagram/principal-user-registration-sequence.md
@@ -0,0 +1,35 @@
+sequenceDiagram
+participant Playstore/Appstore
+participant PCM User
+participant PCM App
+participant OCM Notification Manager(Federation)
+participant Mediator
+participant OCM Admin
+participant OCM Connection Manager
+participant OCM Principal Manager
+participant OCM Attestation Manager
+ 
+ par
+  User Device->>Playstore/Appstore: Downloads PCM App
+  PCM User ->> PCM App: Enters email
+  PCM App ->>OCM Notification Manager(Federation): sends email Address to notification/sendOTP(), for OTP generation
+  OCM Notification Manager(Federation) ->> PCM User: Sends OTP to Email address provided
+  PCM User->>PCM App: Enters OTP
+  PCM App ->>OCM Notification Manager(Federation): Sends OTP to notification/verifyOTP()
+  OCM Notification Manager(Federation)->>PCM App: On successful verification, returns success
+  PCM User ->> PCM App: Enters Pin and Biometric
+  PCM App ->> PCM App: Create Wallet, show mnemonic
+  PCM User->>PCM App: copies and saves mnemonic
+  end
+  par
+  PCM App->> Mediator: Sends DIDComm Connection
+  Mediator->>PCM App: On successful connection sends connected
+  end
+  par
+  OCM Admin ->> OCM Connection Manager: Uses invitationURL(), to generate new Invitation URL with parameter 'alias = member'
+  OCM Admin ->> OCM Admin: Converts URL to QR, and displays
+  PCM App ->> OCM Admin: Scans the QR code, and the connection between PCM and OCM gets completed and active
+  OCM Connection Manager ->> OCM Principal Manager: Request for issuance of Principal credential
+  OCM Principal Manager ->> OCM Attestation Manager: Requests Attestation Manager with Principal Credential CredDef to issue credential based on CredDef
+  OCM Attestation Manager ->> PCM App: Issues Credential to the individual and the credential gets stored in PCM App's wallet
+  end
\ No newline at end of file
diff --git a/aw-design-diagram/proof-verification-sequence.md b/aw-design-diagram/proof-verification-sequence.md
new file mode 100644
index 0000000..b19b229
--- /dev/null
+++ b/aw-design-diagram/proof-verification-sequence.md
@@ -0,0 +1,12 @@
+sequenceDiagram
+participant PCM User
+participant PCM App
+participant OCM Admin
+participant OCM Proof Manager
+ par
+ OCM Admin ->> OCM Proof Manager: Calls the POST method send-presentation-request, against the connectionID, with either schemaId or credentialDefinitionId and required attributes.
+ OCM Proof Manager ->> PCM App: Sends the Proof Presentation Request.
+ PCM User ->> PCM App: The User accepts to share the requested attributes of specified credential.
+ PCM App ->> OCM Proof Manager: Sends the requested attributes, if proof verification is successful it sets isVerified as true and state as done in the database.
+ OCM Admin ->> OCM Proof Manager: Calls Get method find-by-presentation-id API, against the presentation-id of proof request, and confirms the status of isVerified and state.
+ end
diff --git a/aw-design-diagram/subscription-sequence.md b/aw-design-diagram/subscription-sequence.md
new file mode 100644
index 0000000..5caf213
--- /dev/null
+++ b/aw-design-diagram/subscription-sequence.md
@@ -0,0 +1,18 @@
+sequenceDiagram
+participant PCM App
+participant OCM Admin
+participant OCM Connection Manager
+participant OCM Connection Manager Db
+participant OCM Principal Manager
+participant OCM Proof Manager
+ 
+  par
+  OCM Admin ->> OCM Connection Manager: Uses invitationURL(), to generate new Invitation URL with parameter 'alias = subscriber'
+  OCM Admin ->> OCM Admin: Converts URL to QR, and displays
+  PCM App ->> OCM Admin: Scans the QR code, and the connection between PCM and OCM gets completed and active
+  OCM Connection Manager ->> OCM Principal Manager: Requests for Proof Verification on Principal credential, to turn connection from active to trusted
+  OCM Principal Manager ->> OCM Proof Manager: Requests Proof Verification on sendMembershipProofRequest() on Principal Credential schema
+  OCM Proof Manager ->> PCM App: Requests for proof verification from PCM App
+  PCM App ->> OCM Proof Manager: Responds with Proof Request.
+  OCM Proof Manager ->> OCM Connection Manager Db: Changes the status of Connection to Trusted from Completed if proof verification is successful
+  end
-- 
GitLab