========================= FLOW 1 — CICLOS =========================

{
  "version": "7.0",
  "screens": [
    {
      "id": "CICLOS",
      "title": "Ciclos de lotes",
      "terminal": true,
      "data": {
        "titulo": { "type": "string", "__example__": "Abrir ciclos — Cosecha" },
        "fecha":  { "type": "string", "__example__": "2026-08-04" },
        "lotes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id":    { "type": "string" },
              "title": { "type": "string" }
            }
          },
          "__example__": [
            { "id": "4", "title": "REPOSO 1A" },
            { "id": "7", "title": "REPOSO 1B" },
            { "id": "9", "title": "REPOSO 2A" }
          ]
        }
      },
      "layout": {
        "type": "SingleColumnLayout",
        "children": [
          { "type": "TextHeading", "text": "${data.titulo}" },
          {
            "type": "Form",
            "name": "form_ciclos",
            "children": [
              {
                "type": "DatePicker",
                "name": "fecha",
                "label": "Fecha",
                "required": true,
                "init-value": "${data.fecha}"
              },
              {
                "type": "CheckboxGroup",
                "name": "lotes",
                "label": "Lotes",
                "required": true,
                "data-source": "${data.lotes}"
              },
              {
                "type": "Footer",
                "label": "Enviar",
                "on-click-action": {
                  "name": "complete",
                  "payload": {
                    "fecha": "${form.fecha}",
                    "lotes": "${form.lotes}"
                  }
                }
              }
            ]
          }
        ]
      }
    }
  ]
}


====================== FLOW 2 — PLUVIOMETRIA ======================

{
  "version": "7.0",
  "screens": [
    {
      "id": "PLUVIOMETRIA",
      "title": "Registrar pluviometría",
      "terminal": true,
      "data": {
        "fecha":           { "type": "string",  "__example__": "2026-08-04" },
        "finca_1_label":   { "type": "string",  "__example__": "REPOSO" },
        "finca_1_visible": { "type": "boolean", "__example__": true },
        "finca_2_label":   { "type": "string",  "__example__": "ROSA BLANCA" },
        "finca_2_visible": { "type": "boolean", "__example__": true },
        "finca_3_label":   { "type": "string",  "__example__": "" },
        "finca_3_visible": { "type": "boolean", "__example__": false },
        "finca_4_label":   { "type": "string",  "__example__": "" },
        "finca_4_visible": { "type": "boolean", "__example__": false },
        "finca_5_label":   { "type": "string",  "__example__": "" },
        "finca_5_visible": { "type": "boolean", "__example__": false },
        "finca_6_label":   { "type": "string",  "__example__": "" },
        "finca_6_visible": { "type": "boolean", "__example__": false },
        "finca_7_label":   { "type": "string",  "__example__": "" },
        "finca_7_visible": { "type": "boolean", "__example__": false },
        "finca_8_label":   { "type": "string",  "__example__": "" },
        "finca_8_visible": { "type": "boolean", "__example__": false }
      },
      "layout": {
        "type": "SingleColumnLayout",
        "children": [
          { "type": "TextBody", "text": "Milímetros de lluvia registrados por finca." },
          {
            "type": "Form",
            "name": "form_pluvio",
            "children": [
              { "type": "DatePicker", "name": "fecha", "label": "Fecha", "required": true, "init-value": "${data.fecha}" },

              { "type": "TextInput", "name": "finca_1", "label": "${data.finca_1_label}", "input-type": "number", "visible": "${data.finca_1_visible}" },
              { "type": "TextInput", "name": "finca_2", "label": "${data.finca_2_label}", "input-type": "number", "visible": "${data.finca_2_visible}" },
              { "type": "TextInput", "name": "finca_3", "label": "${data.finca_3_label}", "input-type": "number", "visible": "${data.finca_3_visible}" },
              { "type": "TextInput", "name": "finca_4", "label": "${data.finca_4_label}", "input-type": "number", "visible": "${data.finca_4_visible}" },
              { "type": "TextInput", "name": "finca_5", "label": "${data.finca_5_label}", "input-type": "number", "visible": "${data.finca_5_visible}" },
              { "type": "TextInput", "name": "finca_6", "label": "${data.finca_6_label}", "input-type": "number", "visible": "${data.finca_6_visible}" },
              { "type": "TextInput", "name": "finca_7", "label": "${data.finca_7_label}", "input-type": "number", "visible": "${data.finca_7_visible}" },
              { "type": "TextInput", "name": "finca_8", "label": "${data.finca_8_label}", "input-type": "number", "visible": "${data.finca_8_visible}" },

              {
                "type": "Footer",
                "label": "Enviar",
                "on-click-action": {
                  "name": "complete",
                  "payload": {
                    "fecha":   "${form.fecha}",
                    "finca_1": "${form.finca_1}",
                    "finca_2": "${form.finca_2}",
                    "finca_3": "${form.finca_3}",
                    "finca_4": "${form.finca_4}",
                    "finca_5": "${form.finca_5}",
                    "finca_6": "${form.finca_6}",
                    "finca_7": "${form.finca_7}",
                    "finca_8": "${form.finca_8}"
                  }
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
