// Generated by scripts/client-program/generate-kpi-definitions.mjs. Do not edit.
export const KPI_DEFINITIONS_SHA256 = "048fdb784588a17400a243919a13f044a1845b4df1b500afe61b89a10fc92226";

const kpiDefinitions = {
  "version": "1.0",
  "as_of": "2026-08-09",
  "mapping_status": "Pending until human review",
  "currency": "THB",
  "fields": [
    {
      "field": "lot_id",
      "type": "text",
      "owner": "Accounting",
      "version": "1.0",
      "definition": "Synthetic diamond lot business key"
    },
    {
      "field": "purchase_cost",
      "type": "THB",
      "owner": "Procurement",
      "version": "1.0",
      "definition": "Approved purchase cost before processing"
    },
    {
      "field": "import_cost",
      "type": "THB",
      "owner": "Import Operations",
      "version": "1.0",
      "definition": "Import cost allocated to the lot"
    },
    {
      "field": "cutting_cost",
      "type": "THB",
      "owner": "Production",
      "version": "1.0",
      "definition": "Cutting and polishing cost allocated to the lot"
    },
    {
      "field": "certificate_cost",
      "type": "THB",
      "owner": "Quality",
      "version": "1.0",
      "definition": "Certificate and quality-document cost"
    },
    {
      "field": "logistics_cost",
      "type": "THB",
      "owner": "Logistics",
      "version": "1.0",
      "definition": "Insured logistics cost allocated to the lot"
    },
    {
      "field": "landed_cost",
      "type": "THB",
      "owner": "Accounting",
      "version": "1.0",
      "definition": "Purchase + import + cutting + certificate + logistics"
    },
    {
      "field": "gross_margin",
      "type": "THB",
      "owner": "Finance",
      "version": "1.0",
      "definition": "Sales amount less landed cost"
    },
    {
      "field": "ar_aging",
      "type": "bucket",
      "owner": "AR",
      "version": "1.0",
      "definition": "Current, 1-30, 31-60, 61-90, 90+ days past due"
    },
    {
      "field": "document_completeness",
      "type": "percent",
      "owner": "Accounting",
      "version": "1.0",
      "definition": "Completed required documents divided by required documents"
    },
    {
      "field": "source_key",
      "type": "text",
      "owner": "Data owner",
      "version": "1.0",
      "definition": "source_file|source_sheet|source_row trace key"
    }
  ],
  "metrics": [
    {
      "metric": "landed_cost",
      "unit": "THB",
      "definition": "Purchase + import + cutting + certificate + logistics",
      "owner": "Accounting",
      "version": "1.0",
      "as_of": "2026-08-09"
    },
    {
      "metric": "landed_cost_per_lot",
      "unit": "THB/lot",
      "definition": "Landed cost / included lot count",
      "owner": "Accounting",
      "version": "1.0",
      "as_of": "2026-08-09"
    },
    {
      "metric": "landed_cost_per_carat",
      "unit": "THB/carat",
      "definition": "Landed cost / non-zero total carat",
      "owner": "Accounting",
      "version": "1.0",
      "as_of": "2026-08-09"
    },
    {
      "metric": "processing_cost_variance",
      "unit": "THB",
      "definition": "Actual cutting + certificate - expected processing cost",
      "owner": "Production Finance",
      "version": "1.0",
      "as_of": "2026-08-09"
    },
    {
      "metric": "gross_margin",
      "unit": "THB",
      "definition": "Sales amount - landed cost",
      "owner": "Finance",
      "version": "1.0",
      "as_of": "2026-08-09"
    },
    {
      "metric": "ar_aging",
      "unit": "THB",
      "definition": "Open invoice balance by days past due",
      "owner": "Accounts Receivable",
      "version": "1.0",
      "as_of": "2026-08-09"
    },
    {
      "metric": "document_completeness",
      "unit": "%",
      "definition": "Completed required documents / required documents",
      "owner": "Accounting Control",
      "version": "1.0",
      "as_of": "2026-08-09"
    }
  ],
  "control_rows": [
    {
      "control": "mapping_gate",
      "value": "Approved",
      "owner": "Accounting Data Owner",
      "failure_behavior": "Block calculation until Approved"
    },
    {
      "control": "duplicate_policy",
      "value": "First valid source-order row wins",
      "owner": "Accounting Data Owner",
      "failure_behavior": "Later duplicate becomes exception"
    },
    {
      "control": "ar_bucket_1_max_days",
      "value": 30,
      "owner": "Accounts Receivable",
      "failure_behavior": "1-30"
    },
    {
      "control": "ar_bucket_2_max_days",
      "value": 60,
      "owner": "Accounts Receivable",
      "failure_behavior": "31-60"
    },
    {
      "control": "ar_bucket_3_max_days",
      "value": 90,
      "owner": "Accounts Receivable",
      "failure_behavior": "61-90; larger is 90+"
    },
    {
      "control": "reconciliation_tolerance_thb",
      "value": 0.01,
      "owner": "Finance",
      "failure_behavior": "Difference must be within tolerance"
    },
    {
      "control": "external_action",
      "value": "None",
      "owner": "Workshop Lead",
      "failure_behavior": "No posting, persistence, transmission, or ERP action"
    }
  ],
  "controls": {
    "mapping_gate": "Approved",
    "duplicate_policy": "First valid row in file/sheet/row order wins; later rows are exceptions",
    "ar_aging_days": [
      0,
      30,
      60,
      90
    ],
    "zero_denominator": "Block metric and emit exception",
    "posting": "No ERP posting or external action"
  }
};

export default kpiDefinitions;
