> For the complete documentation index, see [llms.txt](https://gramhal.gitbook.io/bolbhav/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gramhal.gitbook.io/bolbhav/chapter-1-database/mandi-and-crop-data/mandi.md).

# mandi

## Model

<table><thead><tr><th>Field</th><th>Type</th><th data-type="checkbox">Nullable</th><th>Default value</th></tr></thead><tbody><tr><td>id</td><td>int4</td><td>false</td><td></td></tr><tr><td>mandi_name</td><td>varchar(80)</td><td>true</td><td></td></tr><tr><td>registration_date</td><td>timestamp</td><td>true</td><td>Current date</td></tr><tr><td>is_active</td><td>bool</td><td>true</td><td>True</td></tr><tr><td>district</td><td>varchar(80)</td><td>true</td><td></td></tr><tr><td>state</td><td>varchar(80)</td><td>true</td><td></td></tr><tr><td>pincode</td><td>int4</td><td>true</td><td></td></tr><tr><td>district_hi</td><td>varchar(100)</td><td>true</td><td></td></tr><tr><td>state_hi</td><td>varchar(100)</td><td>true</td><td></td></tr><tr><td>district_id</td><td>int4</td><td>true</td><td></td></tr><tr><td>mandi_name_hi</td><td>varchar(80)</td><td>true</td><td></td></tr><tr><td>state_id</td><td>int4</td><td>true</td><td></td></tr><tr><td>manager_ids</td><td>_int4</td><td>true</td><td></td></tr><tr><td>gov_name</td><td>varchar</td><td>true</td><td></td></tr><tr><td>gov_name_hi</td><td>varchar</td><td>true</td><td></td></tr><tr><td>latest_update</td><td>timestamp</td><td>true</td><td></td></tr><tr><td>stats</td><td>json</td><td>true</td><td></td></tr><tr><td>whatsapp_code</td><td>int4</td><td>true</td><td></td></tr><tr><td>name_mt</td><td>varchar</td><td>true</td><td></td></tr><tr><td>broadcast_timestamp</td><td>timestamp</td><td>true</td><td></td></tr><tr><td>name_pb</td><td>varchar</td><td>true</td><td></td></tr><tr><td>is_crowd_sourced</td><td>bool</td><td>true</td><td></td></tr><tr><td>created_at</td><td>timestamp</td><td>true</td><td></td></tr><tr><td>updated_at</td><td>timestamp</td><td>true</td><td></td></tr><tr><td>is_bolbhav_plus</td><td>bool</td><td>true</td><td></td></tr></tbody></table>

## Description of fields used in Bolbhav App

### id

Primary key of the table.

### is\_active

This store whether we are still using this mandi\_id. In mandi table it is restricted to delete a row because there might be dependecies in mandi\_price table. Hence, a row can be marked inactive instead by making is\_active False.

### is\_bolbhav\_plus

If this is true then the mandi name is visible on the Bolbhav Android App and Bolbhav Plus Webapp.

### is\_crowdsourced

This was used during the Bolbhav Chhindwara experiment and not is use anymore.

***

### mandi\_name

english name of the mandi

### mandi\_name\_hi

Hindi name of the mandi

### name\_mt

Marathi name of the mandi

### name\_pb

Punjabi name of the mandi

### gov\_name

Name of the mandi in government records e.g Agmarknet.

### gov\_name\_hi

Hindi name of the mandi in government records e.g Agmarknet.

***

### district\_id, district, district\_hi

Tells about the district's id, district's english name, and district's Hindi name fromt the address table.

### state\_id, state, state\_hi

Tells about the state's id, state's english name, and state's Hindi name fromt the address table.

### pincode

tells the pincode of the mandi

### registration\_date

the day the mandi is added in the table

### created\_at

Later this field is added to capture the timestamp of row addition. The registration\_date can be deleted.

### updated\_at

timestamp at which the row was last updated.

### latest\_update

date for which the last prices were updated in the mandi\_price table from the government sources. This table was used in the Bolbhav chatbot and not used in Android or the webapp. The Bolbhav website use this table to show the prices.&#x20;

### broadcast\_timestamp

During the WhatsApp Chatbot, a cron job used to run and send a message on WhatsApp whenever the prices for a mandi is updated in the mandi\_price table. This filed store the timestamp of the last broadcast message.

### manager\_ids

On the WhatsApp chatbot, we allowed verified users who were mandi officials to update the prices directly in the Bolbhav database. This field carries the user\_id of all the whitelisted phone numbers that are allowed to update the prices of that mandi. Currently, it is used in the Mandi Price Update Webapp. This is a list field containing multiple user ids with comma-separated.
