{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/companydata-dk/json-schema/companydata-dk-feed-notice-schema.json",
  "title": "FeedNotice",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/companydata-dk-openapi.yml#/components/schemas/FeedNotice",
  "properties": {
    "message_number": {
      "type": "string",
      "title": "Message Number"
    },
    "publication_date": {
      "type": "string",
      "title": "Publication Date",
      "description": "Publication date in Statstidende (YYYY-MM-DD)"
    },
    "indexed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Indexed At",
      "description": "When we stored the notice; the polling cursor follows this"
    },
    "rubrik": {
      "anyOf": [
        {
          "$ref": "#/$defs/Rubrik"
        },
        {
          "type": "null"
        }
      ]
    },
    "cvrs": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Cvrs"
    },
    "companies": {
      "items": {
        "$ref": "#/$defs/NoticeCompany"
      },
      "type": "array",
      "title": "Companies"
    },
    "municipality_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Municipality Code",
      "description": "Company municipality (single-company notices)"
    },
    "municipality_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Municipality Name"
    },
    "industry_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Industry Code"
    },
    "industry_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Industry Text"
    },
    "division_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Division Code"
    },
    "decree_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Decree Date",
      "description": "Bankruptcy decree date (YYYY-MM-DD) on konkursdekret notices"
    },
    "court": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Court"
    },
    "case_number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Case Number"
    },
    "kurator": {
      "anyOf": [
        {
          "$ref": "#/$defs/NoticeKurator"
        },
        {
          "type": "null"
        }
      ],
      "description": "Bankruptcy trustee as published"
    },
    "revoked": {
      "type": "boolean",
      "title": "Revoked",
      "description": "A later Ophævelse af konkursdekret revoked this decree",
      "default": false
    },
    "revoked_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Revoked By",
      "description": "Message number of the revoking notice"
    },
    "revokes": {
      "type": "boolean",
      "title": "Revokes",
      "description": "This notice revokes an earlier bankruptcy decree",
      "default": false
    },
    "correction_of": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Correction Of",
      "description": "Message number this notice corrects"
    },
    "corrected_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Corrected By",
      "description": "Message number of a later correction"
    },
    "summary": {
      "type": "string",
      "title": "Summary",
      "description": "The notice as one Danish sentence or two",
      "default": ""
    },
    "fields": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/NoticeFieldGroup"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fields",
      "description": "Structured fields as published (with include=fields; always on the single-notice endpoint). Submitter and billing groups and CPR numbers are left out."
    }
  },
  "type": "object",
  "required": [
    "message_number",
    "publication_date",
    "cvrs"
  ],
  "$defs": {
    "NoticeCompany": {
      "properties": {
        "cvr": {
          "type": "string",
          "title": "Cvr"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "company_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Company Type",
          "description": "Company form code, e.g. APS or A/S"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status"
        }
      },
      "type": "object",
      "required": [
        "cvr"
      ],
      "title": "NoticeCompany"
    },
    "NoticeFieldGroup": {
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "Field group as published, e.g. Kurator or Skifteret"
        },
        "fields": {
          "additionalProperties": true,
          "type": "object",
          "title": "Fields"
        }
      },
      "type": "object",
      "title": "NoticeFieldGroup"
    },
    "NoticeKurator": {
      "properties": {
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "address": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Address"
        },
        "court": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Court"
        }
      },
      "type": "object",
      "required": [
        "name"
      ],
      "title": "NoticeKurator"
    },
    "Rubrik": {
      "properties": {
        "key": {
          "type": "string",
          "title": "Key",
          "description": "Statstidende message type key"
        },
        "section": {
          "type": "string",
          "title": "Section",
          "description": "Section in Statstidende"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Rubrik name in Danish"
        },
        "name_en": {
          "type": "string",
          "title": "Name En"
        },
        "event_type": {
          "type": "string",
          "title": "Event Type",
          "description": "financial_distress or corporate_announcement"
        }
      },
      "type": "object",
      "required": [
        "key",
        "section",
        "name",
        "name_en",
        "event_type"
      ],
      "title": "Rubrik"
    }
  }
}