> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/sandbox/platform/architecture/sandbox-ui/low-level-design/modules/account-management.md).

# Account Management

## Overview

The Account Management Module is responsible for handling tenant information within the application. It includes components for displaying tenant homes, managing tenants, creating new tenants, and editing existing tenants. This module interacts with the host app to fetch tenant details and perform CRUD operations.

## **Components**

1. **Tenant Home**: Displays the main tenant dashboard with a list of tenants.
2. **Manage Tenant**: Provides functionality to manage existing tenants.
3. **Create Tenant**: Allows the creation of new tenants.
4. **Edit Tenant**: Enables editing of existing tenant information.

<figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FXlJY4fS5ySFLCSQhBlpv%2FUI%20Tech%20Designs%20-%20Account%20Management%20(1).jpg?alt=media&amp;token=b073ce69-902a-4895-822a-a76bf98b6b74" alt=""><figcaption><p>Account Management</p></figcaption></figure>

## **Data Flow**

1. **Tenant Home**:
   * **Screen Route**: `/sandbox-ui/account/tenant-home`
   * **Data Fetch**: Retrieves list of tenants from MDMS (Master Data Management System), tenant name, address, and other relevant details.
   * **Client Store**: Updates client store with fetched data for display.
2. **Manage Tenant**:
   * **Screen Route**: `/sandbox-ui/account/tenant-manage`
   * **Data Fetch**: Retrieves tenant details from MDMS, including home address and other necessary information.
   * **Client Store**: Updates client store with tenant details for management.
3. **Create Tenant**:
   * **Screen Route**: Accessed from Manage Tenant component.
   * **Data Fetch**: Fetches data from MDMS, including subdomain and tenant name.
   * **Client Store**: Updates client store with new tenant information upon creation.
4. **Edit Tenant**:
   * **Screen Route**: Accessed from Manage Tenant component.
   * **Data Fetch**: Retrieves existing tenant details from MDMS, including subdomain and other information for editing.
   * **Client Store**: Updates client store with edited tenant information.

## **Interaction With Host App**

* The Tenant Management Module fetches the tenant from the host app.
* Ensures synchronization between tenant data in the host app and the Tenant Management Module.

### Web API sequence Diagrams

{% tabs %}
{% tab title="Tenant Home" %}

<figure><img src="https://383170073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLTNzsJMDGVoewNjC1V95%2Fuploads%2FwToG9S132pnmHemCUhFq%2FScreenshot%202024-08-08%20at%206.49.25%20PM.png?alt=media&amp;token=bc151616-8ad4-4d70-8b76-22d873fe4e98" alt=""><figcaption><p>Tenant Management</p></figcaption></figure>
{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.digit.org/sandbox/platform/architecture/sandbox-ui/low-level-design/modules/account-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
