{
  "name": "mccs",
  "label": "MCCS",
  "description": "Workflows for sign up, login, edit business, and search businesses.",
  "version": "0.1.0",
  "infoUrl": "https://app.swaggerhub.com/apis/ic3network/mccs-api/0.1#/",
  "maintainer": "Kendraio",
  "supportUrl": "http://kendra.io",
  "database": [],
  "dashboard": {
    "icon": "brightness_5",
    "label": "MCCS",
    "workflowId": "login"
  },
  "services": [
    {
      "label": "Sign up",
      "icon": "person",
      "workflowId": "signup"
    },
    {
      "label": "Login",
      "icon": "person",
      "workflowId": "login"
    },
    {
      "label": "Edit",
      "icon": "file_copy",
      "workflowId": "editBusiness"
    },
    {
      "label": "Search",
      "icon": "search",
      "workflowId": "search"
    }
  ],
  "workflow": [
    {
      "title": "Sign up",
      "workflowId": "signup",
      "config": "configs/signup.json"
    },
    {
      "title": "Login",
      "workflowId": "login",
      "config": "configs/login.json"
    },
    {
      "title": "Edit business",
      "workflowId": "editBusiness",
      "config": "configs/editBusiness.json"
    },
    {
      "title": "Search businesses",
      "workflowId": "search",
      "config": "configs/search.json"
    }
  ],
  "forms": [],
  "tags": [
    "b2b"
  ],
  "attachments": {
    "configs/editBusiness.json": {
      "workflowId": "editBusiness",
      "title": "Edit business",
      "adapterName": "mccs",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "http",
          "method": "get",
          "endpoint": "https://virtserver.swaggerhub.com/ic3network/mccs-api/0.1/business"
        },
        {
          "type": "mapping",
          "mapping": "data.data"
        },
        {
          "type": "form",
          "label": "Update",
          "jsonSchema": {
            "type": "object",
            "properties": {
              "businessName": {
                "title": "businessName",
                "type": "string"
              },
              "businessPhone": {
                "title": "businessPhone",
                "type": "string"
              },
              "incType": {
                "title": "incType",
                "type": "string"
              },
              "companyNumber": {
                "title": "companyNumber",
                "type": "string"
              },
              "website": {
                "title": "website",
                "type": "string"
              },
              "turnover": {
                "title": "turnover",
                "type": "integer"
              },
              "description": {
                "title": "description",
                "type": "string"
              },
              "locationAddress": {
                "title": "locationAddress",
                "type": "string"
              },
              "locationCity": {
                "title": "locationCity",
                "type": "string"
              },
              "locationRegion": {
                "title": "locationRegion",
                "type": "string"
              },
              "locationPostCode": {
                "title": "locationPostCode",
                "type": "string"
              },
              "locationCountry": {
                "title": "locationCountry",
                "type": "string"
              },
              "offers": {
                "title": "offers",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "wants": {
                "title": "wants",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "uiSchema": {
            "offers": {
              "ui:widget": "table",
              "defaultValue": "",
              "colHeadings": [
                "Offers"
              ]
            },
            "wants": {
              "ui:widget": "table",
              "defaultValue": "",
              "colHeadings": [
                "Wants"
              ]
            }
          }
        },
        {
          "type": "http",
          "method": "patch",
          "endpoint": "https://virtserver.swaggerhub.com/ic3network/mccs-api/0.1/business"
        },
        {
          "type": "debug",
          "open": 1,
          "showContext": false
        }
      ]
    },
    "configs/login.json": {
      "workflowId": "login",
      "title": "Login",
      "adapterName": "mccs",
      "blocks": [
        {
          "type": "form",
          "label": "Login",
          "jsonSchema": {
            "required": [
              "email",
              "password"
            ],
            "type": "object",
            "properties": {
              "email": {
                "title": "Email",
                "type": "string"
              },
              "password": {
                "title": "Password",
                "type": "string"
              }
            }
          },
          "uiSchema": {}
        },
        {
          "type": "http",
          "method": "post",
          "endpoint": "https://virtserver.swaggerhub.com/ic3network/mccs-api/0.1/login"
        },
        {
          "type": "mapping",
          "mapping": "data.data.token"
        },
        {
          "type": "debug",
          "open": 1,
          "showContext": false
        },
        {
          "type": "variable-set",
          "name": "authToken"
        }
      ]
    },
    "configs/search.json": {
      "workflowId": "search",
      "title": "Search businesses",
      "adapterName": "mccs",
      "blocks": [
        {
          "type": "form",
          "label": "Search",
          "jsonSchema": {
            "type": "object",
            "properties": {
              "page": {
                "title": "Page",
                "type": "integer"
              },
              "page_size": {
                "title": "Page size",
                "type": "integer"
              },
              "category": {
                "title": "Category",
                "type": "string"
              },
              "favourites_only": {
                "title": "Favourites only",
                "type": "boolean",
                "default": false
              },
              "offers": {
                "title": "Offers",
                "type": "string"
              },
              "wants": {
                "title": "Wants",
                "type": "string"
              },
              "tagged_since": {
                "title": "Tagged since",
                "type": "string",
                "default": "2019-12-25T12:12:12.001Z"
              }
            }
          },
          "uiSchema": {}
        },
        {
          "type": "http",
          "method": "get",
          "endpoint": {
            "protocol": "https:",
            "host": "virtserver.swaggerhub.com",
            "pathname": "/ic3network/mccs-api/0.1/businesses",
            "valueGetters": {
              "query": "data"
            }
          }
        },
        {
          "type": "mapping",
          "mapping": "data.data"
        },
        {
          "type": "grid",
          "gridOptions": {},
          "columnDefs": [
            {
              "headerName": "ID",
              "field": "id"
            },
            {
              "headerName": "Name",
              "field": "businessName"
            },
            {
              "headerName": "Phone",
              "field": "businessPhone"
            },
            {
              "headerName": "Website",
              "field": "website"
            },
            {
              "headerName": "Location",
              "valueGetter": "[locationCity, locationCountry]"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
      ]
    },
    "configs/signup.json": {
      "workflowId": "signup",
      "title": "Sign up",
      "adapterName": "mccs",
      "blocks": [
        {
          "type": "form",
          "label": "Sign up",
          "jsonSchema": {
            "required": [
              "email",
              "password"
            ],
            "type": "object",
            "properties": {
              "email": {
                "title": "Email",
                "type": "string"
              },
              "password": {
                "title": "Password",
                "type": "string"
              }
            }
          },
          "uiSchema": {}
        },
        {
          "type": "http",
          "method": "post",
          "endpoint": "https://virtserver.swaggerhub.com/ic3network/mccs-api/0.1/signup"
        },
        {
          "type": "mapping",
          "mapping": "data.data.token"
        },
        {
          "type": "debug",
          "open": 1,
          "showContext": false
        },
        {
          "type": "variable-set",
          "name": "authToken"
        }
      ]
    }
  }
}