{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/estimating_email/v1.json",
  "title": "estimating_email contract v1",
  "type": "object",
  "required": [
    "attachments",
    "conversation_id",
    "email_id",
    "from",
    "has_attachments",
    "id",
    "polarity",
    "reason_code",
    "received_at",
    "subject"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Graph message id; the shelf's identity and dedup key.",
      "x-demiton-requiredness": "required"
    },
    "from": {
      "type": "object",
      "description": "Graph sender block (`emailAddress.name`, `emailAddress.address`).",
      "x-demiton-requiredness": "required"
    },
    "subject": {
      "type": "string",
      "description": "Subject line as received.",
      "x-demiton-requiredness": "required"
    },
    "user_id": {
      "type": "number",
      "description": "The tenant identity that made the correction.",
      "x-demiton-requiredness": "tenant-specific"
    },
    "email_id": {
      "type": "string",
      "description": "The harvested message's `id` the correction is about.",
      "x-demiton-requiredness": "required"
    },
    "polarity": {
      "type": "string",
      "description": "`suppress`, `promote` or `except`.",
      "x-demiton-requiredness": "required"
    },
    "confidence": {
      "type": "number",
      "description": "Hand-tuned classifier confidence.",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "0–1"
    },
    "attachments": {
      "type": "array",
      "description": "Attachment metadata only: `id`, `name`, `content_type`, `size`.",
      "x-demiton-requiredness": "required"
    },
    "auto_create": {
      "type": "boolean",
      "description": "Whether the classification cleared the org's auto-create threshold with a folder name and an attachment.",
      "x-demiton-requiredness": "optional"
    },
    "reason_code": {
      "type": "string",
      "description": "The selected reason, from a per-polarity vocabulary.",
      "x-demiton-requiredness": "required"
    },
    "received_at": {
      "type": "string",
      "description": "When the mailbox received the message.",
      "x-demiton-requiredness": "required",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "company_guess": {
      "type": "string",
      "description": "Best-effort company name from the sender domain; null for public webmail domains.",
      "x-demiton-requiredness": "optional"
    },
    "source_folder": {
      "type": "string",
      "description": "Folder path the message was harvested from (`Inbox`, `Local Council/Tweed Shire`, …).",
      "x-demiton-requiredness": "optional"
    },
    "candidate_kind": {
      "type": "string",
      "description": "The ingress verdict: `new_opportunity`, `chain_update` or `noise`.",
      "x-demiton-requiredness": "optional"
    },
    "conversation_id": {
      "type": "string",
      "description": "Graph conversation/thread key.",
      "x-demiton-requiredness": "required"
    },
    "has_attachments": {
      "type": "boolean",
      "description": "Whether the message carried attachments.",
      "x-demiton-requiredness": "required"
    },
    "folder_name_suffix": {
      "type": "string",
      "description": "Proposed folder suffix for a new numbered opportunity folder.",
      "x-demiton-requiredness": "optional"
    },
    "portal_link_detected": {
      "type": "boolean",
      "description": "Whether a procurement-portal link was detected, meaning documents are not attached.",
      "x-demiton-requiredness": "optional"
    },
    "classification_reason": {
      "type": "string",
      "description": "Why the verdict came out that way, in one sentence.",
      "x-demiton-requiredness": "optional"
    },
    "description_candidate": {
      "type": "string",
      "description": "Cleaned subject as the candidate opportunity description.",
      "x-demiton-requiredness": "optional"
    }
  },
  "x-demiton-register-type": "estimating_email",
  "x-demiton-contract-version": "1.0.3",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [
    {
      "axis": "financial_period",
      "requirement": "required",
      "role": "context"
    },
    {
      "axis": "customer",
      "requirement": "optional",
      "role": "context"
    }
  ],
  "x-demiton-measures": [],
  "x-demiton-provenance": {
    "standards": [
      {
        "code": "AS/NZS ISO 9001:2016",
        "title": "Quality management systems - Requirements (AU/NZ adoption of ISO 9001:2015)",
        "access": "paywalled_secondary",
        "clause": "7.5; 10.2",
        "region": "Australia",
        "edition": "2016 (ISO 9001:2026 expected 16 Sep 2026)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Privacy Act 1988 (Cth)",
        "title": "Privacy Act 1988 and the Australian Privacy Principles",
        "access": "public_summary",
        "region": "Australia",
        "edition": "No. 119, 1988 (as amended)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "ISO 19650-1:2018 / ISO 19650-2:2018",
        "title": "Information management using BIM - Part 1 (AS ISO 19650.1:2019 identical)",
        "access": "paywalled_secondary",
        "region": "International",
        "edition": "2018",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Privacy Act 2020 (NZ)",
        "title": "Privacy Act 2020 and the information privacy principles",
        "access": "public_summary",
        "region": "New Zealand",
        "edition": "2020",
        "checked_on": "2026-09-14"
      },
      {
        "code": "UK GDPR / DPA 2018",
        "title": "UK GDPR and Data Protection Act 2018",
        "access": "public_summary",
        "region": "United Kingdom",
        "edition": "DPA 2018 c. 12 (as amended)",
        "checked_on": "2026-09-14"
      }
    ]
  },
  "description": "Emails in your estimating mailbox, filed against the opportunity they concern.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/estimating_email/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}