# Admin User

## Overview <a href="#ujv60b2s5hlz" id="ujv60b2s5hlz"></a>

The Admin Panel provides comprehensive field configuration and document mapping capabilities for a beneficiary app. The system enables Admins to define custom form fields, configure document types, and establish mappings between form fields and document VCs (verification credentials) .

## Use Cases <a href="#ggnjp9ervvzz" id="ggnjp9ervvzz"></a>

### **1. Manage Profile Fields** <a href="#id-4glnc4z69zua" id="id-4glnc4z69zua"></a>

Create, edit, and delete custom fields for user profile

Main Flow:

1. Admin navigates to Add Fields page
2. System displays current list of fields in table format

<figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FPduOj8EikTokfy241n6u%2FAdmin01.png?alt=media&#x26;token=383b87b7-c9ad-41c6-95b5-6a8e63f08c9c" alt=""><figcaption></figcaption></figure>

1. Admin clicks "Add Field" button\
   System opens field creation modal\
   \&#xNAN;*Field creation modal opened with empty form*

<figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FovekCSDQMjtXHopraGmU%2Fadmin002.png?alt=media&#x26;token=099f7419-5775-4f99-b839-9f92f8b93577" alt=""><figcaption></figcaption></figure>

2. Admin fills required field information:

* Label (display name)
* Name (internal identifier)
* Type (text, numeric, date, boolean, dropdown)
* Ordering (display sequence)
* Required flag
* Editable flag
* Options (for dropdown type)&#x20;

<figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FnElOfNnTwrxnc4LAzW1t%2F2.png?alt=media" alt=""><figcaption></figcaption></figure>

*Modal with all field information filled out*

1. *Admin clicks Add field button*
2. System validates field data
3. System calls API to persist field
4. System refreshes field list\
   &#x20;

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2F6J8zhuhBpvmN9jFfGNB6%2F3.png?alt=media" alt=""><figcaption></figcaption></figure>
5. *Updated fields table showing newly added field*
6. System displays success confirmation

Alternative Flows:

* AF-001a: Edit existing field
* AF-001b: Delete field

Business Rules:

* Field names must be unique
* Ordering must be numeric and positive
* Dropdown fields must have at least one option
* Fields in use cannot be deleted

### **2. Configure Document Types** <a href="#id-6pvvk6y753zq" id="id-6pvvk6y753zq"></a>

Actor: Beneficiary Admin Goal: Define document types and their VC field schemas for verification

Preconditions:

* Admin has access to admin panel
* VC schemas are defined on issuance platform

Main Flow:

1. Admin navigates to Document Config page
2. System displays current document configurations\
   &#x20;

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FH2gMP29SumlTcgarSODJ%2F9.png?alt=media" alt=""><figcaption></figcaption></figure>
3. *Document Configuration page with existing configurations*
4. Admin reviews/adds document configuration:
   * Document Name (display name)
   * Document Label (user-friendly label)
   * Document Type (category)
   * Document Sub Type (specific identifier)
   * VC Fields (JSON schema defining available fields)

<figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2F22VOjUQ5DhJyaE4C5okj%2F10.png?alt=media" alt=""><figcaption></figcaption></figure>

*Document configuration form with all required fields*

1. Admin enters all fields

<figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FawBvaCMySHxwjCTHsR3S%2F11.png?alt=media" alt=""><figcaption></figcaption></figure>

2. *VC Fields textarea with JSON schema input*
3. System validates JSON structure\
   &#x20;

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FgHMVMd4Tnfzm3Qy8pzfv%2F12.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Admin saves all configurations\\

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FrtjTfFG7SsDEjwbaJfWG%2F13.png?alt=media" alt=""><figcaption></figcaption></figure>

&#x20;                                                *Save All Configurations button highlighted*

5. System persists configurations via API
6. System displays success confirmation\\

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2F67iBXzExRQimEw1PfW3D%2F14.png?alt=media" alt=""><figcaption></figcaption></figure>

Alternative Flows:

* AF-002a: Add new document configuration
* AF-002b: Remove document configuration

  * Admin clicks delete icon\
    &#x20;

    <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2Fgnq8vLv44tvz3vbjaNqC%2F17.png?alt=media" alt=""><figcaption></figcaption></figure>

  &#x20;                                            *AF-002b: Delete icon on configuration block*

  * System removes configuration from list
* AF-002c: Invalid JSON format

Business Rules:

* All document fields are required
* VC fields must be valid JSON object
* Each field in VC schema must have a "type" property
* Document sub types should be unique

### **3. Map Fields to Documents** <a href="#m0qsch1r5cf9" id="m0qsch1r5cf9"></a>

Actor: Beneficiary Admin Goal: Create mappings between form fields and document VC fields

Preconditions:

* Form fields are configured in system
* Documents are configured with VC schemas

Main Flow:

1. Admin navigates to Field Mapping Config page
2. System loads available form fields and document types\\

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FOAnxbEokZVXDpGGMFwP7%2F20.png?alt=media" alt=""><figcaption></figcaption></figure>

<p align="center"><em>Field Mapping Configuration page with loaded data</em></p>

3. Admin creates field mapping:
4. Admin can add multiple document mappings per field\\

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FBAWOpPeDlNZkExReG0jA%2F25.png?alt=media" alt=""><figcaption></figcaption></figure>

<p align="center"><em>Multiple document mappings for single field</em></p>

5. System validates all mappings
6. Admin saves all mappings\\

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FHKwspBrRisCVKkHICmXZ%2F26.png?alt=media" alt=""><figcaption></figcaption></figure>

<p align="center"><em>Save All Mappings button highlighted</em></p>

7. System persists mapping configuration via API\\

   <figure><img src="https://3805274988-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3ZeWgjh9EKqEsem61L5Z%2Fuploads%2FuHPACzccRxPPH1AHjvK7%2F27.png?alt=media" alt=""><figcaption></figcaption></figure>

<p align="center"><em>Success toast with mapping statistics</em></p>

Alternative Flows:

Business Rules:

* Each field mapping must have at least one document mapping
* Document and VC field selections are required
* Transformation JSON must be valid format
* Form fields can map to multiple documents/field

## Data Flow <a href="#id-7xzyz8c08nek" id="id-7xzyz8c08nek"></a>

### Field Management Flow <a href="#bw0j8icnb4rd" id="bw0j8icnb4rd"></a>

1. Load: Fetch existing fields from API
2. Display: Render fields in table format
3. Interact: User initiates add/edit/delete
4. Validate: Client-side validation of input
5. Submit: API call with validated data
6. Refresh: Update local state and UI
7. Feedback: Success/error notification

### Document Configuration Flow <a href="#k9zhz9a4u17c" id="k9zhz9a4u17c"></a>

1. Initialize: Load existing configurations
2. Configure: User enters document details
3. Validate: JSON schema validation for VC fields
4. Bulk Save: Submit all configurations together
5. Persist: Backend storage of configurations
6. Confirm: Success notification

### Field Mapping Flow <a href="#b020705pz74z" id="b020705pz74z"></a>

1. Prepare: Load fields and documents
2. Parse: Extract VC fields from document schemas
3. Map: User creates field-to-document relationships
4. Transform: Optional JSON transformation rules
5. Validate: Ensure all required mappings
6. Save: Persist mapping configuration
7. Apply: Mappings available for form processing
