{
  "$id": "https://powercom-maquassihills.planetgis.co.za/MDM/DCUs/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" },
      "Model": { "type": ["string","null"], "code": "Modl" },
      "Barcode": { "type": ["string","number","null"], "code": "Brcd" },
      "UpCommType": { "type": ["string","null"], "code": "UpCT" },
      "Protocol": { "type": ["string","null"], "code": "Prtc" },
      "Longitude": { "type": ["number","null"], "code": "Lngt" },
      "Latitude": { "type": ["number","null"], "code": "Lttd" },
      "Active": { "type": ["boolean","null"], "code": "Actv" },
      "InstallationDate": { "type": ["string","null"], "format": "date", "code": "InDt" },
      "Address": { "type": ["string","null"], "code": "Adrs" },
      "TransformerId": { "type": ["integer","null"], "code": "TrId" }
    },
    "required": ["MDMID"],
    "calculated": {
      "I": { "sql": "Coalesce((SELECT FeatureId FROM f_powercom_dcus WHERE MDMId=:MDMID), CreateEntity(754259564241550944))" },
      "G": { "condition": "HasKey(\"Latitude\") and HasKey(\"Longitude\")", "sql": "WGS84Point(:Latitude,:Longitude)" },  
      "L": { "condition": "HasKey(\"Name\")", "expression": "Name" }
    }
  }
}