> 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/works/reference-implementations/muktasoft-v2.2/deployment/muktasoft-services/rate-analysis.md).

# Rate Analysis

## Overview

The service generates rate analysis for SOR (Schedule of Rates) compositions using four APIs:

1. **Job Management**:
   * **Create Job API**: Creates a new job.
   * **Search Job API**: Searches for existing jobs.
2. **Rate Analysis**:
   * **Generate Rate Analysis API**: Generates rate analysis.
   * **Create Rate Analysis API**: Saves the rate analysis.

To save the rate analysis per unit, the scheduler/create API is triggered. This internally calls the Create API and computes the rates generated with the help of the Calculate API.&#x20;

This streamlined process ensures accurate rate analysis for SOR compositions.

## Dependency

* DIGIT backbone services
* Persister
* MDMSV2
* IDgen

## Sequence Diagram

<figure><img src="/files/Sn9Es2hLPbICHKwLd8jF" alt=""><figcaption><p>Rate Analysis</p></figcaption></figure>

<figure><img src="/files/wyz7YgM36oRagXrDg7TA" alt=""><figcaption><p>Scheduler</p></figcaption></figure>

## API Specifications

<https://raw.githubusercontent.com/egovernments/DIGIT-Specs/works-v2/Domain%20Services/Works/Rate-Analysis-v1.0.0.yaml>

## DB Diagram

<div align="left"><figure><img src="/files/76dAEfql2UFnotrh0sJD" alt="" width="563"><figcaption><p>Rate Analysis Schedule Tables</p></figcaption></figure></div>

## Description

The Rate Analysis Save API internally calls the existing MDMSv2 API to save the rates, eliminating the need for a new database design. The Rate Analysis Create API generates the rate analysis in real-time.

The client should call the Scheduler Create API to save the generated rate analysis. This API creates a job that includes a list of SORs requiring rate revisions (even a single SOR is passed as a list).


---

# 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/works/reference-implementations/muktasoft-v2.2/deployment/muktasoft-services/rate-analysis.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.
