# Contracts

## Overview

The Contracts service allows users to enter, update, search and store functional details linked to works contracts.

## API Specifications

**Base path:**`/contracts`

### API Contract Link

API spec [YAML is here.](https://raw.githubusercontent.com/egovernments/DIGIT-Specs/master/Domain%20Services/Works/Contract-Service-v1.0.0.yaml) Click below to view it in Swagger Editor.

{% embed url="<https://editor.swagger.io/?url=https://raw.githubusercontent.com/egovernments/DIGIT-Specs/master/Domain+Services/Works/Contract-Service-v1.0.0.yaml>" %}

## High Level Design

#### Flow for revised contracts

<figure><img src="/files/FON5ewdR8RHPajkc4J5b" alt=""><figcaption><p>High level design diagram</p></figcaption></figure>

## Data Model&#x20;

### DB Schema Diagram

<figure><img src="/files/YrpfMh9gLJzZnVqXqss8" alt=""><figcaption></figcaption></figure>

### Web Sequence Diagrams

{% tabs %}
{% tab title="Create" %}

<figure><img src="https://github.com/egovernments/DIGIT-Works/blob/master/backend/contracts/docs/SequenceDiagrams/pngs/ContractCreation.png?raw=true" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Update" %}

<figure><img src="https://github.com/egovernments/DIGIT-Works/blob/master/backend/contracts/docs/SequenceDiagrams/pngs/ContractUpdation.png?raw=true" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Search" %}

<figure><img src="/files/G3w7TSWZphzQeGR7a9O0" alt=""><figcaption></figcaption></figure>

{% endtab %}
{% endtabs %}

#### Creation & Consumption Of Revised Contracts

Below are the sequence diagrams for the creation and consumption of revision contracts.&#x20;

{% tabs %}
{% tab title="Creation of revision contract" %}

<figure><img src="/files/A5VSiz1yZ46LEtLgb6ig" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Consumption of revisions" %}

<figure><img src="/files/NxGEyusLD2FZymDoZZVL" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Related Topics

* [Functional specifications - Contracts](/works/specifications/functional-specifications/contracts.md)
* [Contracts module service configuration](/works/setup/configure-works/service-configuration/contract.md)
* [Contracts UI configuration - for MuktaSoft](/works/reference-implementations/muktasoft-v2.2/deployment/sms-adapter-services/contact-notification-service.md)
* [Contracts user stories](/works/reference-implementations/muktasoft-v2.2/specifications/functional-requirements/user-stories/work-order.md) - for MuktaSoft


---

# Agent Instructions: 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:

```
GET https://docs.digit.org/works/platform/architecture/low-level-design/services/contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
