> 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/public-finance/v2.3/platform/configuration/configuring-master-data.md).

# Configuring Master Data

## **ADMIN ONLY**

Before the iFIX platform can be used, the master data must be configured directly into the respective collections in MongoDB. Associated APIs for configuring Master Data will be made available in the next version.&#x20;

* Add Government - Insert into MongoDB collection
* Add Department&#x20;
* Add Department Hierarchy - It defines the hierarchy definition for the department&#x20;
  * department id: It is master department id (UUID)
  * level: It defines the depth of hierarchy of department level&#x20;
    * Root level department hierarchy will not contain any parent value and level value will be zero
    * Level value incrementation rule:
      * When parent id is having any value then we search parent in department hierarchy record for hierarchy level evaluation
      * Get level value from parent department hierarchy and increment current department hierarchy level value by one
  * parent: It provides details about department parent (UUID)
* Add Department Entity - It contains department entity information along with its hierarchy level and also attaches master department information (department id - UUID). Here we keep all children information list at every department node (department record). Leaf level department will not have any children info. Children list contains department entity id list, which makes current department entity parent of all children list (department id list), that's how it maintains department entity level. Entities can be created by&#x20;
  * First defining the hierarchy level top to bottom because it has parent's reference
  * Then we can start adding department entities, bottom-to-top because it has child's reference.

**Note**:

* The root department hierarchy will have the label "Department", and the root department entity will be the department itself
* When we have to update the existing children list of Department Entity then update the existing children list using mongodb command like below:
  * Find the department entity parent where the new children need to be added. Do search by name and hierarchy level `db.departmentEntity.find({"name" : "<current_department_entity's_name>","hierarchyLevel": <Current_department_entity_hierarchy_level>});`
  * Append the department entity id at the end of the current department entity children's list. So first find the length of the current array and then set it as "children.n": "" (where n is the length of the array.)`db.departmentEntity.update({"_id": ""},{$set: {"children.n": "", "children.n+1": ""} })`
* Add Chart of Accounts - Insert manually into MongoDB collection
* Add Expenditure - Insert manually into MongoDB collection.

> [![Creative Commons License](https://i.creativecommons.org/l/by/4.0/80x15.png)*​*](http://creativecommons.org/licenses/by/4.0/)*All content on this page by* [*eGov Foundation*](https://egov.org.in/) *is licensed under a* [*Creative Commons Attribution 4.0 International License*](http://creativecommons.org/licenses/by/4.0/)*.*


---

# 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/public-finance/v2.3/platform/configuration/configuring-master-data.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.
