> 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/exemplar/ifix-dashboard/documents/ifix-reference-dashboard/fiscal-event-aggregator.md).

# iFIX Fiscal Event Aggregator

## Overview

Fiscal Event Aggregator is a java standalone application, which runs as Cron Job to aggregate the fiscal event data from the Druid data store to Postgres DB.

### Version History

Current Version : 2.0.0

## Prerequisites

Before you proceed with the configuration, make sure the following pre-requisites are met

1. Java 8
2. Druid DB & Postgres DB should be up and running

## Features

Fiscal-Event-Aggregator computes the aggregate of data over a selected time period. Aggregator will apply the time range filter according to the following approach :

{% hint style="info" %}
*Fiscal periods will be picked up as per the current system time. The current year will be the current fiscal period starting from 1st of April of the current year to 31st March of (current year+1). And it will also aggregate the data of one previous fiscal year starting from 1st of April of (current year -1)  to 31st March of the current year.*
{% endhint %}

Follow the steps below to aggregate the final fiscal event data as per the fiscal time periods.

1. Group the sum of the  amount based on department entity ancestry\[6] id (`attributes.departmentEntity.ancestry[6].id`) that is GP (Gram Panchayat), COA (chart of account) id, and event type.
2. Difference of the sum of amount of "DEMAND" and "RECEIPT" event type with respect to distinct department entity ancestry\[6] id (`attributes.departmentEntity.ancestry[6].id`) that is GP (Gram Panchayat).
3. Difference of the sum of amount of "BILL" and "PAYMENT" event type with respect to distinct department entity ancestry\[6] id (`attributes.departmentEntity.ancestry[6].id`) that is GP(Gram Panchayat).

Upsert the final aggregated fiscal event data into the Postgres DB.

## Environment

*Note: Below environment variables need to be configured with respect to the environment*

| **Key**                   | **Value**           | **Description**                                                                                                                                                             |
| ------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DRUID_CONNECT_PROTOCOL`  | `HTTP`              | This is a hardcoded value And won’t change w\.r.t environment. And It depends upon the druid broker’s protocol that is getting used to connect.                             |
| `DRUID_CONNECT_PORT`      | `8082`              | This is a hardcoded value And won’t change w\.r.t environment. It depends upon the druid broker protocol that we are using and the corresponding port of that druid broker. |
| `DRUID_HOST`              | `druid-broker.olap` | this is kept under `configmaps`.                                                                                                                                            |
| `FISCAL_EVENT_DATASOURCE` | `fiscal-event`      | This is the data Source present in Druid DB. It is the same as defined in Druid DB.                                                                                         |

## Interaction Diagram

![](https://2287351256-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mfb8ehcimjt6ER7QOME%2F-MklXY46y5rIoW2wy_WZ%2F-MklXxobq3fW58tYzQ5D%2Fimage.png?alt=media\&token=0d606647-f5ad-4637-b8ab-4e124f198273)

## Configuration

Update the configurations in the dev.yaml, qa.yml, prod.yaml file.

> [![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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digit.org/public-finance/v2.3/exemplar/ifix-dashboard/documents/ifix-reference-dashboard/fiscal-event-aggregator.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
