Estimate

Provides an overview of the configuration of the estimate service

Overview

Estimate Service allows users to create estimates and forward them for Workflow approval to higher authorities across departments for technical, financial, and admin sanctions. A prepared estimate can then be tendered out for contracting.

Refer to the low-level technical design documentation for more information on estimate service.

Refer to the functional specifications for details on the capabilities supported by this service.

Pre-requisites

The following services need to be running for the Estimate Service to function:

  • Project

  • MDMS

  • Workflow

  • Notification

  • Access Control

  • User

  • IDGen

  • mdmsV2

  • Contract Service

  • Measurement Service

  • DIGIT backbone services (PostgreSQL, Elastic Search, Zuul)

  • Persister

  • Indexer

Key Functionalities

  • Create/update/search for Work estimates for a project.

  • Allows upload of offline documents related to estimate creation as part of Create.

  • Workflow and inbox integration

  • Create/update/search for Work Revised Estimate for an existing approved estimate.

Code

Estimate

Configuration

MDMS Configuration

Configure roles, actions and role-action mappings as per the table below by referring to this document:

RoleAPIs

ESTIMATE_CREATOR

/estimate-service/estimate/v1/_create

/estimate-service/estimate/v1/_search

/wms/estimate/_search

ESTIMATE_VERIFIER

/estimate-service/estimate/v1/_update

/estimate-service/estimate/v1/_search

/wms/estimate/_search

TECHNICAL_SANCTIONER

/estimate-service/estimate/v1/_update

/estimate-service/estimate/v1/_search

/wms/estimate/_search

ESTIMATE_APPROVER

/estimate-service/estimate/v1/_update

/estimate-service/estimate/v1/_search

/wms/estimate/_search

ESTIMATE_VIEWER

/estimate-service/estimate/v1/_search

/wms/estimate/_search

EMPLOYEE_COMMON

/inbox/v2/_search

Refer to the sample here.

Persister Configuration

The persister file for the service is called estimate-service.yml.

https://github.com/egovernments/works-configs/blob/DEV/egov-persister/estimate-service.yml

Follow the steps here for configuring this.

Indexer Configuration

Ensure the below files are present in https://github.com/egovernments/works-configs/blob/DEV/egov-indexer/estimateservices-indexer.yml

In case the above files are not present, add them in the given location and restart the ‘egov-indexer’ service in the respective environment. Before restarting the service ensure the below configurations are done.

Note: Add this config in the respective environment YAML file in the DevOps repository and then deploy the service.

Idgen Configuration

In the common-masters folder of MDMS, locate the IDFormat.json file. ID formats should be configured for the Estimate number as well as Estimate Detail objects. Make sure the following lines are added and the format modified per implementation:

{
  "tenantId": "pg",
  "moduleName": "common-masters",
  "IdFormat": [
    {
      "format": "ES/[fy:yyyy-yy]/[SEQ_ESTIMATE_NUM]",
      "idname": "estimate.number"
    },
    {
      "format": "EP/[fy:yyyy-yy]/[cy:MM]/ESTIMATE_NUM/[SEQ_ESTIMATE_DETAIL_NUM]",
      "idname": "estimate.detail.number"
    }]
}

Other masters for Estimate:

The following masters need to be configured for the Estimate service. Please make sure to use the same master name and module names:

UOM - Unit of measurement

Overheads

Workflow Configuration

The workflow configuration for Estimate is as follows. This payload needs to be called against businessService _create API for workflow configuration:

"BusinessServices": [
    {
      "tenantId": "statea",
      "businessService": "mukta-estimate",
      "business": "estimate-service",
      "businessServiceSla": 432000000,
      "states": [
	  {
          "sla": null,
          "state": null,
          "applicationStatus": "SUBMITTED",
          "docUploadRequired": false,
          "isStartState": true,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "SUBMIT",
              "nextState": "PENDINGFORVERIFICATION",
              "roles": [
                "ESTIMATE_CREATOR"
              ]
            }
          ]
        },
        {
          "sla": 172800000,
          "state": "PENDINGFORVERIFICATION",
          "applicationStatus": "VERIFIED",
          "docUploadRequired": false,
          "isStartState": true,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "VERIFYANDFORWARD",
              "nextState": "PENDINGFORTECHNICALSANCTION",
              "roles": [
                "ESTIMATE_VERIFIER"
              ]
            },
            {
              "action": "SENDBACK",
              "nextState": "PENDINGFORCORRECTION",
              "roles": [
                "ESTIMATE_VERIFIER"
              ]
            },
            {
              "action": "REJECT",
              "nextState": "REJECTED",
              "roles": [
				"ESTIMATE_VERIFIER"
              ]
            }
          ]
        },
        {
          "sla": 86400000,
          "state": "PENDINGFORTECHNICALSANCTION",
          "applicationStatus": "TECHNICALLY SANCTIONED",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "TECHNICALSANCTION",
              "nextState": "PENDINGFORAPPROVAL",
              "roles": [
                "TECHNICAL_SANCTIONER"
              ]
            },
            {
              "action": "SENDBACK",
              "nextState": "PENDINGFORVERIFICATION",
              "roles": [
                "TECHNICAL_SANCTIONER"
              ]
            },
            {
              "action": "SENDBACKTOORIGINATOR",
              "nextState": "PENDINGFORCORRECTION",
              "roles": [
				"TECHNICAL_SANCTIONER"
              ]
            },
            {
              "action": "REJECT",
              "nextState": "REJECTED",
              "roles": [
				"TECHNICAL_SANCTIONER"
              ]
            }
          ]
        },
        {
          "sla": 86400000,
          "state": "PENDINGFORAPPROVAL",
          "applicationStatus": "SENT BACK",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "SENDBACK",
              "nextState": "PENDINGFORTECHNICALSANCTION",
              "roles": [
                "ESTIMATE_APPROVER"
              ]
            },
            {
              "action": "SENDBACKTOORIGINATOR",
              "nextState": "PENDINGFORCORRECTION",
              "roles": [
				"ESTIMATE_APPROVER"	
              ]
            },
            {
              "action": "APPROVE",
              "nextState": "APPROVED",
              "roles": [
                "ESTIMATE_APPROVER"
              ]
            },
            {
              "action": "REJECT",
              "nextState": "REJECTED",
              "roles": [
				"ESTIMATE_APPROVER"	
              ]
            }
          ]
        },
        {
          "sla": 86400000,
          "state": "PENDINGFORCORRECTION",
          "applicationStatus": "RE-SUBMITTED",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "RE-SUBMITTED",
              "nextState": "PENDINGFORVERIFICATION",
              "roles": [
                "ESTIMATE_CREATOR"
              ]
            },
            {
              "action": "SENDBACKTOORIGINATOR",
              "nextState": "PENDINGFORCORRECTION",
              "roles": [
                "ESTIMATE_CREATOR"
              ]
            },
            {
              "action": "REJECT",
              "nextState": "REJECTED",
              "roles": [
                "ESTIMATE_CREATOR"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "APPROVED",
          "applicationStatus": "APPROVED",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": true,
          "isStateUpdatable": false,
          "actions": null
        },
        {
          "sla": null,
          "state": "REJECTED",
          "applicationStatus": "REJECTED",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": true,
          "isStateUpdatable": false,
          "actions": null
        }
      ]
    }
  ]

Inbox Configuration

Inbox should be configured if Workflow is configured for the Estimate Service. If there is no workflow involved, this can be skipped.

Add the inbox-v2 configuration in a respective environment in MDMS as it has been done here. Below is the inbox configuration for the Estimate service:

to

Deployment Details

The below variables should be configured well before the deployment of the estimate service build image. These are configured in the DevOps repository:

  • Add these ‘db-host’,’db-name’,’db-url’, ’domain’ and all the digit core platform services configurations (Idgen, workflow, user etc.) in respective environments YAML file.

  • Add estimate-service related environment variables’ value like the way it's done in ‘dev’ environment YAML file.

  • Add the ‘egov-mdms-service’ related configuration to the respective environment YAML file. Make sure you change the gitsync.branch name.

  • Check the estimate-service persister file is added in the egov-persister.perister-yml-path variable. If not, follow the steps outlined here.

  • Make sure to add the DB (Postgres and flyway) username & password in the respective environment secret YAML file. Follow the steps given here.

  • Ensure the DIGIT core services-related secrets are added to the respective environment secret file. Follow the steps given here.

Integration Details

Base Path: /estimates/

API spec

Postman collection for this service is available here.

Last updated

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.