# MRV Document Operations

For a demo example of following steps, here is the policy timestamp: **1675164736.675731674**

### **Task Summary**

There are two roles: ‘**User*****’*** and ***‘*****Approver*****’***. *User* can create projects and send project definition documents to the selected *Approvers*. After the approval, *User* can add MRV reports to the project. On the basis of this documents the policy will be minting tokens into the account configured in the project.

### **Preparation**

1. Create 2 roles ‘**User*****’*** and ‘**Approver*****’*** and the corresponding containers

(See example 1 for the more detailed description of how to work with roles)

<figure><img src="/files/KzkU5xmqVUENSCFyQhAH" alt=""><figcaption></figcaption></figure>

2. Create all needed document schemas:

2.1 Schema for ‘**User*****’*** containing the fields: **First name**, **Last name**

2.2 Schema for ‘**Approver*****’*** containing the fields: **First name**, **Last name**

2.3 Schema for ’**Project**’ containing the fields: **Project name**, **Account ID**

In order to mint tokens into another account (not into the account of the minting user) setup the required field

<figure><img src="/files/OvncCVzNtYgEihsSrgVj" alt=""><figcaption></figcaption></figure>

2.4 Schema for ’**Report**’ containing the following fields: **Start Date, End Date, Amount**

(Please see example 2 *for the more detailed description of how to work with Documents*)

3. Add blocks for registering ‘**User*****’*** and ‘**Approver*****’*** into the containers created in the step 1

**Note:** it is important that DID of the user is used for ID of the documents as this value will be used further in the document for filtration

<figure><img src="/files/s925AXu5fx5hAJSh4WKB" alt=""><figcaption></figcaption></figure>

4. Add simplified grids for displaying Projects, Reports and Tokens

<figure><img src="/files/3HM50CkVpUm4pqusrMXI" alt=""><figcaption></figcaption></figure>

5. Create the token

<figure><img src="/files/q0Z8nrKiQdSM4OZZ45Bj" alt=""><figcaption></figcaption></figure>

### **Document Operations**

#### 1. Project Definition

**1.1 Create a project**

<figure><img src="/files/zg206LWojOQl95KqEI7P" alt=""><figcaption></figcaption></figure>

#### 1.2 Save the project

<figure><img src="/files/UbpmRNvlj2icNS8yPANr" alt=""><figcaption></figcaption></figure>

#### 1.3 Link to the token

1.3.1 Since another (not current user) account is used for minted tokens ’**tokenActionBlock**’ cannot be used, instead we will use ‘**tokenConfirmationBlock*****’***

<figure><img src="/files/JZtr7AbPgKDZ3a5TMYU9" alt=""><figcaption></figcaption></figure>

1.3.2 To configure the target account for mixed tokens select ‘*Custom*’ value for ‘*Type*’ and the filed in the document from which to take the value for the Account ID (this field must have type: ‘**Account**’)

<figure><img src="/files/6SHDbUoBLTo7GDYpm7e9" alt=""><figcaption></figcaption></figure>

1.3.3 By default ’**tokenConfirmationBlock**’ does not have a link to the next block, thus it needs to be manually added

<figure><img src="/files/hCz2fNKgji2cx4xmgv3w" alt=""><figcaption></figcaption></figure>

1.4 Add an approver as after the creation the project is not assigned to anyone

1.4.1 Add ’**interfaceActionBlock**’ wrapped into a container.

<figure><img src="/files/B9xgQDEx7erFBFWLIms8" alt=""><figcaption></figcaption></figure>

1.4.2 Select **Dropdown \_** value \*\*\*\* for **\_ Type**

<figure><img src="/files/vk88HG7x9aogKHS9iEVr" alt=""><figcaption></figcaption></figure>

1.4.3 Use system field **assignedTo** to filter documents based on users they are assigned to.

Record value from **assignedTo \_** into\_ **Field** (This field will be changing our block)

<figure><img src="/files/33v0EeLOod8mOsNxGF5W" alt=""><figcaption></figcaption></figure>

1.4.4 Configure values from which fields from the document would be labels, and which ones would be values

<figure><img src="/files/kZTUtb0jgetfFDA1QDCH" alt=""><figcaption></figcaption></figure>

1.4.5 Use ‘**documentsSourceAddon**’ for data for **Dropdown*****.***

<figure><img src="/files/RmEc6uBuBWhnYTbFDo8m" alt=""><figcaption></figcaption></figure>

1.4.6 Save the changed document

<figure><img src="/files/U2JMxxsxSvHl1sSrfGBG" alt=""><figcaption></figcaption></figure>

1.4.7 As ‘**documentsSourceAddon**’ does not have default events, we need manually add them.

<figure><img src="/files/M1PcZ07DuWpO9WPbr1xx" alt=""><figcaption></figcaption></figure>

1.4.8 Return to grid settings and add **Dropdown** into the target column.

<figure><img src="/files/cxhHGrSbiJT029oS30yU" alt=""><figcaption></figcaption></figure>

1.5 Project Approval. Setting up the grid for project approvals.

1.5.1 To select only the projects assigned to the current Approver set the ‘**Assigned to User**’ flag

<figure><img src="/files/uOvIr2mp4vfbCTBZKXlX" alt=""><figcaption></figcaption></figure>

1.5.2 Add document approval block

*(Please see* [*example 2*](/technical-information/library-of-policy-examples/data-input-via-forms-using-roles-to-partition-user-activities.md) *for the more detailed description of this workflow)*

<figure><img src="/files/aHYwluYgXK95rY6ynNp8" alt=""><figcaption></figcaption></figure>

1.5.3 Add Approve button into the grid

<figure><img src="/files/xa0hOIb5pKL5aBYaikdt" alt=""><figcaption></figcaption></figure>

1.5.4 After the Approve, setup the KYC for the account connected to the project

Use ‘**tokenActionBlock**’ with the appropriate settings

<figure><img src="/files/GkTQ5TuXeDmCmFYVyUwA" alt=""><figcaption></figcaption></figure>

1.5.5 Configure the signing/verification of the document with the Approver signature by adding ‘**reassigningBlock**’. This block creates a copy of the source document and re-signs it with the key of the selected user.

<figure><img src="/files/1QAoPHnQH0bvGiUCBaGB" alt=""><figcaption></figcaption></figure>

1.5.6 Add Status attribute for easy filtering

<figure><img src="/files/iH9hR84r8iUx1Lf8NUD8" alt=""><figcaption></figcaption></figure>

#### 2. Report.

To enable report creation only for approved projects, add create button into the grid selectively for documents with ‘Approved’ status

2.1 Add a ‘**documentsSourceAddon**' block to differentiate the documents on the basis of their status

<figure><img src="/files/CEzwBUSVFIvafApEaIBo" alt=""><figcaption></figcaption></figure>

2.2 Repeat the sequence for project creation to create the report

{% hint style="info" %}
**Note:** switch off ‘**Default Active**’ since create report button does not need to be an independent object
{% endhint %}

<figure><img src="/files/cnzCIYpqFZLboka5vEyP" alt=""><figcaption></figcaption></figure>

2.3 Add the button for creating reports into the grid

<figure><img src="/files/YJxxsWMVIx99vRnmkyuT" alt=""><figcaption></figcaption></figure>

2.4 Use ‘**mintDocumentBlock**’ for creating (minting) tokens

<figure><img src="/files/7Q0SZDr4Hluo21wGQgWN" alt=""><figcaption></figcaption></figure>

#### 3. Results

**3.1 Reports**

3.1.1 Add grid to display reports

<figure><img src="/files/KhIqbbJRV8G6AIlr8gDw" alt=""><figcaption></figcaption></figure>

3.1.2 To filter reports on the basis of their project add dynamic filter ‘**filtersAddon**’

<figure><img src="/files/CuljRMe3MMm3ylkgK52l" alt=""><figcaption></figcaption></figure>

Adding FiltersAddon

3.1.3 Documents created on the basis of other documents are automatically linked via the ***ref*** field. Use it for filtration

<figure><img src="/files/JGKWIyP2xXDYNdAXP9vU" alt=""><figcaption></figcaption></figure>

3.1.4 Add the data source for the filter which will display all approved projects of the current user

<figure><img src="/files/UcGjYuzidwUiWBJzxcVA" alt=""><figcaption></figcaption></figure>

3.1.5 Add display of all minted tokens

<figure><img src="/files/HY4akaFWpNXGN9AYnkAT" alt=""><figcaption></figcaption></figure>

#### **Demo**

**Choose a role**

<figure><img src="/files/QRJBYXnDGkfkqiJMLiCG" alt=""><figcaption></figcaption></figure>

**Create Approver**

<figure><img src="/files/3EhUiOiNUxBr7jiHxAZd" alt=""><figcaption></figcaption></figure>

**Create User**

<figure><img src="/files/9Uexp4PzRfElXQ9No8uB" alt=""><figcaption></figcaption></figure>

**Create Project**

<figure><img src="/files/U7Q9D3jXUhof1wtXOves" alt=""><figcaption></figcaption></figure>

**Associate token**

<figure><img src="/files/z38jchohha9EUsMVn3NK" alt=""><figcaption></figcaption></figure>

**Choose an approver**

<figure><img src="/files/Z3t97ZCZN1vCwuMJYP6l" alt=""><figcaption></figcaption></figure>

**Approve project**

<figure><img src="/files/vxofZK6nBOJD5fDneDy7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tiW2HTXpqHAtL0L9q2zD" alt=""><figcaption></figcaption></figure>

**Create report**

<figure><img src="/files/9xoKAudGIC65l8GO6OQm" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/D7xqKSp4VGX73DdQK8i9" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/30jwLEBxA07snF59L30u" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.guardianservice.io/technical-information/library-of-policy-examples/mrv-document-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
