{
  "openapi": "3.1.1",
  "info": {
    "title": "Automation ERP API",
    "description": "Lead → Proposal → Work Order → Project → Invoice → Payment.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://apidev.visionpower.technobliss.co.in/"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Liveness and readiness of the API and its database.",
        "description": "Returns 200 when every check is healthy, otherwise 503 with the failing checks in data.",
        "operationId": "Health",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfHealthResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfHealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Profile, roles, permission codes and theme of the signed-in user.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfGetMeResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/industries": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Industries for client forms and filters; includeInactive=true also lists retired ones.",
        "parameters": [
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfListIndustriesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/pending-expenses": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "Director/Operations Head work queue: current editable proposals whose expense review is not completed, including newly created proposals. Includes proposal creator and a paged result; closed, locked and completed proposals are excluded.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfPendingProposalExpenseItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/expense-review": {
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "Request expense review, complete or return it (Director/Operations Head only), or submit a reviewed proposal for approval. State, history and dashboard notifications are saved atomically.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewProposalExpensesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{id}/follow-ups": {
      "post": {
        "tags": [
          "Follow-ups"
        ],
        "summary": "Add a follow-up to an open lead; the assignee defaults to the lead's owner. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFollowUpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfFollowUpChangedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/site-visits/{id}/report": {
      "put": {
        "tags": [
          "Site visits"
        ],
        "summary": "Upload or replace the visit report (multipart field 'file'; PDF, JPG, PNG, Excel or Word up to 20 MB). Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSiteVisitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/site-visits/{id}/report/content": {
      "get": {
        "tags": [
          "Site visits"
        ],
        "summary": "Downloads a site-visit report after checking access to its lead.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Sign in with email and password; returns a 15-minute access token and sets the 7-day refresh token as an HttpOnly cookie (kept after the browser closes only with remember).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLoginResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "423": {
            "description": "Locked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Rotate the refresh token from the cookie (or, without one, the body): it is revoked, a new access token returned and the new refresh token set in the cookie. Reuse of a rotated token signs out every session.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfRefreshResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Revoke this browser's refresh token (cookie, else body) and clear the cookie. Safe to repeat.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/logout-all": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Sign out everywhere: revoke all sessions, reject existing access tokens and notify connected pages immediately.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLogoutAllResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/change-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Change the signed-in user's password (minimum 10 characters); every device is signed out.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Search, filter, sort and page clients.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industryId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfClientListItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Create a client, optionally with contacts. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfCreateClientResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/{id}": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Client details with live contacts, primary first.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfGetClientResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Clients"
        ],
        "summary": "Update the client fields; send the rowVersion read with the client.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfUpdateClientResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Clients"
        ],
        "summary": "Soft-delete a client that nothing references; otherwise 409 common.in_use (deactivate instead).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfDeleteClientResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/suggest-code": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Suggest a readable unused client code for a name.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSuggestClientCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/{id}/deactivate": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Deactivate: the client stays readable but no new leads can use it. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSetClientStatusResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/{id}/activate": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Reactivate a client. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSetClientStatusResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/{clientId}/contacts": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Add a contact; the client's first contact, or one sent with isPrimary, becomes primary. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddClientContactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfAddClientContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/{clientId}/contacts/{id}": {
      "put": {
        "tags": [
          "Clients"
        ],
        "summary": "Update a contact's name, designation, email and mobile.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClientContactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfUpdateClientContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Clients"
        ],
        "summary": "Remove a contact; a removed primary hands over to the oldest remaining contact.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfClientContactsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/{clientId}/contacts/{id}/primary": {
      "post": {
        "tags": [
          "Clients"
        ],
        "summary": "Make this the client's only primary contact. Safe to repeat.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfClientContactsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "One page of top-level services with their sub-services (a search keeps a matching group whole), or of ?parent='s sub-services; includeInactive=true lists retired ones.",
        "parameters": [
          {
            "name": "parent",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfServiceTreeNode"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Services"
        ],
        "summary": "Add a service line, or a sub-service under parentServiceId (two levels only). Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfCreateServiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/tree": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "Every service line with its sub-services, in display order. Only leaves (isLeaf) can be quoted. Readable with master.read or proposal.create (the proposal service picker).",
        "parameters": [
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfServiceTreeResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{id}": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "One service with its parent's name.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfServiceResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Services"
        ],
        "summary": "Update code, name, order and (leaves only) UOM, rate and HSN/SAC; send the rowVersion read with it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfUpdateServiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{id}/activate": {
      "post": {
        "tags": [
          "Services"
        ],
        "summary": "Activate a service (a sub-service needs an active service line). Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSetServiceStatusResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{id}/deactivate": {
      "post": {
        "tags": [
          "Services"
        ],
        "summary": "Deactivate a service; a service line takes its sub-services with it. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSetServiceStatusResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{id}/proposal-content": {
      "get": {
        "tags": [
          "Services"
        ],
        "summary": "A service's proposal library: fields (service lines), the line's fields (sub-services), scope text and quantity source (leaves) and content items by kind. Readable with master.read or proposal.create.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalContentResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Services"
        ],
        "summary": "Replace a service's proposal library; rows sent with an id are kept, new rows added, rows left out removed. Send the service's rowVersion; the response carries the new one.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveProposalContentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalContentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rate-card": {
      "get": {
        "tags": [
          "Rate card"
        ],
        "summary": "INTERNAL: every grade's hourly rate on ?asOf= (today in India when omitted).",
        "parameters": [
          {
            "name": "asOf",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfRateCardResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Rate card"
        ],
        "summary": "INTERNAL: set a grade's rate from a date; the rate in force then ends the day before. Repeating it is harmless.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetRateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfRateHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rate-card/history": {
      "get": {
        "tags": [
          "Rate card"
        ],
        "summary": "INTERNAL: all rates of ?grade=, newest first.",
        "parameters": [
          {
            "name": "grade",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfRateHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/service-types": {
      "get": {
        "tags": [
          "Service types"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfIReadOnlyListOfServiceTypeResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Service types"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfServiceTypeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/service-types/{id}": {
      "put": {
        "tags": [
          "Service types"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfServiceTypeResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{serviceId}/standards": {
      "get": {
        "tags": [
          "Service Standards"
        ],
        "summary": "Search, sort and page applicable standards and regulations.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfServiceStandardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Service Standards"
        ],
        "summary": "Create an applicable standard or regulation.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceStandardRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfServiceStandardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{serviceId}/standards/{id}": {
      "get": {
        "tags": [
          "Service Standards"
        ],
        "summary": "Get one applicable standard or regulation.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfServiceStandardResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Service Standards"
        ],
        "summary": "Update an applicable standard or regulation.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceStandardRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfServiceStandardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Service Standards"
        ],
        "summary": "Soft-delete an applicable standard or regulation.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfDeleteServiceStandardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{serviceId}/objectives": {
      "get": {
        "tags": [
          "Objectives"
        ],
        "summary": "Search, sort and page objectives.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfObjectiveResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Objectives"
        ],
        "summary": "Create an objective.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateObjectiveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfObjectiveResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/{serviceId}/objectives/{id}": {
      "get": {
        "tags": [
          "Objectives"
        ],
        "summary": "Get one objective.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfObjectiveResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Objectives"
        ],
        "summary": "Update an objective.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateObjectiveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfObjectiveResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Objectives"
        ],
        "summary": "Permanently delete an objective.",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfDeleteObjectiveResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/expense-heads": {
      "get": {
        "tags": [
          "Expense heads"
        ],
        "summary": "Every expense head in display order with the service lines it is offered for (none = common); includeInactive=true lists retired ones. Readable with master.read or proposal.create.",
        "parameters": [
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfExpenseHeadListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Expense heads"
        ],
        "summary": "Add an expense head. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExpenseHeadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfExpenseHeadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/expense-heads/{id}": {
      "put": {
        "tags": [
          "Expense heads"
        ],
        "summary": "Update an expense head and its service lines; send the rowVersion read with it. Proposals keep the lines they copied.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExpenseHeadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfExpenseHeadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/expense-heads/{id}/activate": {
      "post": {
        "tags": [
          "Expense heads"
        ],
        "summary": "Offer the head on new proposals again. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfExpenseHeadResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/expense-heads/{id}/deactivate": {
      "post": {
        "tags": [
          "Expense heads"
        ],
        "summary": "Stop offering the head on new proposals. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfExpenseHeadResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposal-settings": {
      "get": {
        "tags": [
          "Proposal settings"
        ],
        "summary": "Company text, approach table, HSE, exclusions, assumptions, commercial note, closing, confidentiality, validity, default SAC, payment terms and signatory. Readable with master.read or proposal.create.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalSettingsResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Proposal settings"
        ],
        "summary": "Replace the proposal settings; send the rowVersion read with them. Payment terms must add up to 100 %; the signatory must be an active user.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProposalSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "The proposal register: search (number, title, client), status, owner, client and lead filters, sort and paging; each row carries its current revision's reference, status and value.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "leadId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfProposalListItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{id}": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "A proposal's header: lead (link back), client, contact, owner, enquiry and project, and its revisions newest first.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/compare": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "Compare two revisions of the proposal (from → to): service lines added, removed or with other field values; sub-services and expenses with their tick, quantity, rate and amount on each side; milestones; site plan and totals with the value change. Only rows that differ are listed.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionDiffResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "One revision in full for the editor: services with field values and sub-services, content rows, sections, approach, expenses, milestones, site plan and totals.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions": {
      "post": {
        "tags": [
          "Proposals"
        ],
        "summary": "Make a new revision R(n+1) with a reason: a deep copy of the current revision (services, sub-services, content, sections, expenses, site plan, milestones, totals) as a Draft that becomes current; the previous one is locked (an approved one superseded, an issued one stays issued). Only from an approved or issued revision of an open proposal (else 409 proposal.revision_open / proposal.closed); send the proposal's rowVersion (else 409 common.stale_row). Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProposalRevisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/header": {
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "Edit the title, contact, enquiry, project, validity, cover status and discount. Only the current revision while Draft or Rejected (else 409 proposal.revision_locked); send the rowVersion read with it (else 409 common.stale_row). Returns the revision as saved with its totals.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProposalHeaderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/services": {
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "Set the service lines (added from the catalogue, removed with their content), field values and per sub-service the tick, quantity, rate and scope text. Only the current revision while Draft or Rejected (else 409 proposal.revision_locked); send the rowVersion read with it (else 409 common.stale_row). Returns the revision as saved with its totals.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveProposalServicesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/content": {
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "Replace the content rows (objectives, methodology, tools, standards, deliverables, inputs, milestones, exclusions); a copied row can be reset to the library. Only the current revision while Draft or Rejected (else 409 proposal.revision_locked); send the rowVersion read with it (else 409 common.stale_row). Returns the revision as saved with its totals.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveProposalItemsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/sections": {
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "Change text blocks (cover letter, background, about, HSE, closing …) and replace the approach table. Only the current revision while Draft or Rejected (else 409 proposal.revision_locked); send the rowVersion read with it (else 409 common.stale_row). Returns the revision as saved with its totals.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveProposalSectionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/expenses": {
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "Director or Operations Head only: set the site plan and expense lines; saving expenses is separate from completing their review. Only the current revision while Draft or Rejected (else 409 proposal.revision_locked); send the rowVersion read with it (else 409 common.stale_row). Returns the revision as saved with its totals.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveProposalExpensesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/milestones": {
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "Replace the payment milestones; they total 100 % (or none). Only the current revision while Draft or Rejected (else 409 proposal.revision_locked); send the rowVersion read with it (else 409 common.stale_row). Returns the revision as saved with its totals.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveProposalMilestonesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalRevisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/costing": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "INTERNAL costing sheet of a revision: cost lines (manpower by rate-card grade × persons × hours, travel, material, subcontract, contingency %), cost total, margin on the taxable value and the break-even discount.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalCostingResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "INTERNAL: replace the cost lines of the current draft (Draft or Rejected, else 409 proposal.revision_locked) with the revision's rowVersion (else 409 common.stale_row; a costing save moves it like any draft edit). Manpower takes the grade's rate-card rate on the revision date unless a rate is sent with a reason. Returns the costing sheet.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveProposalCostingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalCostingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{leadId}/proposals": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "Every proposal of the lead, newest first, with the value of the open ones; for the lead's Proposals tab.",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadProposalsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Proposals"
        ],
        "summary": "Prepare a proposal from the lead: number from the PRO series, R0 copied from the lead's services, the service library and the proposal settings (no expense lines); a lead before Proposal Prep moves there. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateProposalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfGenerateProposalResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/approval": {
      "get": {
        "tags": [
          "Proposal approval"
        ],
        "summary": "Approval state of a revision for the caller: status and rowVersion, the level it would need if sent now and why (margin_below_floor, discount_above_limit, not_costed), the pending submission, every submission, and whether the caller may submit, decide or issue.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalApprovalStateResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/submit": {
      "post": {
        "tags": [
          "Proposal approval"
        ],
        "summary": "Send the current Draft or Rejected revision for approval (else 409 proposal.revision_locked) with its rowVersion (else 409 common.stale_row); a ₹0 revision is refused (400 proposal.nothing_priced). The revision is locked, costing included, until it is decided.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitProposalRevisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalApprovalStateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/approve": {
      "post": {
        "tags": [
          "Proposal approval"
        ],
        "summary": "Approve the pending submission (else 409 proposal.not_pending); only the level it needs or a higher one (else 403 proposal.approval_level). The revision is then ready to issue.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecideProposalApprovalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalApprovalStateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/reject": {
      "post": {
        "tags": [
          "Proposal approval"
        ],
        "summary": "Reject the pending submission with remarks (required); the revision goes back to Rejected for rework and can be sent again.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecideProposalApprovalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalApprovalStateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/issue": {
      "post": {
        "tags": [
          "Proposal approval"
        ],
        "summary": "Issue the approved current revision to the client (else 409 proposal.not_approved) with its rowVersion (else 409 common.stale_row): stamps the issue date and valid-until, supersedes an earlier issued revision, creates an Internal Work Order when isFinal is true, notes it on the lead's timeline and moves an open lead before Submitted to Submitted.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueProposalRevisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalApprovalStateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposal-approvals": {
      "get": {
        "tags": [
          "Proposal approval"
        ],
        "summary": "Approvals inbox: pending submissions the caller decides (their level and below), oldest first, paged.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfPendingApprovalItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposal-approval-rules": {
      "get": {
        "tags": [
          "Proposal approval"
        ],
        "summary": "INTERNAL approval levels: who approves at each, the margin floor and discount limit (null = none) below or above which a revision goes to the next level, and the latest 50 changes with who made them and why.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfApprovalRulesResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Proposal approval"
        ],
        "summary": "Set a level's limits (Director only) with a reason and the rule's rowVersion (else 409 common.stale_row); the top level takes none (409 proposal.rule_top_level). The change is recorded and applies from the next submission; pending ones keep their level.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateApprovalRuleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfApprovalRulesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{id}/outcome": {
      "post": {
        "tags": [
          "Proposals"
        ],
        "summary": "Record the outcome with the proposal's rowVersion (else 409 common.stale_row): won (409 proposal.not_issued until the current revision is issued; 409 lead.closed when the lead is lost), lost with a lostReasonId, or on hold; won and lost are final (409 proposal.outcome_final). The lead's timeline notes it; won closes the lead as won; lost or on hold moves the lead when no other proposal of it is open. The same outcome again changes nothing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordProposalOutcomeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/pdf": {
      "get": {
        "tags": [
          "Proposal documents"
        ],
        "summary": "The client PDF of the revision (technical proposal and commercial offer; never costing). Not yet issued: rendered now with a DRAFT mark on every page. Issued (also once superseded): the copy kept when it was first rendered, so the client's copy never changes. Inline unless download=true; X-Document-Draft: true|false.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "download",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Stream"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/internal-work-order/pdf": {
      "get": {
        "tags": [
          "Proposal documents"
        ],
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "download",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Stream"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/internal-work-order": {
      "put": {
        "tags": [
          "Proposal documents"
        ],
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInternalWorkOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfInternalWorkOrderDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/proposals/{proposalId}/revisions/{revisionId}/email": {
      "get": {
        "tags": [
          "Proposal documents"
        ],
        "summary": "The email form's starting values for the revision: the contact's address, the owner on copy, the subject, a message signed by the owner, the PDF's file name, fromAccounts (the active mailboxes, default first) with defaultFromAccountId, and canSend (false while there is none). 409 proposal.not_sendable unless it is the issued current revision of a proposal not won or lost.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalEmailDraftResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Proposal documents"
        ],
        "summary": "Email the revision's client PDF (the kept issued copy) to the client from the mailbox fromAccountId (it gets a blind copy) with the subject and message as reviewed; replies go to the owner. 400 mail.account_unavailable for a retired account; 409 mail.password_unreadable when its password must be entered again. Logged on the lead as an Email activity once the mail server took it. 409 proposal.not_sendable; 503 email.not_configured or email.send_failed (nothing logged). Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "proposalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendProposalEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfProposalEmailSentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mail-accounts": {
      "get": {
        "tags": [
          "Mail accounts"
        ],
        "summary": "Every mail account, the default first, then active ones by name, then retired ones; hasPassword says whether a password is stored (it is never returned).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMailAccountListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Mail accounts"
        ],
        "summary": "Add a mail account (server, port, security, sign-in, from address and name); the password is stored encrypted. The first account, or one with isDefault, becomes the default. 409 on fromAddress when another live account uses it. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMailAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMailAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mail-accounts/{id}": {
      "put": {
        "tags": [
          "Mail accounts"
        ],
        "summary": "Change a mail account with the rowVersion read: a password replaces the stored one, none keeps it, clearPassword removes it; isDefault true makes it the only default.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMailAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMailAccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mail-accounts/{id}/activate": {
      "post": {
        "tags": [
          "Mail accounts"
        ],
        "summary": "Offer the account in Send to client again. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMailAccountResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mail-accounts/{id}/deactivate": {
      "post": {
        "tags": [
          "Mail accounts"
        ],
        "summary": "Stop offering the account; a retired account stops being the default. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMailAccountResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mail-accounts/{id}/test": {
      "post": {
        "tags": [
          "Mail accounts"
        ],
        "summary": "Send a short test email through the account to the given address and record when and whether it went through; sent=false carries the server's answer. 409 mail.password_unreadable when the stored password must be entered again.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestMailAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMailAccountTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "Search, filter, sort and page the leads the caller may see (pipeline list and kanban cards).",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stageId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sourceId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "minValue",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "maxValue",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfLeadListItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Leads"
        ],
        "summary": "Create a lead: number from the LEAD series, opening stage and probability, first history row. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLeadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfCreateLeadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/export.csv": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "Download all matching leads using the list filters, sort order and caller's data scope.",
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stageId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sourceId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "minValue",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "maxValue",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/stage-summary": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "Count per stage for the kanban headers; same filters as the list.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stageId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ownerId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sourceId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "minValue",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "maxValue",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadStageSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/lookups": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "Pipeline stages, lead sources and lost reasons for filters and lead forms.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadLookupsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/owners": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "Active users who can own leads (roles with lead.update), for the owner picker and filter.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadOwnersResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{id}": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "One lead with client, contact, owner and stage history (newest first); 404 outside the caller's scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfGetLeadResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Leads"
        ],
        "summary": "Edit contact, source, project details, location, probability and expected close; send the rowVersion read with the lead.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLeadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadChangedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{id}/stage": {
      "put": {
        "tags": [
          "Leads"
        ],
        "summary": "Move an open lead to another working stage; writes history and resets the probability. Won/Lost go through close.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveLeadStageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadChangedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{id}/owner": {
      "put": {
        "tags": [
          "Leads"
        ],
        "summary": "Reassign the lead to another user who can work leads.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReassignLeadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadChangedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{id}/timeline": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "The lead's feed, newest first: activities, stage changes and site visits; page with the returned nextCursor.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadTimelineResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{id}/activities": {
      "post": {
        "tags": [
          "Leads"
        ],
        "summary": "Log a call, meeting, site visit, email or note on an open lead; nextActionOn adds a follow-up for the owner. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogActivityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLogActivityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{id}/close": {
      "post": {
        "tags": [
          "Leads"
        ],
        "summary": "Close as won (with remarks) or lost (with a reason). Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloseLeadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadChangedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{leadId}/attachments": {
      "get": {
        "tags": [
          "Lead attachments"
        ],
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfIReadOnlyListOfLeadAttachmentResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Lead attachments"
        ],
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "files": {
                    "$ref": "#/components/schemas/IFormFileCollection"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfIReadOnlyListOfLeadAttachmentResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{leadId}/attachments/{attachmentId}/content": {
      "get": {
        "tags": [
          "Lead attachments"
        ],
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/v1/leads/{leadId}/attachments/{attachmentId}": {
      "put": {
        "tags": [
          "Lead attachments"
        ],
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfLeadAttachmentResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Lead attachments"
        ],
        "parameters": [
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/follow-ups": {
      "get": {
        "tags": [
          "Follow-ups"
        ],
        "summary": "Follow-ups due today, overdue or upcoming for an assignee (default: the caller) or a lead, earliest first.",
        "parameters": [
          {
            "name": "due",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assigneeId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "leadId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfFollowUpListItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/follow-ups/{id}/complete": {
      "put": {
        "tags": [
          "Follow-ups"
        ],
        "summary": "Mark a follow-up done (also on won or lost leads); safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteFollowUpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfFollowUpChangedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/follow-ups/{id}/reschedule": {
      "put": {
        "tags": [
          "Follow-ups"
        ],
        "summary": "Move an open follow-up to another day (today or later).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RescheduleFollowUpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfFollowUpChangedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dashboard/summary": {
      "get": {
        "tags": [
          "Dashboard"
        ],
        "summary": "KPI tiles: open, on-hold, new (this month) and stale leads; open proposals with pipeline and weighted value; won and lost this quarter with the won value; the caller's follow-ups due today and overdue.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfDashboardSummaryResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dashboard/funnel": {
      "get": {
        "tags": [
          "Dashboard"
        ],
        "summary": "Conversion funnel of the last `days` days (7–365, default 90): per stage the leads in it and those that entered it (with the share of the first stage), the source mix (new, won, won value) and lost reasons.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfDashboardFunnelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dashboard/team-performance": {
      "get": {
        "tags": [
          "Dashboard"
        ],
        "summary": "Per lead owner, highest pipeline first: open leads, open proposals with pipeline and weighted value, won and lost this quarter, won value and win rate.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfTeamPerformanceResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dashboard/margin": {
      "get": {
        "tags": [
          "Dashboard"
        ],
        "summary": "INTERNAL margin of the costed proposals whose current revision falls in the last `months` calendar months (1–24, default 6): overall, per preparer (lowest margin first) and per month (empty months included). Margin = taxable value − cost; % = Σ margin ÷ Σ taxable value.",
        "parameters": [
          {
            "name": "months",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMarginDashboardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/{id}/site-visits": {
      "post": {
        "tags": [
          "Site visits"
        ],
        "summary": "Record a site visit on an open lead (visit day, findings, visitor — default the caller). Requires Idempotency-Key; upload the report with PUT /site-visits/{id}/report.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordSiteVisitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSiteVisitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Site visits"
        ],
        "summary": "The lead's site visits, latest first, with their reports.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfSiteVisitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "List the current user's notifications, newest first.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfNotificationListItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/unread-count": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "How many of the current user's notifications are unread (the bell's badge; the client polls it every 60 s).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfUnreadNotificationsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/read-all": {
      "post": {
        "tags": [
          "Notifications"
        ],
        "summary": "Mark the current user's unread notifications read, up to upToId (the newest the bell showed) when given, so newer ones stay unread; safe to repeat. Returns how many were marked and how many are still unread.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkAllNotificationsReadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMarkAllNotificationsReadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/{id}/read": {
      "put": {
        "tags": [
          "Notifications"
        ],
        "summary": "Mark one of the current user's notifications read; safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkNotificationReadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfNotificationReadResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Search, filter (status, role), sort and page users.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "role",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfPagedResponseOfUserListItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create a user with roles and an initial password. Requires Idempotency-Key.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A new UUID per user action, reused when the same action is retried.",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfCreateUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/lookups": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Roles with their permissions, designations and departments for the user form.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfUserLookupsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "One user with designation, department, manager, roles and number of direct reports.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfUserResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update profile, reporting manager and roles; send the rowVersion read with the user. New roles apply at the next token refresh.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfUpdateUserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{id}/deactivate": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Deactivate and sign out everywhere; not for yourself or the last active Admin. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSetUserStatusResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{id}/activate": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Reactivate a user. Safe to repeat.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfSetUserStatusResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{id}/reset-password": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Set a new password, lift a lockout and sign the user out everywhere.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetUserPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfResetUserPasswordResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/master-data-import": {
      "post": {
        "tags": [
          "Master data import"
        ],
        "summary": "Validate every populated row in an .xlsx workbook, then import clients, contacts, services, rate card and users in one commit.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMasterDataImportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseOfMasterDataImportResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActivityType": {
        "enum": [
          "call",
          "meeting",
          "siteVisit",
          "email",
          "note",
          null
        ]
      },
      "AddClientContactRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPrimary": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "AddClientContactResponse": {
        "required": [
          "id",
          "contacts"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientContactResponse"
            }
          }
        }
      },
      "ApiError": {
        "required": [
          "code",
          "message",
          "field",
          "meta"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "field": {
            "type": [
              "null",
              "string"
            ]
          },
          "meta": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "ApiResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": { },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfAddClientContactResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AddClientContactResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfApprovalRulesResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApprovalRulesResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfClientContactsResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ClientContactsResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfCreateClientResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CreateClientResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfCreateLeadResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CreateLeadResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfCreateServiceResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CreateServiceResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfCreateUserResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CreateUserResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfDashboardFunnelResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DashboardFunnelResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfDashboardSummaryResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DashboardSummaryResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfDeleteClientResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DeleteClientResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfDeleteObjectiveResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DeleteObjectiveResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfDeleteServiceStandardResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DeleteServiceStandardResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfExpenseHeadListResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExpenseHeadListResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfExpenseHeadResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExpenseHeadResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfFollowUpChangedResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FollowUpChangedResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfGenerateProposalResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GenerateProposalResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfGetClientResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GetClientResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfGetLeadResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GetLeadResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfGetMeResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GetMeResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfHealthResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/HealthResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfInternalWorkOrderDetails": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InternalWorkOrderDetails"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfIReadOnlyListOfLeadAttachmentResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LeadAttachmentResponse"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfIReadOnlyListOfServiceTypeResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ServiceTypeResponse"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLeadAttachmentResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadAttachmentResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLeadChangedResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadChangedResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLeadLookupsResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadLookupsResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLeadOwnersResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadOwnersResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLeadProposalsResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadProposalsResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLeadStageSummaryResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadStageSummaryResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLeadTimelineResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadTimelineResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfListIndustriesResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ListIndustriesResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLogActivityResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LogActivityResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLoginResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LoginResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfLogoutAllResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LogoutAllResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfMailAccountListResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MailAccountListResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfMailAccountResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MailAccountResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfMailAccountTestResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MailAccountTestResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfMarginDashboardResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MarginDashboardResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfMarkAllNotificationsReadResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MarkAllNotificationsReadResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfMasterDataImportResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MasterDataImportResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfNotificationReadResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NotificationReadResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfObjectiveResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ObjectiveResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfClientListItem": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfClientListItem"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfFollowUpListItem": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfFollowUpListItem"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfLeadListItem": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfLeadListItem"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfNotificationListItem": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfNotificationListItem"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfObjectiveResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfObjectiveResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfPendingApprovalItem": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfPendingApprovalItem"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfPendingProposalExpenseItem": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfPendingProposalExpenseItem"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfProposalListItem": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfProposalListItem"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfServiceStandardResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfServiceStandardResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfServiceTreeNode": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfServiceTreeNode"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfSiteVisitResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfSiteVisitResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfPagedResponseOfUserListItem": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PagedResponseOfUserListItem"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalApprovalStateResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalApprovalStateResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalContentResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalContentResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalCostingResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalCostingResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalEmailDraftResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalEmailDraftResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalEmailSentResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalEmailSentResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalRevisionDiffResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalRevisionDiffResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalRevisionResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalRevisionResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfProposalSettingsResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalSettingsResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfRateCardResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RateCardResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfRateHistoryResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RateHistoryResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfRefreshResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RefreshResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfResetUserPasswordResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ResetUserPasswordResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfServiceResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ServiceResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfServiceStandardResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ServiceStandardResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfServiceTreeResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ServiceTreeResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfServiceTypeResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ServiceTypeResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfSetClientStatusResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SetClientStatusResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfSetServiceStatusResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SetServiceStatusResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfSetUserStatusResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SetUserStatusResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfSiteVisitResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SiteVisitResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfSuggestClientCodeResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SuggestClientCodeResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfTeamPerformanceResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TeamPerformanceResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfUnreadNotificationsResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UnreadNotificationsResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfUpdateClientContactResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateClientContactResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfUpdateClientResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateClientResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfUpdateServiceResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateServiceResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfUpdateUserResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateUserResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfUserLookupsResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserLookupsResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApiResponseOfUserResponse": {
        "required": [
          "success",
          "data",
          "errors"
        ],
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserResponse"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "ApprovalRuleChangeItem": {
        "required": [
          "id",
          "level",
          "oldMarginFloorPercent",
          "newMarginFloorPercent",
          "oldDiscountLimitPercent",
          "newDiscountLimitPercent",
          "changedById",
          "changedByName",
          "changedAt",
          "reason"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "level": {
            "$ref": "#/components/schemas/ProposalApprovalLevel"
          },
          "oldMarginFloorPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "newMarginFloorPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "oldDiscountLimitPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "newDiscountLimitPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "changedById": {
            "type": "integer",
            "format": "int64"
          },
          "changedByName": {
            "type": "string"
          },
          "changedAt": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "ApprovalRuleItem": {
        "required": [
          "level",
          "approverRoleCode",
          "marginFloorPercent",
          "discountLimitPercent",
          "isEditable",
          "updatedAt",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "level": {
            "$ref": "#/components/schemas/ProposalApprovalLevel"
          },
          "approverRoleCode": {
            "type": "string"
          },
          "marginFloorPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "discountLimitPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "isEditable": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApprovalRulesResponse": {
        "required": [
          "rules",
          "changes",
          "canEdit"
        ],
        "type": "object",
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalRuleItem"
            }
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalRuleChangeItem"
            }
          },
          "canEdit": {
            "type": "boolean"
          }
        }
      },
      "ChangePasswordRequest": {
        "required": [
          "currentPassword",
          "newPassword"
        ],
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string"
          },
          "newPassword": {
            "type": "string"
          }
        }
      },
      "ClientContactResponse": {
        "required": [
          "id",
          "name",
          "designation",
          "email",
          "mobile",
          "isPrimary",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPrimary": {
            "type": "boolean"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ClientContactsResponse": {
        "required": [
          "clientId",
          "contacts"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "integer",
            "format": "int64"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientContactResponse"
            }
          }
        }
      },
      "ClientListItem": {
        "required": [
          "id",
          "clientCode",
          "name",
          "industryId",
          "industryName",
          "gstin",
          "city",
          "stateCode",
          "ownerUserId",
          "ownerName",
          "status",
          "primaryContactName",
          "primaryContactEmail",
          "primaryContactMobile",
          "contactCount"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "clientCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "industryId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "industryName": {
            "type": [
              "null",
              "string"
            ]
          },
          "gstin": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerUserId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "ownerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ClientStatus"
          },
          "primaryContactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryContactEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryContactMobile": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ClientStatus": {
        "enum": [
          "active",
          "inactive"
        ]
      },
      "CloseLeadRequest": {
        "required": [
          "rowVersion",
          "outcome"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "outcome": {
            "$ref": "#/components/schemas/LeadOutcome"
          },
          "lostReasonId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CompleteFollowUpRequest": {
        "required": [
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ContactInput": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPrimary": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CreateClientRequest": {
        "required": [
          "clientCode",
          "name"
        ],
        "type": "object",
        "properties": {
          "clientCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "industryId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "gstin": {
            "type": [
              "null",
              "string"
            ]
          },
          "pan": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerUserId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "billingAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "pincode": {
            "type": [
              "null",
              "string"
            ]
          },
          "siteAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentTerms": {
            "type": [
              "null",
              "string"
            ]
          },
          "creditDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "contacts": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ContactInput"
            }
          }
        }
      },
      "CreateClientResponse": {
        "required": [
          "id",
          "clientCode",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "clientCode": {
            "type": "string"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateExpenseHeadRequest": {
        "required": [
          "name",
          "uom",
          "rateType",
          "defaultRate"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "uom": {
            "type": "string"
          },
          "rateType": {
            "$ref": "#/components/schemas/ExpenseRateType"
          },
          "defaultRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "qtyBasis": {
            "$ref": "#/components/schemas/ExpenseQtyBasis"
          },
          "defaultQty": {
            "type": "number",
            "format": "double",
            "default": 1
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "sortOrder": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "serviceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        }
      },
      "CreateFollowUpRequest": {
        "required": [
          "dueOn"
        ],
        "type": "object",
        "properties": {
          "dueOn": {
            "type": "string",
            "format": "date"
          },
          "assignedToId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateLeadRequest": {
        "required": [
          "clientId"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "integer",
            "format": "int64"
          },
          "projectBackground": {
            "type": [
              "null",
              "string"
            ]
          },
          "contactId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "sourceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "projectPriority": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectPriority"
              }
            ]
          },
          "projectType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectType"
              }
            ]
          },
          "numberOfDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "latitude": {
            "type": [
              "null",
              "string"
            ]
          },
          "longitude": {
            "type": [
              "null",
              "string"
            ]
          },
          "expectedClose": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "serviceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "stageId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "probability": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int16"
          },
          "ownerId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "CreateLeadResponse": {
        "required": [
          "id",
          "leadNo",
          "stageId",
          "probability",
          "ownerId",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "leadNo": {
            "type": "string"
          },
          "stageId": {
            "type": "integer",
            "format": "int64"
          },
          "probability": {
            "type": "integer",
            "format": "int16"
          },
          "ownerId": {
            "type": "integer",
            "format": "int64"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateMailAccountRequest": {
        "required": [
          "name",
          "fromAddress",
          "fromName",
          "host",
          "port",
          "security"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "fromAddress": {
            "type": "string"
          },
          "fromName": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer",
            "format": "int32"
          },
          "security": {
            "$ref": "#/components/schemas/MailSecurity"
          },
          "userName": {
            "type": [
              "null",
              "string"
            ]
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CreateObjectiveRequest": {
        "required": [
          "description"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ObjectiveType"
          }
        }
      },
      "CreateProposalRevisionRequest": {
        "required": [
          "reason",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateServiceRequest": {
        "required": [
          "serviceCode",
          "name"
        ],
        "type": "object",
        "properties": {
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "parentServiceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "sortOrder": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceTypeId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "CreateServiceResponse": {
        "required": [
          "id",
          "serviceCode",
          "level",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "level": {
            "type": "integer",
            "format": "int16"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateServiceStandardRequest": {
        "required": [
          "standardCode",
          "standardDescription"
        ],
        "type": "object",
        "properties": {
          "standardCode": {
            "type": "string"
          },
          "standardDescription": {
            "type": "string"
          }
        }
      },
      "CreateServiceTypeRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "CreateUserRequest": {
        "required": [
          "empCode",
          "fullName",
          "email",
          "roleCodes",
          "password"
        ],
        "type": "object",
        "properties": {
          "empCode": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "roleCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "password": {
            "type": "string"
          },
          "designationId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "departmentId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "reportingToId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateUserResponse": {
        "required": [
          "id",
          "empCode",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "empCode": {
            "type": "string"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DashboardFunnelResponse": {
        "required": [
          "days",
          "from",
          "to",
          "newLeads",
          "stages",
          "sources",
          "lostReasons"
        ],
        "type": "object",
        "properties": {
          "days": {
            "type": "integer",
            "format": "int32"
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "newLeads": {
            "type": "integer",
            "format": "int32"
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardFunnelStage"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardSourceMix"
            }
          },
          "lostReasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardLostReason"
            }
          }
        }
      },
      "DashboardFunnelStage": {
        "required": [
          "stageId",
          "code",
          "name",
          "sortOrder",
          "status",
          "current",
          "entered",
          "reached",
          "reachedPercent"
        ],
        "type": "object",
        "properties": {
          "stageId": {
            "type": "integer",
            "format": "int64"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "current": {
            "type": "integer",
            "format": "int32"
          },
          "entered": {
            "type": "integer",
            "format": "int32"
          },
          "reached": {
            "type": "integer",
            "format": "int32"
          },
          "reachedPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "DashboardLostReason": {
        "required": [
          "lostReasonId",
          "name",
          "count"
        ],
        "type": "object",
        "properties": {
          "lostReasonId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "DashboardSourceMix": {
        "required": [
          "sourceId",
          "name",
          "newLeads",
          "wonLeads",
          "wonValue"
        ],
        "type": "object",
        "properties": {
          "sourceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "newLeads": {
            "type": "integer",
            "format": "int32"
          },
          "wonLeads": {
            "type": "integer",
            "format": "int32"
          },
          "wonValue": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "DashboardSummaryResponse": {
        "required": [
          "today",
          "monthStart",
          "quarterStart",
          "openLeads",
          "onHoldLeads",
          "newLeadsThisMonth",
          "staleLeads",
          "staleAfterDays",
          "openProposals",
          "pipelineValue",
          "weightedValue",
          "wonThisQuarter",
          "wonValueThisQuarter",
          "lostThisQuarter",
          "followUpsDueToday",
          "followUpsOverdue"
        ],
        "type": "object",
        "properties": {
          "today": {
            "type": "string",
            "format": "date"
          },
          "monthStart": {
            "type": "string",
            "format": "date"
          },
          "quarterStart": {
            "type": "string",
            "format": "date"
          },
          "openLeads": {
            "type": "integer",
            "format": "int32"
          },
          "onHoldLeads": {
            "type": "integer",
            "format": "int32"
          },
          "newLeadsThisMonth": {
            "type": "integer",
            "format": "int32"
          },
          "staleLeads": {
            "type": "integer",
            "format": "int32"
          },
          "staleAfterDays": {
            "type": "integer",
            "format": "int32"
          },
          "openProposals": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "pipelineValue": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "weightedValue": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "wonThisQuarter": {
            "type": "integer",
            "format": "int32"
          },
          "wonValueThisQuarter": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "lostThisQuarter": {
            "type": "integer",
            "format": "int32"
          },
          "followUpsDueToday": {
            "type": "integer",
            "format": "int32"
          },
          "followUpsOverdue": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "DecideProposalApprovalRequest": {
        "type": "object",
        "properties": {
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DeleteClientResponse": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DeleteObjectiveResponse": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DeleteServiceStandardResponse": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ExpenseHeadListResponse": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseHeadResponse"
            }
          }
        }
      },
      "ExpenseHeadResponse": {
        "required": [
          "id",
          "name",
          "uom",
          "rateType",
          "defaultRate",
          "qtyBasis",
          "defaultQty",
          "hsnSac",
          "sortOrder",
          "isActive",
          "services",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "uom": {
            "type": "string"
          },
          "rateType": {
            "$ref": "#/components/schemas/ExpenseRateType"
          },
          "defaultRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "qtyBasis": {
            "$ref": "#/components/schemas/ExpenseQtyBasis"
          },
          "defaultQty": {
            "type": "number",
            "format": "double"
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseHeadServiceRef"
            }
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ExpenseHeadServiceRef": {
        "required": [
          "id",
          "serviceCode",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ExpensePrintMode": {
        "enum": [
          "lumpSum",
          "itemised"
        ]
      },
      "ExpenseQtyBasis": {
        "enum": [
          "typed",
          "seniorEngineerDays",
          "juniorEngineerDays",
          "siteEngineers",
          "siteDays",
          "engineerDays",
          "reportMandays"
        ]
      },
      "ExpenseRateType": {
        "enum": [
          "fixed",
          "perProposal",
          "percentOfExpenses"
        ]
      },
      "ExpenseReviewAction": {
        "enum": [
          "request",
          "complete",
          "returnForClarification",
          "submitForApproval",
          "invalidate"
        ]
      },
      "ExpenseReviewHistoryResponse": {
        "required": [
          "action",
          "fromStatus",
          "toStatus",
          "actorId",
          "actorName",
          "occurredAt",
          "remarks"
        ],
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/ExpenseReviewAction"
          },
          "fromStatus": {
            "$ref": "#/components/schemas/ExpenseReviewStatus"
          },
          "toStatus": {
            "$ref": "#/components/schemas/ExpenseReviewStatus"
          },
          "actorId": {
            "type": "integer",
            "format": "int64"
          },
          "actorName": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ExpenseReviewResponse": {
        "required": [
          "status",
          "requestedById",
          "requestedByName",
          "requestedAt",
          "reviewedById",
          "reviewedByName",
          "reviewedAt",
          "remarks",
          "noExpensesRequired",
          "history"
        ],
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/ExpenseReviewStatus"
          },
          "requestedById": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "requestedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "reviewedById": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "reviewedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "reviewedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          },
          "noExpensesRequired": {
            "type": "boolean"
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseReviewHistoryResponse"
            }
          }
        }
      },
      "ExpenseReviewStatus": {
        "enum": [
          "notRequested",
          "pending",
          "completed",
          "clarificationRequired"
        ]
      },
      "FollowUpChangedResponse": {
        "required": [
          "id",
          "leadId",
          "assignedToId",
          "dueOn",
          "status",
          "remarks",
          "completedAt",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "leadId": {
            "type": "integer",
            "format": "int64"
          },
          "assignedToId": {
            "type": "integer",
            "format": "int64"
          },
          "dueOn": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/FollowUpStatus"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FollowUpListItem": {
        "required": [
          "id",
          "leadId",
          "leadNo",
          "clientName",
          "assignedToId",
          "assignedToName",
          "dueOn",
          "status",
          "overdue",
          "remarks",
          "activityId",
          "completedAt",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "leadId": {
            "type": "integer",
            "format": "int64"
          },
          "leadNo": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "assignedToId": {
            "type": "integer",
            "format": "int64"
          },
          "assignedToName": {
            "type": "string"
          },
          "dueOn": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/FollowUpStatus"
          },
          "overdue": {
            "type": "boolean"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          },
          "activityId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FollowUpStatus": {
        "enum": [
          "open",
          "done",
          "cancelled"
        ]
      },
      "GenerateProposalRequest": {
        "required": [
          "title"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "contactId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "enquiryRef": {
            "type": [
              "null",
              "string"
            ]
          },
          "enquiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "projectName": {
            "type": [
              "null",
              "string"
            ]
          },
          "projectLocation": {
            "type": [
              "null",
              "string"
            ]
          },
          "endClientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        }
      },
      "GenerateProposalResponse": {
        "required": [
          "id",
          "proposalNo",
          "revisionId",
          "reference",
          "totalValue",
          "leadId",
          "leadStageId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "proposalNo": {
            "type": "string"
          },
          "revisionId": {
            "type": "integer",
            "format": "int64"
          },
          "reference": {
            "type": "string"
          },
          "totalValue": {
            "type": "number",
            "format": "double"
          },
          "leadId": {
            "type": "integer",
            "format": "int64"
          },
          "leadStageId": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "GetClientResponse": {
        "required": [
          "id",
          "clientCode",
          "name",
          "industryId",
          "industryName",
          "gstin",
          "pan",
          "ownerUserId",
          "ownerName",
          "billingAddress",
          "city",
          "stateCode",
          "pincode",
          "siteAddress",
          "paymentTerms",
          "creditDays",
          "status",
          "createdAt",
          "updatedAt",
          "rowVersion",
          "contacts"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "clientCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "industryId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "industryName": {
            "type": [
              "null",
              "string"
            ]
          },
          "gstin": {
            "type": [
              "null",
              "string"
            ]
          },
          "pan": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerUserId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "ownerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "billingAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "pincode": {
            "type": [
              "null",
              "string"
            ]
          },
          "siteAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentTerms": {
            "type": [
              "null",
              "string"
            ]
          },
          "creditDays": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "$ref": "#/components/schemas/ClientStatus"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientContactResponse"
            }
          }
        }
      },
      "GetLeadResponse": {
        "required": [
          "id",
          "leadNo",
          "client",
          "contact",
          "sourceId",
          "sourceName",
          "stage",
          "ownerId",
          "ownerName",
          "projectBackground",
          "projectPriority",
          "projectType",
          "numberOfDays",
          "latitude",
          "longitude",
          "probability",
          "expectedClose",
          "status",
          "lostReasonId",
          "lostReasonName",
          "closedAt",
          "createdAt",
          "updatedAt",
          "lastActivityAt",
          "nextFollowUpOn",
          "lastVisit",
          "rowVersion",
          "services",
          "stageHistory"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "leadNo": {
            "type": "string"
          },
          "client": {
            "$ref": "#/components/schemas/LeadClientRef"
          },
          "contact": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadContactRef"
              }
            ]
          },
          "sourceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "sourceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "stage": {
            "$ref": "#/components/schemas/LeadStageRef"
          },
          "ownerId": {
            "type": "integer",
            "format": "int64"
          },
          "ownerName": {
            "type": "string"
          },
          "projectBackground": {
            "type": "string"
          },
          "projectPriority": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectPriority"
              }
            ]
          },
          "projectType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectType"
              }
            ]
          },
          "numberOfDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "latitude": {
            "type": [
              "null",
              "string"
            ]
          },
          "longitude": {
            "type": [
              "null",
              "string"
            ]
          },
          "probability": {
            "type": "integer",
            "format": "int16"
          },
          "expectedClose": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "lostReasonId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "lostReasonName": {
            "type": [
              "null",
              "string"
            ]
          },
          "closedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastActivityAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "nextFollowUpOn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "lastVisit": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LeadLastVisit"
              }
            ]
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadServiceRef"
            }
          },
          "stageHistory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadStageChangeResponse"
            }
          }
        }
      },
      "GetMeResponse": {
        "required": [
          "id",
          "name",
          "email",
          "empCode",
          "designation",
          "department",
          "roles",
          "permissions",
          "theme"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "empCode": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          },
          "department": {
            "type": [
              "null",
              "string"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "theme": {
            "type": "string"
          }
        }
      },
      "GstTaxMode": {
        "enum": [
          "intraState",
          "interState"
        ]
      },
      "HealthEntry": {
        "required": [
          "status",
          "durationMs",
          "description"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "durationMs": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "HealthResponse": {
        "required": [
          "status",
          "durationMs",
          "checks"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "durationMs": {
            "type": "number",
            "format": "double"
          },
          "checks": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/HealthEntry"
            }
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "IFormFileCollection": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/IFormFile"
        }
      },
      "IndustryResponse": {
        "required": [
          "id",
          "name",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "InternalWorkOrderDetails": {
        "required": [
          "number",
          "started",
          "superseded",
          "previousProposalReference",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "started": {
            "type": "boolean"
          },
          "superseded": {
            "type": "boolean"
          },
          "previousProposalReference": {
            "type": [
              "null",
              "string"
            ]
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IssueProposalRevisionRequest": {
        "required": [
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "isFinal": {
            "type": "boolean",
            "default": false
          },
          "amendWorkOrder": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "LeadAttachmentResponse": {
        "required": [
          "id",
          "fileName",
          "downloadUrl",
          "contentType",
          "size"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "fileName": {
            "type": "string"
          },
          "downloadUrl": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "LeadChangedResponse": {
        "required": [
          "id",
          "stageId",
          "status",
          "probability",
          "ownerId",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "stageId": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "probability": {
            "type": "integer",
            "format": "int16"
          },
          "ownerId": {
            "type": "integer",
            "format": "int64"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LeadClientRef": {
        "required": [
          "id",
          "clientCode",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "clientCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "LeadContactRef": {
        "required": [
          "id",
          "name",
          "designation",
          "email",
          "mobile"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LeadLastVisit": {
        "required": [
          "id",
          "visitDate",
          "visitedById",
          "visitedByName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "visitDate": {
            "type": "string",
            "format": "date"
          },
          "visitedById": {
            "type": "integer",
            "format": "int64"
          },
          "visitedByName": {
            "type": "string"
          }
        }
      },
      "LeadListItem": {
        "required": [
          "id",
          "leadNo",
          "clientId",
          "clientCode",
          "clientName",
          "contactId",
          "contactName",
          "sourceId",
          "sourceName",
          "stageId",
          "stageCode",
          "stageName",
          "ownerId",
          "ownerName",
          "projectBackground",
          "projectPriority",
          "projectType",
          "numberOfDays",
          "probability",
          "expectedClose",
          "status",
          "createdAt",
          "updatedAt",
          "lastActivityAt",
          "nextFollowUpOn",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "leadNo": {
            "type": "string"
          },
          "clientId": {
            "type": "integer",
            "format": "int64"
          },
          "clientCode": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "contactId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "contactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "sourceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "stageId": {
            "type": "integer",
            "format": "int64"
          },
          "stageCode": {
            "type": "string"
          },
          "stageName": {
            "type": "string"
          },
          "ownerId": {
            "type": "integer",
            "format": "int64"
          },
          "ownerName": {
            "type": "string"
          },
          "projectBackground": {
            "type": "string"
          },
          "projectPriority": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectPriority"
              }
            ]
          },
          "projectType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectType"
              }
            ]
          },
          "numberOfDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "probability": {
            "type": "integer",
            "format": "int16"
          },
          "expectedClose": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastActivityAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "nextFollowUpOn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LeadLookupsResponse": {
        "required": [
          "stages",
          "sources",
          "lostReasons"
        ],
        "type": "object",
        "properties": {
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadStageOption"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LookupOption"
            }
          },
          "lostReasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LookupOption"
            }
          }
        }
      },
      "LeadOutcome": {
        "enum": [
          "won",
          "lost"
        ]
      },
      "LeadOwnerOption": {
        "required": [
          "id",
          "name",
          "designation"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LeadOwnersResponse": {
        "required": [
          "owners"
        ],
        "type": "object",
        "properties": {
          "owners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadOwnerOption"
            }
          }
        }
      },
      "LeadProposalsResponse": {
        "required": [
          "items",
          "openValue"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalListItem"
            }
          },
          "openValue": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "LeadServiceRef": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "LeadStageChangeResponse": {
        "required": [
          "id",
          "fromStageId",
          "fromStageName",
          "toStageId",
          "toStageName",
          "changedById",
          "changedByName",
          "changedAt",
          "remarks"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "fromStageId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "fromStageName": {
            "type": [
              "null",
              "string"
            ]
          },
          "toStageId": {
            "type": "integer",
            "format": "int64"
          },
          "toStageName": {
            "type": "string"
          },
          "changedById": {
            "type": "integer",
            "format": "int64"
          },
          "changedByName": {
            "type": "string"
          },
          "changedAt": {
            "type": "string",
            "format": "date-time"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LeadStageColumn": {
        "required": [
          "stageId",
          "code",
          "name",
          "sortOrder",
          "status",
          "count",
          "totalValue",
          "weightedValue"
        ],
        "type": "object",
        "properties": {
          "stageId": {
            "type": "integer",
            "format": "int64"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "totalValue": {
            "type": "number",
            "format": "double"
          },
          "weightedValue": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "LeadStageOption": {
        "required": [
          "id",
          "code",
          "name",
          "defaultProbability",
          "status",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "defaultProbability": {
            "type": "integer",
            "format": "int16"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "LeadStageRef": {
        "required": [
          "id",
          "code",
          "name",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          }
        }
      },
      "LeadStageSummaryResponse": {
        "required": [
          "stages",
          "count",
          "totalValue",
          "weightedValue"
        ],
        "type": "object",
        "properties": {
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadStageColumn"
            }
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "totalValue": {
            "type": "number",
            "format": "double"
          },
          "weightedValue": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "LeadStatus": {
        "enum": [
          "open",
          "won",
          "lost",
          "onHold"
        ]
      },
      "LeadTimelineResponse": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimelineEntry"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ListIndustriesResponse": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IndustryResponse"
            }
          }
        }
      },
      "LogActivityRequest": {
        "required": [
          "type",
          "notes",
          "occurredOn"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ActivityType"
          },
          "notes": {
            "type": "string"
          },
          "occurredOn": {
            "type": "string",
            "format": "date-time"
          },
          "subject": {
            "type": [
              "null",
              "string"
            ]
          },
          "outcome": {
            "type": [
              "null",
              "string"
            ]
          },
          "attendees": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMin": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int16"
          },
          "nextActionOn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          }
        }
      },
      "LogActivityResponse": {
        "required": [
          "id",
          "followUpId",
          "lastActivityAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "followUpId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "lastActivityAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LoginRequest": {
        "required": [
          "email",
          "password",
          "device"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "device": {
            "type": [
              "null",
              "string"
            ]
          },
          "remember": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "LoginResponse": {
        "required": [
          "accessToken",
          "expiresIn"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "expiresIn": {
            "type": "integer",
            "format": "int32"
          },
          "tokenType": {
            "type": "string",
            "default": "Bearer"
          }
        }
      },
      "LogoutAllResponse": {
        "required": [
          "revoked"
        ],
        "type": "object",
        "properties": {
          "revoked": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "LogoutRequest": {
        "required": [
          "refreshToken"
        ],
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LookupOption": {
        "required": [
          "id",
          "name",
          "isActive"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "MailAccountListResponse": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailAccountResponse"
            }
          }
        }
      },
      "MailAccountResponse": {
        "required": [
          "id",
          "name",
          "fromAddress",
          "fromName",
          "host",
          "port",
          "security",
          "userName",
          "hasPassword",
          "isActive",
          "isDefault",
          "lastTestedAt",
          "lastTestError",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "fromAddress": {
            "type": "string"
          },
          "fromName": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer",
            "format": "int32"
          },
          "security": {
            "$ref": "#/components/schemas/MailSecurity"
          },
          "userName": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasPassword": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean"
          },
          "lastTestedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastTestError": {
            "type": [
              "null",
              "string"
            ]
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MailAccountTestResponse": {
        "required": [
          "sent",
          "error",
          "testedAt",
          "account"
        ],
        "type": "object",
        "properties": {
          "sent": {
            "type": "boolean"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "testedAt": {
            "type": "string",
            "format": "date-time"
          },
          "account": {
            "$ref": "#/components/schemas/MailAccountResponse"
          }
        }
      },
      "MailSecurity": {
        "enum": [
          "startTls",
          "sslOnConnect",
          "none"
        ]
      },
      "MailSenderOption": {
        "required": [
          "id",
          "name",
          "fromAddress",
          "fromName",
          "isDefault"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "fromAddress": {
            "type": "string"
          },
          "fromName": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          }
        }
      },
      "MarginDashboardResponse": {
        "required": [
          "from",
          "to",
          "overall",
          "byPreparer",
          "byMonth"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "overall": {
            "$ref": "#/components/schemas/MarginFigures"
          },
          "byPreparer": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreparerMarginRow"
            }
          },
          "byMonth": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonthMarginRow"
            }
          }
        }
      },
      "MarginFigures": {
        "required": [
          "proposals",
          "taxableValue",
          "costTotal",
          "marginAmount",
          "marginPercent"
        ],
        "type": "object",
        "properties": {
          "proposals": {
            "type": "integer",
            "format": "int32"
          },
          "taxableValue": {
            "type": "number",
            "format": "double"
          },
          "costTotal": {
            "type": "number",
            "format": "double"
          },
          "marginAmount": {
            "type": "number",
            "format": "double"
          },
          "marginPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "MarkAllNotificationsReadRequest": {
        "type": "object",
        "properties": {
          "upToId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "MarkAllNotificationsReadResponse": {
        "required": [
          "marked",
          "unread"
        ],
        "type": "object",
        "properties": {
          "marked": {
            "type": "integer",
            "format": "int32"
          },
          "unread": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "MarkNotificationReadRequest": {
        "required": [
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MasterDataImportError": {
        "required": [
          "worksheet",
          "row",
          "column",
          "message"
        ],
        "type": "object",
        "properties": {
          "worksheet": {
            "type": "string"
          },
          "row": {
            "type": "integer",
            "format": "int32"
          },
          "column": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "MasterDataImportResponse": {
        "required": [
          "imported",
          "importedRows",
          "errors"
        ],
        "type": "object",
        "properties": {
          "imported": {
            "type": "boolean"
          },
          "importedRows": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MasterDataImportError"
            }
          }
        }
      },
      "MonthMarginRow": {
        "required": [
          "month",
          "figures"
        ],
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "format": "date"
          },
          "figures": {
            "$ref": "#/components/schemas/MarginFigures"
          }
        }
      },
      "MoveLeadStageRequest": {
        "required": [
          "rowVersion",
          "stageId"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "stageId": {
            "type": "integer",
            "format": "int64"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "NotificationListItem": {
        "required": [
          "id",
          "type",
          "title",
          "body",
          "entityType",
          "entityId",
          "link",
          "createdAt",
          "readAt",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "entityType": {
            "type": [
              "null",
              "string"
            ]
          },
          "entityId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "link": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "readAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NotificationReadResponse": {
        "required": [
          "id",
          "readAt",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "readAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ObjectiveResponse": {
        "required": [
          "id",
          "serviceId",
          "description",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "description": {
            "type": "string"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "$ref": "#/components/schemas/ObjectiveType"
          }
        }
      },
      "ObjectiveType": {
        "enum": [
          "objective",
          "scopeOfWork"
        ],
        "default": "objective"
      },
      "PagedResponseOfClientListItem": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientListItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfFollowUpListItem": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FollowUpListItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfLeadListItem": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadListItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfNotificationListItem": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationListItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfObjectiveResponse": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ObjectiveResponse"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfPendingApprovalItem": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PendingApprovalItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfPendingProposalExpenseItem": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PendingProposalExpenseItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfProposalListItem": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalListItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfServiceStandardResponse": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceStandardResponse"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfServiceTreeNode": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceTreeNode"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfSiteVisitResponse": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteVisitResponse"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PagedResponseOfUserListItem": {
        "required": [
          "items",
          "page",
          "size",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserListItem"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PendingApprovalItem": {
        "required": [
          "approvalId",
          "proposalId",
          "proposalNo",
          "revisionId",
          "reference",
          "title",
          "clientName",
          "totalValue",
          "discountPercent",
          "level",
          "reasons",
          "submittedById",
          "submittedByName",
          "submittedAt",
          "submitRemarks"
        ],
        "type": "object",
        "properties": {
          "approvalId": {
            "type": "integer",
            "format": "int64"
          },
          "proposalId": {
            "type": "integer",
            "format": "int64"
          },
          "proposalNo": {
            "type": "string"
          },
          "revisionId": {
            "type": "integer",
            "format": "int64"
          },
          "reference": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "totalValue": {
            "type": "number",
            "format": "double"
          },
          "discountPercent": {
            "type": "number",
            "format": "double"
          },
          "level": {
            "$ref": "#/components/schemas/ProposalApprovalLevel"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "submittedById": {
            "type": "integer",
            "format": "int64"
          },
          "submittedByName": {
            "type": "string"
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time"
          },
          "submitRemarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PendingProposalExpenseItem": {
        "required": [
          "id",
          "proposalNo",
          "title",
          "clientName",
          "createdByName",
          "createdAt",
          "revisionId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "proposalNo": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "createdByName": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "revisionId": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PreparerMarginRow": {
        "required": [
          "userId",
          "name",
          "figures"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "figures": {
            "$ref": "#/components/schemas/MarginFigures"
          }
        }
      },
      "ProjectPriority": {
        "enum": [
          "high",
          "medium",
          "low",
          null
        ]
      },
      "ProjectType": {
        "enum": [
          "newProject",
          "upgrade",
          "replacement",
          "expansion",
          "maintenance",
          "compliance",
          "costReduction",
          null
        ]
      },
      "ProposalApproachStageItem": {
        "required": [
          "stage",
          "activity",
          "outcome"
        ],
        "type": "object",
        "properties": {
          "stage": {
            "type": "string"
          },
          "activity": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          }
        }
      },
      "ProposalApproachStageResponse": {
        "required": [
          "id",
          "stage",
          "activity",
          "outcome",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "stage": {
            "type": "string"
          },
          "activity": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProposalApprovalItem": {
        "required": [
          "id",
          "level",
          "status",
          "reasons",
          "discountPercent",
          "discountLimitPercent",
          "submittedById",
          "submittedByName",
          "submittedAt",
          "submitRemarks",
          "actedById",
          "actedByName",
          "actedAt",
          "remarks"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "level": {
            "$ref": "#/components/schemas/ProposalApprovalLevel"
          },
          "status": {
            "$ref": "#/components/schemas/ProposalApprovalStatus"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "discountPercent": {
            "type": "number",
            "format": "double"
          },
          "discountLimitPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "submittedById": {
            "type": "integer",
            "format": "int64"
          },
          "submittedByName": {
            "type": "string"
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time"
          },
          "submitRemarks": {
            "type": [
              "null",
              "string"
            ]
          },
          "actedById": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "actedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "actedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalApprovalLevel": {
        "enum": [
          "operations",
          "director",
          null
        ]
      },
      "ProposalApprovalStateResponse": {
        "required": [
          "proposalId",
          "revisionId",
          "reference",
          "revisionStatus",
          "rowVersion",
          "nextLevel",
          "nextReasons",
          "expensesReviewed",
          "pending",
          "history",
          "canSubmit",
          "canDecide",
          "canIssue",
          "issuedOn",
          "validUntil"
        ],
        "type": "object",
        "properties": {
          "proposalId": {
            "type": "integer",
            "format": "int64"
          },
          "revisionId": {
            "type": "integer",
            "format": "int64"
          },
          "reference": {
            "type": "string"
          },
          "revisionStatus": {
            "$ref": "#/components/schemas/ProposalRevisionStatus"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "nextLevel": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalApprovalLevel"
              }
            ]
          },
          "nextReasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expensesReviewed": {
            "type": "boolean"
          },
          "pending": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalApprovalItem"
              }
            ]
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalApprovalItem"
            }
          },
          "canSubmit": {
            "type": "boolean"
          },
          "canDecide": {
            "type": "boolean"
          },
          "canIssue": {
            "type": "boolean"
          },
          "issuedOn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          }
        }
      },
      "ProposalApprovalStatus": {
        "enum": [
          "pending",
          "approved",
          "rejected"
        ]
      },
      "ProposalClientRef": {
        "required": [
          "id",
          "clientCode",
          "name",
          "stateCode"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "clientCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalContactRef": {
        "required": [
          "id",
          "name",
          "designation",
          "email",
          "mobile"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalContentResponse": {
        "required": [
          "serviceId",
          "serviceCode",
          "name",
          "level",
          "parentServiceId",
          "rowVersion",
          "scopeText",
          "qtyFieldKey",
          "contentUpdatedAt",
          "fields",
          "lineFields",
          "items"
        ],
        "type": "object",
        "properties": {
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "level": {
            "type": "integer",
            "format": "int16"
          },
          "parentServiceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "scopeText": {
            "type": [
              "null",
              "string"
            ]
          },
          "qtyFieldKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "contentUpdatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalFieldResponse"
            }
          },
          "lineFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalFieldResponse"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceContentItemResponse"
            }
          }
        }
      },
      "ProposalCostingResponse": {
        "required": [
          "revisionId",
          "proposalId",
          "reference",
          "revisionDate",
          "isEditable",
          "subTotal",
          "discountPercent",
          "taxableValue",
          "lines",
          "costTotal",
          "marginAmount",
          "marginPercent",
          "breakEvenDiscountPercent",
          "marginFloorPercent",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "revisionId": {
            "type": "integer",
            "format": "int64"
          },
          "proposalId": {
            "type": "integer",
            "format": "int64"
          },
          "reference": {
            "type": "string"
          },
          "revisionDate": {
            "type": "string",
            "format": "date"
          },
          "isEditable": {
            "type": "boolean"
          },
          "subTotal": {
            "type": "number",
            "format": "double"
          },
          "discountPercent": {
            "type": "number",
            "format": "double"
          },
          "taxableValue": {
            "type": "number",
            "format": "double"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalCostLineResponse"
            }
          },
          "costTotal": {
            "type": "number",
            "format": "double"
          },
          "marginAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "marginPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "breakEvenDiscountPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "marginFloorPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProposalCostInput": {
        "required": [
          "costType",
          "description"
        ],
        "type": "object",
        "properties": {
          "costType": {
            "$ref": "#/components/schemas/ProposalCostType"
          },
          "description": {
            "type": "string"
          },
          "qty": {
            "type": "number",
            "format": "double",
            "default": 1
          },
          "rate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "grade": {
            "type": [
              "null",
              "string"
            ]
          },
          "hours": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          },
          "rateOverrideReason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalCostLineResponse": {
        "required": [
          "id",
          "costType",
          "description",
          "grade",
          "rateCardItemId",
          "qty",
          "hours",
          "uom",
          "rate",
          "cardRate",
          "isRateOverridden",
          "rateOverrideReason",
          "amount",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "costType": {
            "$ref": "#/components/schemas/ProposalCostType"
          },
          "description": {
            "type": "string"
          },
          "grade": {
            "type": [
              "null",
              "string"
            ]
          },
          "rateCardItemId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "qty": {
            "type": "number",
            "format": "double"
          },
          "hours": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "cardRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "isRateOverridden": {
            "type": "boolean"
          },
          "rateOverrideReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProposalCostType": {
        "enum": [
          "manpower",
          "travel",
          "material",
          "subcontract",
          "contingency"
        ]
      },
      "ProposalDiffChange": {
        "enum": [
          "added",
          "removed",
          "changed"
        ]
      },
      "ProposalEmailDraftResponse": {
        "required": [
          "reference",
          "fileName",
          "to",
          "cc",
          "subject",
          "message",
          "canSend",
          "contactName",
          "fromAccounts",
          "defaultFromAccountId"
        ],
        "type": "object",
        "properties": {
          "reference": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "to": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subject": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "canSend": {
            "type": "boolean"
          },
          "contactName": {
            "type": [
              "null",
              "string"
            ]
          },
          "fromAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailSenderOption"
            }
          },
          "defaultFromAccountId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "ProposalEmailSentResponse": {
        "required": [
          "activityId",
          "sentAt",
          "to",
          "cc",
          "subject",
          "fileName",
          "fromAddress"
        ],
        "type": "object",
        "properties": {
          "activityId": {
            "type": "integer",
            "format": "int64"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subject": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "fromAddress": {
            "type": "string"
          }
        }
      },
      "ProposalExpenseDiff": {
        "required": [
          "expenseHeadId",
          "description",
          "change",
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "expenseHeadId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "description": {
            "type": "string"
          },
          "change": {
            "$ref": "#/components/schemas/ProposalDiffChange"
          },
          "from": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalPriceLine"
              }
            ]
          },
          "to": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalPriceLine"
              }
            ]
          }
        }
      },
      "ProposalExpenseInput": {
        "required": [
          "id",
          "description",
          "uom",
          "rateType",
          "rate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "description": {
            "type": "string"
          },
          "uom": {
            "type": "string"
          },
          "rateType": {
            "$ref": "#/components/schemas/ExpenseRateType"
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "expenseHeadId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "qtyBasis": {
            "$ref": "#/components/schemas/ExpenseQtyBasis"
          },
          "qty": {
            "type": "number",
            "format": "double",
            "default": 1
          },
          "isQtyManual": {
            "type": "boolean",
            "default": false
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "isIncluded": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ProposalExpenseItemResponse": {
        "required": [
          "id",
          "expenseHeadId",
          "isForced",
          "description",
          "uom",
          "rateType",
          "qtyBasis",
          "qty",
          "isQtyManual",
          "rate",
          "amount",
          "hsnSac",
          "isIncluded",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "expenseHeadId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "isForced": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "uom": {
            "type": "string"
          },
          "rateType": {
            "$ref": "#/components/schemas/ExpenseRateType"
          },
          "qtyBasis": {
            "$ref": "#/components/schemas/ExpenseQtyBasis"
          },
          "qty": {
            "type": "number",
            "format": "double"
          },
          "isQtyManual": {
            "type": "boolean"
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "isIncluded": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProposalFieldDiff": {
        "required": [
          "key",
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "from": {
            "type": [
              "null",
              "string"
            ]
          },
          "to": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalFieldInput": {
        "required": [
          "id",
          "key",
          "label",
          "type",
          "options",
          "defaultValue",
          "isRequired"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ProposalFieldType"
          },
          "options": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultValue": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRequired": {
            "type": "boolean"
          }
        }
      },
      "ProposalFieldResponse": {
        "required": [
          "id",
          "key",
          "label",
          "type",
          "options",
          "defaultValue",
          "isRequired",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ProposalFieldType"
          },
          "options": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultValue": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRequired": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProposalFieldType": {
        "enum": [
          "text",
          "number",
          "list",
          "date"
        ]
      },
      "ProposalItemInput": {
        "required": [
          "id",
          "kind",
          "text"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "kind": {
            "$ref": "#/components/schemas/ProposalItemKind"
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "fromServiceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "isIncluded": {
            "type": "boolean",
            "default": true
          },
          "resetToSource": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ProposalItemKind": {
        "enum": [
          "objective",
          "methodology",
          "tool",
          "standard",
          "deliverable",
          "clientInput",
          "milestone",
          "exclusion",
          "scopeOfWork"
        ]
      },
      "ProposalLeadRef": {
        "required": [
          "id",
          "leadNo",
          "stageId",
          "stageName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "leadNo": {
            "type": "string"
          },
          "stageId": {
            "type": "integer",
            "format": "int64"
          },
          "stageName": {
            "type": "string"
          }
        }
      },
      "ProposalLineInput": {
        "required": [
          "serviceId"
        ],
        "type": "object",
        "properties": {
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "fieldValues": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "subServices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProposalSubServiceInput"
            }
          },
          "scopeRows": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProposalScopeRowInput"
            }
          }
        }
      },
      "ProposalListItem": {
        "required": [
          "id",
          "proposalNo",
          "title",
          "status",
          "leadId",
          "leadNo",
          "clientId",
          "clientCode",
          "clientName",
          "ownerId",
          "ownerName",
          "currentRevisionId",
          "revisionNo",
          "revisionStatus",
          "totalValue",
          "revisionDate",
          "validUntil",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "proposalNo": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ProposalStatus"
          },
          "leadId": {
            "type": "integer",
            "format": "int64"
          },
          "leadNo": {
            "type": "string"
          },
          "clientId": {
            "type": "integer",
            "format": "int64"
          },
          "clientCode": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "ownerId": {
            "type": "integer",
            "format": "int64"
          },
          "ownerName": {
            "type": "string"
          },
          "currentRevisionId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "revisionNo": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int16"
          },
          "revisionStatus": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalRevisionStatus"
              }
            ]
          },
          "totalValue": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "revisionDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "reference": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalMilestoneDiff": {
        "required": [
          "name",
          "change",
          "fromPercent",
          "toPercent",
          "fromOffsetDays",
          "toOffsetDays"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "change": {
            "$ref": "#/components/schemas/ProposalDiffChange"
          },
          "fromPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "toPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "fromOffsetDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int16"
          },
          "toOffsetDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int16"
          }
        }
      },
      "ProposalMilestoneInput": {
        "required": [
          "name",
          "percent"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "percent": {
            "type": "number",
            "format": "double"
          },
          "offsetDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int16"
          }
        }
      },
      "ProposalMilestoneResponse": {
        "required": [
          "id",
          "name",
          "percent",
          "offsetDays",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "percent": {
            "type": "number",
            "format": "double"
          },
          "offsetDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int16"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProposalOutcome": {
        "enum": [
          "won",
          "lost",
          "onHold"
        ]
      },
      "ProposalOutcomeInfo": {
        "required": [
          "at",
          "byId",
          "byName",
          "lostReasonId",
          "lostReasonName",
          "remarks"
        ],
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "byId": {
            "type": "integer",
            "format": "int64"
          },
          "byName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lostReasonId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "lostReasonName": {
            "type": [
              "null",
              "string"
            ]
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalPaymentTermItem": {
        "required": [
          "name",
          "percent"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "percent": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ProposalPriceLine": {
        "required": [
          "isIncluded",
          "qty",
          "uom",
          "rate",
          "amount"
        ],
        "type": "object",
        "properties": {
          "isIncluded": {
            "type": "boolean"
          },
          "qty": {
            "type": "number",
            "format": "double"
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ProposalResponse": {
        "required": [
          "id",
          "proposalNo",
          "title",
          "status",
          "lead",
          "client",
          "contact",
          "ownerId",
          "ownerName",
          "enquiryRef",
          "enquiryDate",
          "projectName",
          "projectLocation",
          "endClientName",
          "currentRevisionId",
          "revisions",
          "outcome",
          "createdAt",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "proposalNo": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ProposalStatus"
          },
          "lead": {
            "$ref": "#/components/schemas/ProposalLeadRef"
          },
          "client": {
            "$ref": "#/components/schemas/ProposalClientRef"
          },
          "contact": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalContactRef"
              }
            ]
          },
          "ownerId": {
            "type": "integer",
            "format": "int64"
          },
          "ownerName": {
            "type": "string"
          },
          "enquiryRef": {
            "type": [
              "null",
              "string"
            ]
          },
          "enquiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "projectName": {
            "type": [
              "null",
              "string"
            ]
          },
          "projectLocation": {
            "type": [
              "null",
              "string"
            ]
          },
          "endClientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "currentRevisionId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalRevisionSummary"
            }
          },
          "outcome": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalOutcomeInfo"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProposalRevisionDiffResponse": {
        "required": [
          "from",
          "to",
          "services",
          "subServices",
          "expenses",
          "milestones",
          "fromSitePlan",
          "toSitePlan",
          "fromTotals",
          "toTotals",
          "valueDelta"
        ],
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/ProposalRevisionRef"
          },
          "to": {
            "$ref": "#/components/schemas/ProposalRevisionRef"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalServiceDiff"
            }
          },
          "subServices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalScopeDiff"
            }
          },
          "expenses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalExpenseDiff"
            }
          },
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalMilestoneDiff"
            }
          },
          "fromSitePlan": {
            "$ref": "#/components/schemas/ProposalSitePlan"
          },
          "toSitePlan": {
            "$ref": "#/components/schemas/ProposalSitePlan"
          },
          "fromTotals": {
            "$ref": "#/components/schemas/ProposalTotalsResponse"
          },
          "toTotals": {
            "$ref": "#/components/schemas/ProposalTotalsResponse"
          },
          "valueDelta": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ProposalRevisionItemResponse": {
        "required": [
          "id",
          "kind",
          "fromServiceId",
          "sourceItemId",
          "sourceStandardId",
          "code",
          "text",
          "detail",
          "format",
          "category",
          "duration",
          "isIncluded",
          "isEdited",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "kind": {
            "$ref": "#/components/schemas/ProposalItemKind"
          },
          "fromServiceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "sourceItemId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "sourceStandardId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "text": {
            "type": "string"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "isIncluded": {
            "type": "boolean"
          },
          "isEdited": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProposalRevisionRef": {
        "required": [
          "id",
          "revisionNo",
          "reference",
          "status",
          "revisionDate",
          "reason"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "revisionNo": {
            "type": "integer",
            "format": "int16"
          },
          "reference": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ProposalRevisionStatus"
          },
          "revisionDate": {
            "type": "string",
            "format": "date"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalRevisionResponse": {
        "required": [
          "id",
          "proposalId",
          "proposalNo",
          "reference",
          "revisionNo",
          "status",
          "isCurrent",
          "isEditable",
          "reason",
          "coverStatus",
          "preparedById",
          "preparedByName",
          "revisionDate",
          "validityDays",
          "validUntil",
          "settingsRevision",
          "sitePlan",
          "totals",
          "services",
          "items",
          "sections",
          "approachStages",
          "serviceLines",
          "expenses",
          "milestones",
          "rowVersion",
          "expenseReview"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "proposalId": {
            "type": "integer",
            "format": "int64"
          },
          "proposalNo": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "revisionNo": {
            "type": "integer",
            "format": "int16"
          },
          "status": {
            "$ref": "#/components/schemas/ProposalRevisionStatus"
          },
          "isCurrent": {
            "type": "boolean"
          },
          "isEditable": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "coverStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "preparedById": {
            "type": "integer",
            "format": "int64"
          },
          "preparedByName": {
            "type": "string"
          },
          "revisionDate": {
            "type": "string",
            "format": "date"
          },
          "validityDays": {
            "type": "integer",
            "format": "int16"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "settingsRevision": {
            "type": "integer",
            "format": "int32"
          },
          "sitePlan": {
            "$ref": "#/components/schemas/ProposalSitePlan"
          },
          "totals": {
            "$ref": "#/components/schemas/ProposalTotalsResponse"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalRevisionServiceResponse"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalRevisionItemResponse"
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalSectionResponse"
            }
          },
          "approachStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalApproachStageResponse"
            }
          },
          "serviceLines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalServiceLineResponse"
            }
          },
          "expenses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalExpenseItemResponse"
            }
          },
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalMilestoneResponse"
            }
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "expenseReview": {
            "$ref": "#/components/schemas/ExpenseReviewResponse"
          },
          "internalWorkOrder": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InternalWorkOrderDetails"
              }
            ]
          }
        }
      },
      "ProposalRevisionServiceResponse": {
        "required": [
          "id",
          "serviceId",
          "serviceCode",
          "name",
          "fieldValues",
          "sortOrder",
          "scopeItems"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "fieldValues": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "scopeItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalScopeItemResponse"
            }
          }
        }
      },
      "ProposalRevisionStatus": {
        "enum": [
          "draft",
          "pendingApproval",
          "approved",
          "rejected",
          "issued",
          "superseded"
        ]
      },
      "ProposalRevisionSummary": {
        "required": [
          "id",
          "revisionNo",
          "reference",
          "status",
          "isCurrent",
          "reason",
          "preparedById",
          "preparedByName",
          "revisionDate",
          "validUntil",
          "totalValue",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "revisionNo": {
            "type": "integer",
            "format": "int16"
          },
          "reference": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ProposalRevisionStatus"
          },
          "isCurrent": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "preparedById": {
            "type": "integer",
            "format": "int64"
          },
          "preparedByName": {
            "type": "string"
          },
          "revisionDate": {
            "type": "string",
            "format": "date"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "totalValue": {
            "type": "number",
            "format": "double"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProposalScopeDiff": {
        "required": [
          "serviceId",
          "lineServiceId",
          "serviceCode",
          "name",
          "change",
          "from",
          "to",
          "scopeTextChanged"
        ],
        "type": "object",
        "properties": {
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "lineServiceId": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "change": {
            "$ref": "#/components/schemas/ProposalDiffChange"
          },
          "from": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalPriceLine"
              }
            ]
          },
          "to": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalPriceLine"
              }
            ]
          },
          "scopeTextChanged": {
            "type": "boolean"
          }
        }
      },
      "ProposalScopeItemResponse": {
        "required": [
          "id",
          "serviceId",
          "serviceCode",
          "name",
          "scopeText",
          "qtyFieldKey",
          "uom",
          "qty",
          "rate",
          "amount",
          "hsnSac",
          "isIncluded",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scopeText": {
            "type": [
              "null",
              "string"
            ]
          },
          "qtyFieldKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          },
          "qty": {
            "type": "number",
            "format": "double"
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "isIncluded": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProposalScopeRowInput": {
        "required": [
          "id",
          "serviceId",
          "text",
          "isIncluded"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "text": {
            "type": "string"
          },
          "isIncluded": {
            "type": "boolean"
          },
          "isNew": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ProposalSectionInput": {
        "required": [
          "key",
          "text",
          "isIncluded"
        ],
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/ProposalSectionKey"
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "isIncluded": {
            "type": "boolean"
          }
        }
      },
      "ProposalSectionKey": {
        "enum": [
          "coverLetter",
          "background",
          "about",
          "credentials",
          "hse",
          "generalExclusions",
          "assumptions",
          "commercialNote",
          "closing",
          "confidentiality",
          "siteDeployment",
          "tagline",
          "serviceLinesIntro"
        ]
      },
      "ProposalSectionResponse": {
        "required": [
          "id",
          "key",
          "text",
          "isIncluded"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "key": {
            "$ref": "#/components/schemas/ProposalSectionKey"
          },
          "text": {
            "type": "string"
          },
          "isIncluded": {
            "type": "boolean"
          }
        }
      },
      "ProposalServiceDiff": {
        "required": [
          "serviceId",
          "serviceCode",
          "name",
          "change",
          "fields"
        ],
        "type": "object",
        "properties": {
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "change": {
            "$ref": "#/components/schemas/ProposalDiffChange"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalFieldDiff"
            }
          }
        }
      },
      "ProposalServiceLineItem": {
        "required": [
          "name",
          "deliverables",
          "tools",
          "experience"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "deliverables": {
            "type": "string"
          },
          "tools": {
            "type": "string"
          },
          "experience": {
            "type": "string"
          },
          "isIncluded": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ProposalServiceLineResponse": {
        "required": [
          "id",
          "name",
          "deliverables",
          "tools",
          "experience",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "deliverables": {
            "type": "string"
          },
          "tools": {
            "type": "string"
          },
          "experience": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "isIncluded": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ProposalSettingsResponse": {
        "required": [
          "companyName",
          "aboutText",
          "credentialsText",
          "hseText",
          "generalExclusions",
          "assumptions",
          "commercialNote",
          "closingText",
          "confidentialityText",
          "defaultValidityDays",
          "defaultHsnSac",
          "signatory",
          "approachStages",
          "paymentTerms",
          "revision",
          "rowVersion",
          "tagline",
          "serviceLinesIntro",
          "serviceLines"
        ],
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string"
          },
          "aboutText": {
            "type": "string"
          },
          "credentialsText": {
            "type": [
              "null",
              "string"
            ]
          },
          "hseText": {
            "type": "string"
          },
          "generalExclusions": {
            "type": "string"
          },
          "assumptions": {
            "type": "string"
          },
          "commercialNote": {
            "type": "string"
          },
          "closingText": {
            "type": "string"
          },
          "confidentialityText": {
            "type": "string"
          },
          "defaultValidityDays": {
            "type": "integer",
            "format": "int16"
          },
          "defaultHsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "signatory": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProposalSignatoryResponse"
              }
            ]
          },
          "approachStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalApproachStageItem"
            }
          },
          "paymentTerms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalPaymentTermItem"
            }
          },
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "tagline": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceLinesIntro": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceLines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalServiceLineItem"
            }
          }
        }
      },
      "ProposalSignatoryResponse": {
        "required": [
          "id",
          "fullName",
          "designation",
          "email",
          "mobile"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "fullName": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalSitePlan": {
        "required": [
          "seniorEngineers",
          "juniorEngineers",
          "siteDays",
          "reportMandays",
          "expensePrintMode"
        ],
        "type": "object",
        "properties": {
          "seniorEngineers": {
            "type": "integer",
            "format": "int16"
          },
          "juniorEngineers": {
            "type": "integer",
            "format": "int16"
          },
          "siteDays": {
            "type": "number",
            "format": "double"
          },
          "reportMandays": {
            "type": "number",
            "format": "double"
          },
          "expensePrintMode": {
            "$ref": "#/components/schemas/ExpensePrintMode"
          }
        }
      },
      "ProposalSitePlanInput": {
        "required": [
          "seniorEngineers",
          "juniorEngineers",
          "siteDays",
          "reportMandays"
        ],
        "type": "object",
        "properties": {
          "seniorEngineers": {
            "type": "integer",
            "format": "int16"
          },
          "juniorEngineers": {
            "type": "integer",
            "format": "int16"
          },
          "siteDays": {
            "type": "number",
            "format": "double"
          },
          "reportMandays": {
            "type": "number",
            "format": "double"
          },
          "expensePrintMode": {
            "$ref": "#/components/schemas/ExpensePrintMode"
          }
        }
      },
      "ProposalStageInput": {
        "required": [
          "stage",
          "activity",
          "outcome"
        ],
        "type": "object",
        "properties": {
          "stage": {
            "type": "string"
          },
          "activity": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          }
        }
      },
      "ProposalStatus": {
        "enum": [
          "draft",
          "pendingApproval",
          "approved",
          "rejected",
          "issued",
          "won",
          "lost",
          "onHold"
        ]
      },
      "ProposalSubServiceInput": {
        "required": [
          "serviceId",
          "isIncluded",
          "qty",
          "rate"
        ],
        "type": "object",
        "properties": {
          "serviceId": {
            "type": "integer",
            "format": "int64"
          },
          "isIncluded": {
            "type": "boolean"
          },
          "qty": {
            "type": "number",
            "format": "double"
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "scopeText": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProposalTotalsResponse": {
        "required": [
          "servicesTotal",
          "expenseTotal",
          "subTotal",
          "discountPercent",
          "discountAmount",
          "taxableValue",
          "taxMode",
          "gstRatePercent",
          "cgst",
          "sgst",
          "igst",
          "totalValue"
        ],
        "type": "object",
        "properties": {
          "servicesTotal": {
            "type": "number",
            "format": "double"
          },
          "expenseTotal": {
            "type": "number",
            "format": "double"
          },
          "subTotal": {
            "type": "number",
            "format": "double"
          },
          "discountPercent": {
            "type": "number",
            "format": "double"
          },
          "discountAmount": {
            "type": "number",
            "format": "double"
          },
          "taxableValue": {
            "type": "number",
            "format": "double"
          },
          "taxMode": {
            "$ref": "#/components/schemas/GstTaxMode"
          },
          "gstRatePercent": {
            "type": "number",
            "format": "double"
          },
          "cgst": {
            "type": "number",
            "format": "double"
          },
          "sgst": {
            "type": "number",
            "format": "double"
          },
          "igst": {
            "type": "number",
            "format": "double"
          },
          "totalValue": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "RateCardItemResponse": {
        "required": [
          "id",
          "grade",
          "hourlyRate",
          "effectiveFrom",
          "effectiveTo",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "grade": {
            "type": "string"
          },
          "hourlyRate": {
            "type": "number",
            "format": "double"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          },
          "effectiveTo": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RateCardResponse": {
        "required": [
          "asOf",
          "items"
        ],
        "type": "object",
        "properties": {
          "asOf": {
            "type": "string",
            "format": "date"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RateCardItemResponse"
            }
          }
        }
      },
      "RateHistoryResponse": {
        "required": [
          "grade",
          "items"
        ],
        "type": "object",
        "properties": {
          "grade": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RateCardItemResponse"
            }
          }
        }
      },
      "ReassignLeadRequest": {
        "required": [
          "rowVersion",
          "ownerId"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "ownerId": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RecordProposalOutcomeRequest": {
        "required": [
          "outcome",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "outcome": {
            "$ref": "#/components/schemas/ProposalOutcome"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "lostReasonId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RecordSiteVisitRequest": {
        "required": [
          "visitDate",
          "findings"
        ],
        "type": "object",
        "properties": {
          "visitDate": {
            "type": "string",
            "format": "date"
          },
          "findings": {
            "type": "string"
          },
          "visitedById": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "RefreshRequest": {
        "required": [
          "refreshToken",
          "device"
        ],
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": [
              "null",
              "string"
            ]
          },
          "device": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RefreshResponse": {
        "required": [
          "accessToken",
          "expiresIn"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "expiresIn": {
            "type": "integer",
            "format": "int32"
          },
          "tokenType": {
            "type": "string",
            "default": "Bearer"
          }
        }
      },
      "RescheduleFollowUpRequest": {
        "required": [
          "rowVersion",
          "dueOn"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "dueOn": {
            "type": "string",
            "format": "date"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ResetUserPasswordRequest": {
        "required": [
          "newPassword"
        ],
        "type": "object",
        "properties": {
          "newPassword": {
            "type": "string"
          }
        }
      },
      "ResetUserPasswordResponse": {
        "required": [
          "id",
          "signedOutSessions"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "signedOutSessions": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ReviewProposalExpensesRequest": {
        "required": [
          "rowVersion",
          "action"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "action": {
            "$ref": "#/components/schemas/ExpenseReviewAction"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          },
          "noExpensesRequired": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "RoleOption": {
        "required": [
          "code",
          "name",
          "permissionCodes"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "permissionCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SaveProposalContentRequest": {
        "required": [
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "scopeText": {
            "type": [
              "null",
              "string"
            ]
          },
          "qtyFieldKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "fields": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProposalFieldInput"
            }
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ServiceContentItemInput"
            }
          }
        }
      },
      "SaveProposalCostingRequest": {
        "required": [
          "rowVersion",
          "lines"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalCostInput"
            }
          }
        }
      },
      "SaveProposalExpensesRequest": {
        "required": [
          "rowVersion",
          "sitePlan",
          "lines"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "sitePlan": {
            "$ref": "#/components/schemas/ProposalSitePlanInput"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalExpenseInput"
            }
          }
        }
      },
      "SaveProposalItemsRequest": {
        "required": [
          "rowVersion",
          "items"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalItemInput"
            }
          }
        }
      },
      "SaveProposalMilestonesRequest": {
        "required": [
          "rowVersion",
          "milestones"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalMilestoneInput"
            }
          }
        }
      },
      "SaveProposalSectionsRequest": {
        "required": [
          "rowVersion",
          "sections",
          "approachStages"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalSectionInput"
            }
          },
          "approachStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalStageInput"
            }
          },
          "serviceLines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProposalServiceLineItem"
            }
          }
        }
      },
      "SaveProposalServicesRequest": {
        "required": [
          "rowVersion",
          "lines"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalLineInput"
            }
          }
        }
      },
      "SendProposalEmailRequest": {
        "required": [
          "to",
          "subject",
          "message",
          "fromAccountId"
        ],
        "type": "object",
        "properties": {
          "to": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subject": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "fromAccountId": {
            "type": "integer",
            "format": "int64"
          },
          "cc": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ServiceContentItemInput": {
        "required": [
          "id",
          "kind",
          "text",
          "detail",
          "format",
          "category",
          "duration",
          "isDefault"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "kind": {
            "$ref": "#/components/schemas/ServiceContentKind"
          },
          "text": {
            "type": "string"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          }
        }
      },
      "ServiceContentItemResponse": {
        "required": [
          "id",
          "kind",
          "text",
          "detail",
          "format",
          "category",
          "duration",
          "isDefault",
          "sortOrder"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "kind": {
            "$ref": "#/components/schemas/ServiceContentKind"
          },
          "text": {
            "type": "string"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "string"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ServiceContentKind": {
        "enum": [
          "objective",
          "methodology",
          "tool",
          "deliverable",
          "clientInput",
          "milestone",
          "exclusion"
        ]
      },
      "ServiceResponse": {
        "required": [
          "id",
          "serviceCode",
          "name",
          "serviceTypeId",
          "parentServiceId",
          "parentName",
          "level",
          "isActive",
          "sortOrder",
          "uom",
          "defaultRate",
          "hsnSac",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "serviceTypeId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "parentServiceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "parentName": {
            "type": [
              "null",
              "string"
            ]
          },
          "level": {
            "type": "integer",
            "format": "int16"
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ServiceStandardResponse": {
        "required": [
          "id",
          "standardCode",
          "standardDescription",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "standardCode": {
            "type": "string"
          },
          "standardDescription": {
            "type": "string"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ServiceTreeNode": {
        "required": [
          "id",
          "serviceCode",
          "name",
          "serviceTypeId",
          "isActive",
          "sortOrder",
          "uom",
          "defaultRate",
          "hsnSac",
          "rowVersion",
          "children"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "serviceTypeId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceTreeNode"
            }
          }
        }
      },
      "ServiceTreeResponse": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceTreeNode"
            }
          }
        }
      },
      "ServiceTypeResponse": {
        "required": [
          "id",
          "name",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SetClientStatusResponse": {
        "required": [
          "id",
          "status",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/ClientStatus"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SetRateRequest": {
        "required": [
          "grade",
          "hourlyRate",
          "effectiveFrom"
        ],
        "type": "object",
        "properties": {
          "grade": {
            "type": "string"
          },
          "hourlyRate": {
            "type": "number",
            "format": "double"
          },
          "effectiveFrom": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "SetServiceStatusResponse": {
        "required": [
          "id",
          "isActive",
          "affectedIds"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "isActive": {
            "type": "boolean"
          },
          "affectedIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        }
      },
      "SetUserStatusResponse": {
        "required": [
          "id",
          "isActive",
          "signedOutSessions"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "isActive": {
            "type": "boolean"
          },
          "signedOutSessions": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "SiteVisitReport": {
        "required": [
          "id",
          "fileName",
          "url",
          "contentType",
          "size"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "fileName": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SiteVisitResponse": {
        "required": [
          "id",
          "leadId",
          "visitDate",
          "visitedById",
          "visitedByName",
          "findings",
          "report",
          "recordedAt",
          "recordedById"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "leadId": {
            "type": "integer",
            "format": "int64"
          },
          "visitDate": {
            "type": "string",
            "format": "date"
          },
          "visitedById": {
            "type": "integer",
            "format": "int64"
          },
          "visitedByName": {
            "type": "string"
          },
          "findings": {
            "type": "string"
          },
          "report": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SiteVisitReport"
              }
            ]
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "recordedById": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "Stream": {
        "type": "string",
        "format": "binary"
      },
      "SubmitProposalRevisionRequest": {
        "required": [
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SuggestClientCodeResponse": {
        "required": [
          "clientCode"
        ],
        "type": "object",
        "properties": {
          "clientCode": {
            "type": "string"
          }
        }
      },
      "TeamMemberPerformance": {
        "required": [
          "ownerId",
          "ownerName",
          "openLeads",
          "onHoldLeads",
          "openProposals",
          "pipelineValue",
          "weightedValue",
          "wonThisQuarter",
          "wonValueThisQuarter",
          "lostThisQuarter",
          "winRatePercent"
        ],
        "type": "object",
        "properties": {
          "ownerId": {
            "type": "integer",
            "format": "int64"
          },
          "ownerName": {
            "type": "string"
          },
          "openLeads": {
            "type": "integer",
            "format": "int32"
          },
          "onHoldLeads": {
            "type": "integer",
            "format": "int32"
          },
          "openProposals": {
            "type": "integer",
            "format": "int32"
          },
          "pipelineValue": {
            "type": "number",
            "format": "double"
          },
          "weightedValue": {
            "type": "number",
            "format": "double"
          },
          "wonThisQuarter": {
            "type": "integer",
            "format": "int32"
          },
          "wonValueThisQuarter": {
            "type": "number",
            "format": "double"
          },
          "lostThisQuarter": {
            "type": "integer",
            "format": "int32"
          },
          "winRatePercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "TeamPerformanceResponse": {
        "required": [
          "quarterStart",
          "members"
        ],
        "type": "object",
        "properties": {
          "quarterStart": {
            "type": "string",
            "format": "date"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamMemberPerformance"
            }
          }
        }
      },
      "TestMailAccountRequest": {
        "required": [
          "to"
        ],
        "type": "object",
        "properties": {
          "to": {
            "type": "string"
          }
        }
      },
      "TimelineEntry": {
        "required": [
          "kind",
          "id",
          "at",
          "byUserId",
          "byName",
          "text",
          "activityType",
          "subject",
          "outcome",
          "attendees",
          "durationMin",
          "nextActionOn",
          "fromStageName",
          "toStageName",
          "visitDate",
          "reportAttachmentId"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/TimelineEntryKind"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "byUserId": {
            "type": "integer",
            "format": "int64"
          },
          "byName": {
            "type": "string"
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "activityType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ActivityType"
              }
            ]
          },
          "subject": {
            "type": [
              "null",
              "string"
            ]
          },
          "outcome": {
            "type": [
              "null",
              "string"
            ]
          },
          "attendees": {
            "type": [
              "null",
              "string"
            ]
          },
          "durationMin": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int16"
          },
          "nextActionOn": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "fromStageName": {
            "type": [
              "null",
              "string"
            ]
          },
          "toStageName": {
            "type": [
              "null",
              "string"
            ]
          },
          "visitDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "reportAttachmentId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "TimelineEntryKind": {
        "enum": [
          "stageChange",
          "activity",
          "siteVisit",
          "proposal"
        ]
      },
      "UnreadNotificationsResponse": {
        "required": [
          "count"
        ],
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UpdateApprovalRuleRequest": {
        "required": [
          "level",
          "marginFloorPercent",
          "discountLimitPercent",
          "reason",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "level": {
            "$ref": "#/components/schemas/ProposalApprovalLevel"
          },
          "marginFloorPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "discountLimitPercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "reason": {
            "type": "string"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UpdateClientContactRequest": {
        "required": [
          "rowVersion",
          "name"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "designation": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateClientContactResponse": {
        "required": [
          "id",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UpdateClientRequest": {
        "required": [
          "rowVersion",
          "clientCode",
          "name"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "clientCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "industryId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "gstin": {
            "type": [
              "null",
              "string"
            ]
          },
          "pan": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerUserId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "billingAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "stateCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "pincode": {
            "type": [
              "null",
              "string"
            ]
          },
          "siteAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentTerms": {
            "type": [
              "null",
              "string"
            ]
          },
          "creditDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "UpdateClientResponse": {
        "required": [
          "id",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UpdateExpenseHeadRequest": {
        "required": [
          "rowVersion",
          "name",
          "uom",
          "rateType",
          "defaultRate"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "uom": {
            "type": "string"
          },
          "rateType": {
            "$ref": "#/components/schemas/ExpenseRateType"
          },
          "defaultRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "qtyBasis": {
            "$ref": "#/components/schemas/ExpenseQtyBasis"
          },
          "defaultQty": {
            "type": "number",
            "format": "double",
            "default": 1
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "sortOrder": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "serviceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        }
      },
      "UpdateInternalWorkOrder": {
        "required": [
          "rowVersion",
          "started"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "started": {
            "type": "boolean"
          }
        }
      },
      "UpdateLeadRequest": {
        "required": [
          "rowVersion",
          "projectBackground",
          "probability"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "projectBackground": {
            "type": [
              "null",
              "string"
            ]
          },
          "probability": {
            "type": "integer",
            "format": "int16"
          },
          "contactId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "sourceId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "projectPriority": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectPriority"
              }
            ]
          },
          "projectType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProjectType"
              }
            ]
          },
          "numberOfDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "latitude": {
            "type": [
              "null",
              "string"
            ]
          },
          "longitude": {
            "type": [
              "null",
              "string"
            ]
          },
          "expectedClose": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "serviceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        }
      },
      "UpdateMailAccountRequest": {
        "required": [
          "rowVersion",
          "name",
          "fromAddress",
          "fromName",
          "host",
          "port",
          "security"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string"
          },
          "fromAddress": {
            "type": "string"
          },
          "fromName": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer",
            "format": "int32"
          },
          "security": {
            "$ref": "#/components/schemas/MailSecurity"
          },
          "userName": {
            "type": [
              "null",
              "string"
            ]
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          },
          "clearPassword": {
            "type": "boolean",
            "default": false
          },
          "isDefault": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "UpdateObjectiveRequest": {
        "required": [
          "description"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ObjectiveType"
          }
        }
      },
      "UpdateProposalHeaderRequest": {
        "required": [
          "rowVersion",
          "title",
          "validityDays"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "title": {
            "type": "string"
          },
          "validityDays": {
            "type": "integer",
            "format": "int16"
          },
          "discountPercent": {
            "type": "number",
            "format": "double",
            "default": 0
          },
          "contactId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "enquiryRef": {
            "type": [
              "null",
              "string"
            ]
          },
          "enquiryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "projectName": {
            "type": [
              "null",
              "string"
            ]
          },
          "projectLocation": {
            "type": [
              "null",
              "string"
            ]
          },
          "endClientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "coverStatus": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateProposalSettingsRequest": {
        "required": [
          "rowVersion",
          "companyName",
          "aboutText",
          "hseText",
          "generalExclusions",
          "assumptions",
          "commercialNote",
          "closingText",
          "confidentialityText",
          "defaultValidityDays"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "companyName": {
            "type": "string"
          },
          "aboutText": {
            "type": "string"
          },
          "hseText": {
            "type": "string"
          },
          "generalExclusions": {
            "type": "string"
          },
          "assumptions": {
            "type": "string"
          },
          "commercialNote": {
            "type": "string"
          },
          "closingText": {
            "type": "string"
          },
          "confidentialityText": {
            "type": "string"
          },
          "defaultValidityDays": {
            "type": "integer",
            "format": "int16"
          },
          "credentialsText": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultHsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "signatoryUserId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "approachStages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProposalApproachStageItem"
            }
          },
          "paymentTerms": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProposalPaymentTermItem"
            }
          },
          "tagline": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceLinesIntro": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceLines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ProposalServiceLineItem"
            }
          }
        }
      },
      "UpdateServiceRequest": {
        "required": [
          "rowVersion",
          "serviceCode",
          "name"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "serviceCode": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sortOrder": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "hsnSac": {
            "type": [
              "null",
              "string"
            ]
          },
          "serviceTypeId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        }
      },
      "UpdateServiceResponse": {
        "required": [
          "id",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UpdateServiceStandardRequest": {
        "required": [
          "standardCode",
          "standardDescription"
        ],
        "type": "object",
        "properties": {
          "standardCode": {
            "type": "string"
          },
          "standardDescription": {
            "type": "string"
          }
        }
      },
      "UpdateServiceTypeRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "UpdateUserRequest": {
        "required": [
          "rowVersion",
          "empCode",
          "fullName",
          "email",
          "roleCodes"
        ],
        "type": "object",
        "properties": {
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          },
          "empCode": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "roleCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "designationId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "departmentId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "reportingToId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateUserResponse": {
        "required": [
          "id",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserListItem": {
        "required": [
          "id",
          "empCode",
          "fullName",
          "email",
          "designationName",
          "departmentName",
          "reportingToId",
          "reportingToName",
          "roleCodes",
          "isActive",
          "lockedUntil",
          "lastLoginAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "empCode": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "designationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "departmentName": {
            "type": [
              "null",
              "string"
            ]
          },
          "reportingToId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "reportingToName": {
            "type": [
              "null",
              "string"
            ]
          },
          "roleCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isActive": {
            "type": "boolean"
          },
          "lockedUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastLoginAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "UserLookupsResponse": {
        "required": [
          "roles",
          "designations",
          "departments"
        ],
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleOption"
            }
          },
          "designations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LookupOption"
            }
          },
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LookupOption"
            }
          }
        }
      },
      "UserResponse": {
        "required": [
          "id",
          "empCode",
          "fullName",
          "email",
          "mobile",
          "designationId",
          "designationName",
          "departmentId",
          "departmentName",
          "reportingToId",
          "reportingToName",
          "roleCodes",
          "isActive",
          "lockedUntil",
          "lastLoginAt",
          "directReportCount",
          "rowVersion"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "empCode": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "mobile": {
            "type": [
              "null",
              "string"
            ]
          },
          "designationId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "designationName": {
            "type": [
              "null",
              "string"
            ]
          },
          "departmentId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "departmentName": {
            "type": [
              "null",
              "string"
            ]
          },
          "reportingToId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "reportingToName": {
            "type": [
              "null",
              "string"
            ]
          },
          "roleCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isActive": {
            "type": "boolean"
          },
          "lockedUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastLoginAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "directReportCount": {
            "type": "integer",
            "format": "int32"
          },
          "rowVersion": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Access token from POST /api/v1/auth/login.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "tags": [
    {
      "name": "System"
    },
    {
      "name": "Auth"
    },
    {
      "name": "Clients"
    },
    {
      "name": "Proposals"
    },
    {
      "name": "Follow-ups"
    },
    {
      "name": "Site visits"
    },
    {
      "name": "Services"
    },
    {
      "name": "Rate card"
    },
    {
      "name": "Service types"
    },
    {
      "name": "Service Standards"
    },
    {
      "name": "Objectives"
    },
    {
      "name": "Expense heads"
    },
    {
      "name": "Proposal settings"
    },
    {
      "name": "Proposal approval"
    },
    {
      "name": "Proposal documents"
    },
    {
      "name": "Mail accounts"
    },
    {
      "name": "Leads"
    },
    {
      "name": "Lead attachments"
    },
    {
      "name": "Dashboard"
    },
    {
      "name": "Notifications"
    },
    {
      "name": "Users"
    },
    {
      "name": "Master data import"
    }
  ]
}