{
  "$id": "https://powercom-maquassihills.planetgis.co.za/MDM/Transformers/Update/Schema",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "MDMID": { "type": "integer", "code": "MDMD" },
      "Name": { "type": ["string","null"], "code": "Name" },
      "Longitude": { "type": ["number","null"], "code": "Lngt" },
      "Latitude": { "type": ["number","null"], "code": "Lttd" },
      "Barcode": { "type": ["string","null"], "code": "Brcd" },
      "Address": { "type": ["string","null"], "code": "Adrs" },
      "Power": { "type": ["number","null"], "code": "Powr" },
      "InstallationDate": { "type": ["string","null"], "format": "date", "code": "InDt" },
      "MaintenancePeriod": { "type": ["number","null"], "code": "MnPr" },
      "Ownership": { "type": ["string","null"], "code": "Ownr" },
      "ContactPerson": { "type": ["string","null"], "code": "CnPr" },
      "ContactPersonTel": { "type": ["string","null"], "code": "CnPT" },
      "GPRSSignal": { "type": ["number","null"], "code": "GPSg" }
    },
    "required": ["MDMID"],
    "calculated": {
      "I": { "sql": "Coalesce((SELECT FeatureId FROM f_powercom_transformers WHERE MDMId=:MDMID), CreateEntity(754647404906896970))" },
      "G": { "condition": "HasKey(\"Latitude\") and HasKey(\"Longitude\")", "sql": "WGS84Point(:Latitude,:Longitude)" },
      "L": { "condition": "HasKey(\"Name\")", "expression": "Name" }
    }
  }
}