> 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="https://content.gitbook.com/content/Oahp3xBKoPsr1r1NAaNj/blobs/1O9O6MQqNzNtOsTk5Bsl/Rate%20Analysis.png" alt=""><figcaption><p>Rate Analysis</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/Oahp3xBKoPsr1r1NAaNj/blobs/aV9GQEDja9otlSf1LCEz/job%20scheduler.png" 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="https://content.gitbook.com/content/Oahp3xBKoPsr1r1NAaNj/blobs/ddsMJ9pZ3rSsyHCUw2At/rate-analysis-scheduler_db_schema.png" 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 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/works/reference-implementations/muktasoft-v2.2/deployment/muktasoft-services/rate-analysis.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.
