{
  "product": "happytree-node.workflows",
  "formatVersion": 1,
  "workflows": [
    {
      "id": "workflow-1",
      "workflow": {
        "product": "happytree-node.workflow",
        "formatVersion": 1,
        "blueprint": {
          "name": "E07 \u00B7 01 Diagnosticar estoque e calcular reposi\u00E7\u00E3o",
          "nodes": [
            {
              "id": "fonte",
              "type": "files.read-json",
              "settings": {
                "sourceId": "__htn_configurar__"
              },
              "x": 0,
              "y": 0
            },
            {
              "id": "tabela",
              "type": "tables.from-json",
              "settings": {},
              "x": 290,
              "y": 0
            },
            {
              "id": "abaixo-minimo",
              "type": "tables.filter-columns",
              "settings": {
                "left": "saldo",
                "right": "minimo",
                "comparison": "Menor que",
                "nulls": "Falhar",
                "ignoreCase": false
              },
              "x": 580,
              "y": 0
            },
            {
              "id": "repor",
              "type": "tables.calculate-column",
              "settings": {
                "left": "meta",
                "rightMode": "Coluna",
                "right": "saldo",
                "operation": "Subtrair",
                "output": "quantidade_repor",
                "nulls": "Falhar"
              },
              "x": 870,
              "y": 0
            },
            {
              "id": "custo-reposicao",
              "type": "tables.calculate-column",
              "settings": {
                "left": "quantidade_repor",
                "rightMode": "Coluna",
                "right": "custo_unitario",
                "operation": "Multiplicar",
                "output": "custo_reposicao",
                "nulls": "Falhar"
              },
              "x": 1160,
              "y": 0
            },
            {
              "id": "painel",
              "type": "bi.explore",
              "settings": {
                "title": "Lista de reposi\u00E7\u00E3o da Aurora Papelaria",
                "definition": "{\u0022filters\u0022: [{\u0022column\u0022: \u0022fornecedor\u0022, \u0022title\u0022: \u0022Fornecedor\u0022, \u0022kind\u0022: \u0022category\u0022}, {\u0022column\u0022: \u0022categoria\u0022, \u0022title\u0022: \u0022Categoria\u0022, \u0022kind\u0022: \u0022category\u0022}], \u0022panels\u0022: [{\u0022title\u0022: \u0022Produtos abaixo do m\u00EDnimo\u0022, \u0022kind\u0022: \u0022indicator\u0022, \u0022operation\u0022: \u0022count\u0022, \u0022valueColumn\u0022: \u0022\u0022, \u0022categoryColumn\u0022: \u0022\u0022, \u0022seriesColumn\u0022: \u0022\u0022, \u0022unit\u0022: \u0022\u0022}, {\u0022title\u0022: \u0022Unidades para repor\u0022, \u0022kind\u0022: \u0022indicator\u0022, \u0022operation\u0022: \u0022sum\u0022, \u0022valueColumn\u0022: \u0022quantidade_repor\u0022, \u0022categoryColumn\u0022: \u0022\u0022, \u0022seriesColumn\u0022: \u0022\u0022, \u0022unit\u0022: \u0022un.\u0022}, {\u0022title\u0022: \u0022Custo estimado\u0022, \u0022kind\u0022: \u0022indicator\u0022, \u0022operation\u0022: \u0022sum\u0022, \u0022valueColumn\u0022: \u0022custo_reposicao\u0022, \u0022categoryColumn\u0022: \u0022\u0022, \u0022seriesColumn\u0022: \u0022\u0022, \u0022unit\u0022: \u0022R$\u0022}, {\u0022title\u0022: \u0022Custo por fornecedor\u0022, \u0022kind\u0022: \u0022bar\u0022, \u0022operation\u0022: \u0022sum\u0022, \u0022valueColumn\u0022: \u0022custo_reposicao\u0022, \u0022categoryColumn\u0022: \u0022fornecedor\u0022, \u0022seriesColumn\u0022: \u0022\u0022, \u0022unit\u0022: \u0022R$\u0022}]}"
              },
              "x": 0,
              "y": 180
            },
            {
              "id": "html-claro",
              "type": "bi.export-html",
              "settings": {
                "name": "reposicao-estoque-claro.html",
                "theme": "Claro",
                "interactive": true
              },
              "x": 290,
              "y": 180
            },
            {
              "id": "html-escuro",
              "type": "bi.export-html",
              "settings": {
                "name": "reposicao-estoque-escuro.html",
                "theme": "Escuro",
                "interactive": true
              },
              "x": 580,
              "y": 180
            },
            {
              "id": "lista-texto",
              "type": "tables.text",
              "settings": {
                "template": "{{/sku}} - {{/produto}} | fornecedor: {{/fornecedor}} | saldo: {{/saldo}} | repor: {{/quantidade_repor}} | custo: R$ {{/custo_reposicao}}",
                "separator": "Nova linha"
              },
              "x": 870,
              "y": 180
            }
          ],
          "edges": [
            {
              "source": "fonte",
              "target": "tabela",
              "order": 0
            },
            {
              "source": "tabela",
              "target": "abaixo-minimo",
              "order": 0
            },
            {
              "source": "abaixo-minimo",
              "target": "repor",
              "order": 0
            },
            {
              "source": "repor",
              "target": "custo-reposicao",
              "order": 0
            },
            {
              "source": "custo-reposicao",
              "target": "painel",
              "order": 0
            },
            {
              "source": "painel",
              "target": "html-claro",
              "order": 0
            },
            {
              "source": "painel",
              "target": "html-escuro",
              "order": 0
            },
            {
              "source": "custo-reposicao",
              "target": "lista-texto",
              "order": 0
            }
          ],
          "schemaVersion": 1
        },
        "requiredBindings": [
          {
            "nodeId": "fonte",
            "nodeName": "Ler arquivo JSON",
            "property": "sourceId",
            "title": "Fonte do projeto",
            "kind": "project-source"
          }
        ]
      }
    },
    {
      "id": "workflow-2",
      "workflow": {
        "product": "happytree-node.workflow",
        "formatVersion": 1,
        "blueprint": {
          "name": "E07 \u00B7 02 Conferir reposi\u00E7\u00E3o a partir do CSV",
          "nodes": [
            {
              "id": "csv",
              "type": "tables.csv",
              "settings": {
                "delimiter": ";",
                "sourceId": "__htn_configurar__"
              },
              "x": 0,
              "y": 0
            },
            {
              "id": "numero-saldo",
              "type": "numbers.column",
              "settings": {
                "column": "saldo",
                "target": "N\u00FAmero",
                "format": "Ponto",
                "nulls": "Falhar"
              },
              "x": 290,
              "y": 0
            },
            {
              "id": "numero-minimo",
              "type": "numbers.column",
              "settings": {
                "column": "minimo",
                "target": "N\u00FAmero",
                "format": "Ponto",
                "nulls": "Falhar"
              },
              "x": 580,
              "y": 0
            },
            {
              "id": "numero-meta",
              "type": "numbers.column",
              "settings": {
                "column": "meta",
                "target": "N\u00FAmero",
                "format": "Ponto",
                "nulls": "Falhar"
              },
              "x": 870,
              "y": 0
            },
            {
              "id": "numero-custo_unitario",
              "type": "numbers.column",
              "settings": {
                "column": "custo_unitario",
                "target": "N\u00FAmero",
                "format": "Ponto",
                "nulls": "Falhar"
              },
              "x": 1160,
              "y": 0
            },
            {
              "id": "abaixo-minimo",
              "type": "tables.filter-columns",
              "settings": {
                "left": "saldo",
                "right": "minimo",
                "comparison": "Menor que",
                "nulls": "Falhar",
                "ignoreCase": false
              },
              "x": 0,
              "y": 180
            },
            {
              "id": "repor",
              "type": "tables.calculate-column",
              "settings": {
                "left": "meta",
                "rightMode": "Coluna",
                "right": "saldo",
                "operation": "Subtrair",
                "output": "quantidade_repor",
                "nulls": "Falhar"
              },
              "x": 290,
              "y": 180
            },
            {
              "id": "custo-reposicao",
              "type": "tables.calculate-column",
              "settings": {
                "left": "quantidade_repor",
                "rightMode": "Coluna",
                "right": "custo_unitario",
                "operation": "Multiplicar",
                "output": "custo_reposicao",
                "nulls": "Falhar"
              },
              "x": 580,
              "y": 180
            }
          ],
          "edges": [
            {
              "source": "csv",
              "target": "numero-saldo",
              "order": 0
            },
            {
              "source": "numero-saldo",
              "target": "numero-minimo",
              "order": 0
            },
            {
              "source": "numero-minimo",
              "target": "numero-meta",
              "order": 0
            },
            {
              "source": "numero-meta",
              "target": "numero-custo_unitario",
              "order": 0
            },
            {
              "source": "numero-custo_unitario",
              "target": "abaixo-minimo",
              "order": 0
            },
            {
              "source": "abaixo-minimo",
              "target": "repor",
              "order": 0
            },
            {
              "source": "repor",
              "target": "custo-reposicao",
              "order": 0
            }
          ],
          "schemaVersion": 1
        },
        "requiredBindings": [
          {
            "nodeId": "csv",
            "nodeName": "Ler CSV",
            "property": "sourceId",
            "title": "Fonte do projeto",
            "kind": "project-source"
          }
        ]
      }
    },
    {
      "id": "workflow-3",
      "workflow": {
        "product": "happytree-node.workflow",
        "formatVersion": 1,
        "blueprint": {
          "name": "E07 \u00B7 03 Separar lista de um fornecedor",
          "nodes": [
            {
              "id": "fonte",
              "type": "files.read-json",
              "settings": {
                "sourceId": "__htn_configurar__"
              },
              "x": 0,
              "y": 0
            },
            {
              "id": "tabela",
              "type": "tables.from-json",
              "settings": {},
              "x": 290,
              "y": 0
            },
            {
              "id": "abaixo-minimo",
              "type": "tables.filter-columns",
              "settings": {
                "left": "saldo",
                "right": "minimo",
                "comparison": "Menor que",
                "nulls": "Falhar",
                "ignoreCase": false
              },
              "x": 580,
              "y": 0
            },
            {
              "id": "repor",
              "type": "tables.calculate-column",
              "settings": {
                "left": "meta",
                "rightMode": "Coluna",
                "right": "saldo",
                "operation": "Subtrair",
                "output": "quantidade_repor",
                "nulls": "Falhar"
              },
              "x": 870,
              "y": 0
            },
            {
              "id": "custo-reposicao",
              "type": "tables.calculate-column",
              "settings": {
                "left": "quantidade_repor",
                "rightMode": "Coluna",
                "right": "custo_unitario",
                "operation": "Multiplicar",
                "output": "custo_reposicao",
                "nulls": "Falhar"
              },
              "x": 1160,
              "y": 0
            },
            {
              "id": "fornecedor",
              "type": "tables.filter",
              "settings": {
                "comparison": "Igual a",
                "value": "Papel \u0026 Cia",
                "ignoreCase": false,
                "column": "fornecedor"
              },
              "x": 0,
              "y": 180
            },
            {
              "id": "lista",
              "type": "tables.text",
              "settings": {
                "template": "{{/sku}} | {{/produto}} | repor {{/quantidade_repor}} unidades | R$ {{/custo_reposicao}}",
                "separator": "Nova linha"
              },
              "x": 290,
              "y": 180
            }
          ],
          "edges": [
            {
              "source": "fonte",
              "target": "tabela",
              "order": 0
            },
            {
              "source": "tabela",
              "target": "abaixo-minimo",
              "order": 0
            },
            {
              "source": "abaixo-minimo",
              "target": "repor",
              "order": 0
            },
            {
              "source": "repor",
              "target": "custo-reposicao",
              "order": 0
            },
            {
              "source": "custo-reposicao",
              "target": "fornecedor",
              "order": 0
            },
            {
              "source": "fornecedor",
              "target": "lista",
              "order": 0
            }
          ],
          "schemaVersion": 1
        },
        "requiredBindings": [
          {
            "nodeId": "fonte",
            "nodeName": "Ler arquivo JSON",
            "property": "sourceId",
            "title": "Fonte do projeto",
            "kind": "project-source"
          }
        ]
      }
    }
  ]
}