{
  "name": "comtrade.trade_mirror",
  "schema_version": "1.0",
  "effective_from": "0.11.0",
  "breaking_policy": "major",
  "primary_key": [
    "periodo",
    "hs_code",
    "reporter_iso",
    "partner_iso"
  ],
  "required_columns": [
    "periodo",
    "ano",
    "hs_code",
    "reporter_iso",
    "partner_iso"
  ],
  "dtypes": {
    "periodo": "str",
    "ano": "int",
    "mes": "int",
    "hs_code": "str",
    "produto_desc": "str",
    "reporter_iso": "str",
    "partner_iso": "str",
    "peso_liquido_kg_reporter": "float",
    "valor_fob_usd_reporter": "float",
    "volume_ton_reporter": "float",
    "peso_liquido_kg_partner": "float",
    "valor_fob_usd_partner": "float",
    "valor_cif_usd_partner": "float",
    "volume_ton_partner": "float",
    "diff_peso_kg": "float",
    "diff_valor_fob_usd": "float",
    "ratio_valor": "float",
    "ratio_peso": "float"
  },
  "nullable": {
    "periodo": false,
    "ano": false,
    "mes": true,
    "hs_code": false,
    "produto_desc": true,
    "reporter_iso": false,
    "partner_iso": false,
    "peso_liquido_kg_reporter": true,
    "valor_fob_usd_reporter": true,
    "volume_ton_reporter": true,
    "peso_liquido_kg_partner": true,
    "valor_fob_usd_partner": true,
    "valor_cif_usd_partner": true,
    "volume_ton_partner": true,
    "diff_peso_kg": true,
    "diff_valor_fob_usd": true,
    "ratio_valor": true,
    "ratio_peso": true
  },
  "columns": [
    {
      "name": "periodo",
      "type": "str",
      "nullable": false,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    },
    {
      "name": "ano",
      "type": "int",
      "nullable": false,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 1988,
      "max_value": null
    },
    {
      "name": "mes",
      "type": "int",
      "nullable": true,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 1,
      "max_value": 12
    },
    {
      "name": "hs_code",
      "type": "str",
      "nullable": false,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    },
    {
      "name": "produto_desc",
      "type": "str",
      "nullable": true,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    },
    {
      "name": "reporter_iso",
      "type": "str",
      "nullable": false,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    },
    {
      "name": "partner_iso",
      "type": "str",
      "nullable": false,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    },
    {
      "name": "peso_liquido_kg_reporter",
      "type": "float",
      "nullable": true,
      "unit": "kg",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 0,
      "max_value": null
    },
    {
      "name": "valor_fob_usd_reporter",
      "type": "float",
      "nullable": true,
      "unit": "USD",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 0,
      "max_value": null
    },
    {
      "name": "volume_ton_reporter",
      "type": "float",
      "nullable": true,
      "unit": "ton",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 0,
      "max_value": null
    },
    {
      "name": "peso_liquido_kg_partner",
      "type": "float",
      "nullable": true,
      "unit": "kg",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 0,
      "max_value": null
    },
    {
      "name": "valor_fob_usd_partner",
      "type": "float",
      "nullable": true,
      "unit": "USD",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 0,
      "max_value": null
    },
    {
      "name": "valor_cif_usd_partner",
      "type": "float",
      "nullable": true,
      "unit": "USD",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 0,
      "max_value": null
    },
    {
      "name": "volume_ton_partner",
      "type": "float",
      "nullable": true,
      "unit": "ton",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": 0,
      "max_value": null
    },
    {
      "name": "diff_peso_kg",
      "type": "float",
      "nullable": true,
      "unit": "kg",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    },
    {
      "name": "diff_valor_fob_usd",
      "type": "float",
      "nullable": true,
      "unit": "USD",
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    },
    {
      "name": "ratio_valor",
      "type": "float",
      "nullable": true,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    },
    {
      "name": "ratio_peso",
      "type": "float",
      "nullable": true,
      "unit": null,
      "stable": true,
      "deprecated": false,
      "description": "",
      "min_value": null,
      "max_value": null
    }
  ],
  "constraints": {
    "no_duplicates": true,
    "ano_min": 1988,
    "mes_min": 1,
    "mes_max": 12,
    "peso_liquido_kg_reporter_min": 0,
    "valor_fob_usd_reporter_min": 0,
    "volume_ton_reporter_min": 0,
    "peso_liquido_kg_partner_min": 0,
    "valor_fob_usd_partner_min": 0,
    "valor_cif_usd_partner_min": 0,
    "volume_ton_partner_min": 0
  },
  "guarantees": [
    "Column names never change (additions only)",
    "'ano' is always >= 1988",
    "'mes' is between 1 and 12 when present",
    "Mirror compares reporter exports (FOB) vs partner imports (CIF)",
    "'ratio_valor' expected range ~0.85-0.95 for normal trade (FOB/CIF)",
    "'ratio_peso' expected ~1.0 for normal trade"
  ]
}
