{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://recruitly.dev/backup-schema/v1/deals.schema.json",
  "title": "Deals",
  "description": "Your sales opportunities and their stage.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "tenantId": {
      "type": [
        "string",
        "null"
      ]
    },
    "reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "owner": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "createdOn": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "modifiedOn": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "archived": {
      "type": "boolean"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "company": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "contact": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "stage": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": [
        "string",
        "null"
      ]
    },
    "employmentType": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": [
        "string",
        "null"
      ]
    },
    "probability": {
      "type": [
        "number",
        "null"
      ]
    },
    "bid": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "value": {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        "currency": {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        "tenure": {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        "duration": {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "forecastedClosingDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "startDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "actualClosingDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "closedByName": {
      "type": [
        "string",
        "null"
      ]
    },
    "assignedTo": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "customFields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": [
              "string",
              "null"
            ]
          },
          "value": {
            "type": [
              "string",
              "number",
              "boolean",
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      }
    }
  },
  "required": [
    "id",
    "tenantId",
    "reference",
    "owner",
    "createdOn",
    "modifiedOn",
    "archived",
    "name",
    "description",
    "company",
    "contact",
    "stage",
    "type",
    "employmentType",
    "source",
    "probability",
    "bid",
    "forecastedClosingDate",
    "startDate",
    "actualClosingDate",
    "closedByName",
    "assignedTo",
    "customFields"
  ],
  "additionalProperties": false
}
