{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/chatinbox-net/json-schema/chatinbox-net-company-vm-schema.json",
  "title": "CompanyVM",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/chatinbox-net-openapi.yml#/components/schemas/CompanyVM",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int32"
    },
    "parentID": {
      "type": "integer",
      "format": "int32"
    },
    "code": {
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "logoUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "pbxServerID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "databaseServerID": {
      "type": "integer",
      "format": "int32"
    },
    "pbxPort": {
      "type": [
        "string",
        "null"
      ]
    },
    "pbxUser": {
      "type": [
        "string",
        "null"
      ]
    },
    "pbxPassword": {
      "type": [
        "string",
        "null"
      ]
    },
    "databaseName": {
      "type": [
        "string",
        "null"
      ]
    },
    "mainCompany": {
      "type": "boolean"
    },
    "recordApiUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "recordPath": {
      "type": [
        "string",
        "null"
      ]
    },
    "tradeName": {
      "type": [
        "string",
        "null"
      ]
    },
    "adress": {
      "type": [
        "string",
        "null"
      ]
    },
    "taxAdministration": {
      "type": [
        "string",
        "null"
      ]
    },
    "taxNumber": {
      "type": [
        "string",
        "null"
      ]
    },
    "mersisNo": {
      "type": [
        "string",
        "null"
      ]
    },
    "relatedPerson": {
      "type": [
        "string",
        "null"
      ]
    },
    "relatedEmail": {
      "type": [
        "string",
        "null"
      ]
    },
    "releatedPhoneNumber": {
      "type": [
        "string",
        "null"
      ]
    },
    "userLicenseCount": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "instanceLicenseCount": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "usedInstanceLicenseCount": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "usedOnlySocialLicenseCount": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "licenseExpireDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "createDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "chatServerID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "isContractActive": {
      "type": "boolean"
    },
    "contractDate": {
      "type": [
        "string",
        "null"
      ]
    },
    "companyInstances": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/CompanyInstanceVM"
      }
    },
    "pbxServer": {
      "$ref": "#/$defs/CompanyServerVM"
    },
    "chatServer": {
      "$ref": "#/$defs/CompanyServerVM"
    },
    "databaseServer": {
      "$ref": "#/$defs/CompanyServerVM"
    },
    "apiKey": {
      "type": [
        "string",
        "null"
      ]
    },
    "apiConfiguration": {
      "$ref": "#/$defs/CompanyApiConfiguration"
    },
    "apiStatus": {
      "type": "boolean"
    },
    "messageLimitPerDaily": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "messageLimitPerMinute": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "companyIpAddresses": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "licenseProgressType": {
      "$ref": "#/$defs/LicenseProgressType"
    },
    "isActive": {
      "type": "boolean"
    },
    "gmt": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "invektoCompanyCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "wssServerID": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "licenseFeature": {
      "type": [
        "string",
        "null"
      ]
    },
    "licenseRenewalPeriod": {
      "type": "integer",
      "format": "int32"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ApiCustomHeader": {
      "type": "object",
      "properties": {
        "key": {
          "type": [
            "string",
            "null"
          ]
        },
        "value": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "CompanyApiConfiguration": {
      "type": "object",
      "properties": {
        "webhookIsActive": {
          "type": "boolean"
        },
        "webhookUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "customHeaders": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/ApiCustomHeader"
          }
        }
      },
      "additionalProperties": false
    },
    "CompanyInstanceVM": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "companyID": {
          "type": "integer",
          "format": "int32"
        },
        "companyCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "phoneNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "chatProviderID": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "providerInstanceID": {
          "type": [
            "string",
            "null"
          ]
        },
        "token": {
          "type": [
            "string",
            "null"
          ]
        },
        "apiUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "lastActiveTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "dataStatus": {
          "type": "integer",
          "format": "int32"
        },
        "outOfControl": {
          "type": "boolean"
        },
        "instanceType": {
          "$ref": "#/$defs/InstanceType"
        },
        "accountName": {
          "type": [
            "string",
            "null"
          ]
        },
        "accountGuid": {
          "type": [
            "string",
            "null"
          ]
        },
        "pageID": {
          "type": [
            "string",
            "null"
          ]
        },
        "expireDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "instanceStatus": {
          "type": "boolean"
        },
        "instanceStatusText": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "CompanyPhoneMaskVM": {
      "type": "object",
      "properties": {
        "direction": {
          "type": [
            "string",
            "null"
          ]
        },
        "count": {
          "type": "integer",
          "format": "int32"
        },
        "encryptionIV": {
          "type": [
            "string",
            "null"
          ]
        },
        "encryptedValuePrefix": {
          "type": [
            "string",
            "null"
          ]
        },
        "algorithm": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "CompanyServerVM": {
      "type": "object",
      "properties": {
        "serverID": {
          "type": "integer",
          "format": "int32"
        },
        "companyID": {
          "type": "integer",
          "format": "int32"
        },
        "serverIP": {
          "type": [
            "string",
            "null"
          ]
        },
        "serverURL": {
          "type": [
            "string",
            "null"
          ]
        },
        "webHookPort": {
          "type": "integer",
          "format": "int32"
        },
        "signalRPort": {
          "type": "integer",
          "format": "int32"
        },
        "port": {
          "type": "integer",
          "format": "int32"
        },
        "serverTypeId": {
          "type": "integer",
          "format": "int32"
        },
        "messageLimitPerMinute": {
          "type": "integer",
          "format": "int32"
        },
        "messageLimitPerDaily": {
          "type": "integer",
          "format": "int32"
        },
        "apiKey": {
          "type": [
            "string",
            "null"
          ]
        },
        "apiConfiguration": {
          "$ref": "#/$defs/CompanyApiConfiguration"
        },
        "apiStatus": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "licenseProgressType": {
          "$ref": "#/$defs/LicenseProgressType"
        },
        "phoneMask": {
          "$ref": "#/$defs/CompanyPhoneMaskVM"
        },
        "chatServerBotKey": {
          "type": [
            "string",
            "null"
          ]
        },
        "chatServerGeneralKey": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "InstanceType": {
      "enum": [
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "type": "integer",
      "format": "int32"
    },
    "LicenseProgressType": {
      "enum": [
        0,
        1,
        2,
        3,
        4
      ],
      "type": "integer",
      "format": "int32"
    }
  }
}