{
    "Analytics": {
        "pages": {
            "roles": {
                "default": [
                    "admin",
                    "owner",
                    "parent-owner",
                    "parent-admin"
                ],
                "values": [
                    "*",
                    "admin",
                    "owner",
                    "parent-owner",
                    "parent-admin"
                ]
            },
            "index": {
                "default": {
                    "style": "profile",
                    "frameLayout": [
                        {
                            "width": 12,
                            "layout": [
                                [
                                    {
                                        "type": "bb-date-range-filter-panel",
                                        "width": 12
                                    }
                                ]
                            ]
                        },
                        {
                            "width": 12,
                            "style": "tabs",
                            "layout": [
                                [
                                    {
                                        "type": "bb-tabs-panel",
                                        "width": 12,
                                        "index": 0,
                                        "panel_params": {
                                            "name": "reports_main",
                                            "tabs": [
                                                {
                                                    "name": "ADMIN_DASHBOARD.REPORTS_PAGE.TABS.OVERVIEW",
                                                    "path": ".views({sub_view: 'report_overview_charts'})"
                                                },
                                                {
                                                    "name": "ADMIN_DASHBOARD.REPORTS_PAGE.TABS.BOOKINGS_BY_SERVICE",
                                                    "path": ".views({sub_view: 'report_bookings_by_service'})"
                                                },
                                                {
                                                    "name": "ADMIN_DASHBOARD.REPORTS_PAGE.TABS.BOOKINGS_BY_STATUS",
                                                    "path": ".views({sub_view: 'report_bookings_by_status'})"
                                                },
                                                {
                                                    "name": "ADMIN_DASHBOARD.REPORTS_PAGE.TABS.BOOKINGS_BY_CHANNEL",
                                                    "path": ".views({sub_view: 'report_bookings_by_channel'})"
                                                },
                                                {
                                                    "name": "ADMIN_DASHBOARD.REPORTS_PAGE.TABS.CAPACITY",
                                                    "path": ".views({sub_view: 'report_capacity'})",
                                                    "hide": true
                                                },
                                                {
                                                    "name": "ADMIN_DASHBOARD.REPORTS_PAGE.TABS.LEAD_TIMES",
                                                    "path": ".views({sub_view: 'report_lead_times'})",
                                                    "hide": true
                                                },
                                                {
                                                    "name": "ADMIN_DASHBOARD.REPORTS_PAGE.TABS.MAP",
                                                    "path": ".views({sub_view: 'map'})",
                                                    "hide": true
                                                },
                                                {
                                                    "name": "ADMIN_DASHBOARD.REPORTS_PAGE.TABS.CSV_REPORTS",
                                                    "path": ".views({sub_view: 'csv'})"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            ]
                        }
                    ]
                },
                "values": "*bbc"
            },
            "csv": {
                "default": {
                    "style": "tabs",
                    "layout": [
                        [
                            {
                                "type": "bb-iframe-panel",
                                "width": 12,
                                "index": 0,
                                "panel_params": {
                                    "path": "view/reports/index"
                                }
                            }
                        ]
                    ]
                },
                "values": "*bbc"
            },
            "report_overview_charts": {
                "default": {
                    "style": "boxes",
                    "title": "Overview",
                    "layout": [
                        [
                            {
                                "type": "bb-overview-charts-header-panel",
                                "width": 12,
                                "title": "BB_OVERVIEW_CHARTS_HEADER_PANEL.TITLE",
                                "description": "BB_OVERVIEW_CHARTS_HEADER_PANEL.DESCRIPTION"
                            }
                        ],
                        [
                            {
                                "type": "google_chart_box",
                                "code": "bookings_by_day",
                                "width": 6,
                                "index": 0,
                                "group": "booking",
                                "name": "Bookings by day",
                                "panel_params": {
                                    "options": {
                                        "legend": {
                                            "position": "none"
                                        }
                                    }
                                }
                            },
                            {
                                "type": "google_chart_box",
                                "code": "cancellation_rates_pie",
                                "width": 6,
                                "index": 3,
                                "group": "booking",
                                "name": "Bookings by Channel",
                                "panel_params": {}
                            }
                        ],
                        [
                            {
                                "type": "google_chart_box",
                                "code": "bookings_by_service_summary",
                                "width": 6,
                                "index": 2,
                                "group": "booking",
                                "name": "Bookings by Service",
                                "panel_params": {}
                            },
                            {
                                "type": "google_chart_box",
                                "code": "bookings_by_channel",
                                "width": 6,
                                "index": 3,
                                "group": "booking",
                                "name": "Bookings by Channel",
                                "panel_params": {}
                            }
                        ],
                        [
                            {
                                "type": "bb-bookings-by-location-summary-report-panel",
                                "width": 6,
                                "index": 1,
                                "hide": "!$ctrl.company.hasChildren()",
                                "panel_params": {
                                    "title": "Bookings by Location",
                                    "columns": [
                                        {
                                            "title": "",
                                            "source": "booking",
                                            "exclude": [
                                                {
                                                    "term": {
                                                        "queued": true
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "is_cancelled": true
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "s_status.keyword": "Blocked"
                                                    }
                                                }
                                            ],
                                            "query": [
                                                {}
                                            ],
                                            "display": false
                                        }
                                    ],
                                    "config": {
                                        "options": {
                                            "pieHole": 0.3
                                        }
                                    }
                                }
                            }
                        ]
                    ]
                },
                "values": "*bbc"
            },
            "report_bookings_by_service": {
                "default": {
                    "style": "boxes",
                    "layout": [
                        [
                            {
                                "type": "bb-bookings-by-service-panel",
                                "width": 12,
                                "index": 0,
                                "panel_params": {
                                    "title": "BB_REPORTS_BOOKINGS_BY_SERVICE.TITLE",
                                    "description": "BB_REPORTS_BOOKINGS_BY_SERVICE.DESCRIPTION",
                                    "columns_type": "services",
                                    "showDatePicker": false,
                                    "dateFormatForPicker": "BB_REPORTS_BOOKINGS_BY_SERVICE.DATE_FORMAT"
                                }
                            }
                        ]
                    ]
                },
                "values": "*bbc"
            },
            "report_bookings_by_status": {
                "default": {
                    "style": "boxes",
                    "layout": [
                        [
                            {
                                "type": "bb-bookings-by-channel",
                                "width": 12,
                                "index": 0,
                                "panel_params": {
                                    "title": "BB_REPORTS_BOOKINGS_BY_STATUS.TITLE",
                                    "description": "BB_REPORTS_BOOKINGS_BY_STATUS.DESCRIPTION",
                                    "showDatePicker": false,
                                    "dateFormatForPicker": "BB_REPORTS_BOOKINGS_BY_STATUS.DATE_FORMAT",
                                    "columns": [
                                        {
                                            "title": "BB_REPORTS_BOOKINGS_BY_STATUS.COLUMNS.TOTAL_BOOKINGS",
                                            "tooltip": "BB_REPORTS_BOOKINGS_BY_STATUS.TOOLTIPS.TOTAL_BOOKINGS",
                                            "source": "booking",
                                            "exclude": [
                                                {
                                                    "term": {
                                                        "queued": true
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "s_status.keyword": "Blocked"
                                                    }
                                                }
                                            ],
                                            "query": [
                                                {
                                                    "term": {
                                                        "is_cancelled": false
                                                    }
                                                }
                                            ]
                                        },
                                        {
                                            "title": "BB_REPORTS_BOOKINGS_BY_STATUS.COLUMNS.COMPLETED",
                                            "tooltip": "BB_REPORTS_BOOKINGS_BY_STATUS.TOOLTIPS.COMPLETED",
                                            "source": "booking",
                                            "exclude": [
                                                {
                                                    "term": {
                                                        "queued": true
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "s_status.keyword": "Blocked"
                                                    }
                                                }
                                            ],
                                            "query": [
                                                {
                                                    "query_string": {
                                                        "fields": [
                                                            "current_status"
                                                        ],
                                                        "analyzer": "standard",
                                                        "query": "Completed"
                                                    }
                                                }
                                            ]
                                        },
                                        {
                                            "title": "BB_REPORTS_BOOKINGS_BY_STATUS.COLUMNS.CANCELLED",
                                            "tooltip": "BB_REPORTS_BOOKINGS_BY_STATUS.TOOLTIPS.CANCELLED",
                                            "source": "booking",
                                            "exclude": [
                                                {
                                                    "term": {
                                                        "queued": true
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "s_status.keyword": "Blocked"
                                                    }
                                                }
                                            ],
                                            "query": [
                                                {
                                                    "term": {
                                                        "is_cancelled": true
                                                    }
                                                }
                                            ]
                                        },
                                        {
                                            "title": "BB_REPORTS_BOOKINGS_BY_STATUS.COLUMNS.NO_SHOW",
                                            "tooltip": "BB_REPORTS_BOOKINGS_BY_STATUS.TOOLTIPS.NO_SHOW",
                                            "source": "booking",
                                            "exclude": [
                                                {
                                                    "term": {
                                                        "queued": true
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "s_status.keyword": "Blocked"
                                                    }
                                                }
                                            ],
                                            "query": [
                                                {
                                                    "query_string": {
                                                        "fields": [
                                                            "current_status"
                                                        ],
                                                        "analyzer": "standard",
                                                        "query": "No show"
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        ]
                    ]
                },
                "values": "*bbc"
            },
            "report_bookings_by_channel": {
                "default": {
                    "style": "boxes",
                    "layout": [
                        [
                            {
                                "type": "bb-bookings-by-status",
                                "width": 12,
                                "index": 0,
                                "panel_params": {
                                    "title": "BB_REPORTS_BOOKINGS_BY_CHANNEL.TITLE",
                                    "description": "BB_REPORTS_BOOKINGS_BY_CHANNEL.DESCRIPTION",
                                    "showDatePicker": false,
                                    "dateFormatForPicker": "BB_REPORTS_BOOKINGS_BY_CHANNEL.DATE_FORMAT",
                                    "columns": [
                                        {
                                            "title": "BB_REPORTS_BOOKINGS_BY_CHANNEL.COLUMNS.BOOKED_ONLINE",
                                            "tooltip": "BB_REPORTS_BOOKINGS_BY_CHANNEL.TOOLTIPS.BOOKED_ONLINE",
                                            "source": "booking",
                                            "exclude": [
                                                {
                                                    "term": {
                                                        "queued": true
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "s_status.keyword": "Blocked"
                                                    }
                                                }
                                            ],
                                            "query": [
                                                {
                                                    "match_phrase": {
                                                        "channel": {
                                                            "query": "Client"
                                                        }
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "is_cancelled": false
                                                    }
                                                }
                                            ]
                                        },
                                        {
                                            "title": "BB_REPORTS_BOOKINGS_BY_CHANNEL.COLUMNS.BOOKED_IN_STORE",
                                            "tooltip": "BB_REPORTS_BOOKINGS_BY_CHANNEL.TOOLTIPS.BOOKED_IN_STORE",
                                            "source": "booking",
                                            "exclude": [
                                                {
                                                    "term": {
                                                        "queued": true
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "s_status.keyword": "Blocked"
                                                    }
                                                }
                                            ],
                                            "query": [
                                                {
                                                    "match_phrase": {
                                                        "channel": {
                                                            "query": "Administrator"
                                                        }
                                                    }
                                                },
                                                {
                                                    "term": {
                                                        "is_cancelled": false
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        ]
                    ]
                },
                "values": "*bbc"
            },
            "report_capacity": {
                "default": {
                    "style": "capacity",
                    "layout": [
                        [
                            {
                                "type": "bb-capacity-report",
                                "width": 12,
                                "index": 0,
                                "panel_params": {
                                    "title": "BB_REPORTS_CAPACITY.TITLE",
                                    "description": "BB_REPORTS_CAPACITY.DESCRIPTION",
                                    "showDatePicker": false,
                                    "dateFormatForPicker": "BB_REPORTS_CAPACITY.DATE_FORMAT",
                                    "columns": [
                                        {
                                            "title": "BB_REPORTS_CAPACITY.COLUMNS.AVAILABLE_HOURS",
                                            "tooltip": "BB_REPORTS_CAPACITY.TOOLTIPS.AVAILABLE_HOURS",
                                            "source": "capacity",
                                            "key": "capacity",
                                            "calculateAvg": false,
                                            "query": [
                                            ],
                                            "aggregation": {
                                                "sum": {
                                                    "field": "capacity"
                                                }
                                            }
                                        },
                                        {
                                            "title": "BB_REPORTS_CAPACITY.COLUMNS.BOOKED_HOURS",
                                            "tooltip": "BB_REPORTS_CAPACITY.TOOLTIPS.BLOCKED_HOURS",
                                            "source": "capacity",
                                            "key": "booked",
                                            "calculateAvg": false,
                                            "query": [
                                            ],
                                            "aggregation": {
                                                "sum": {
                                                    "field": "booked_time"
                                                }
                                            },
                                            "format": "hours"
                                        },
                                        {
                                            "title": "BB_REPORTS_CAPACITY.COLUMNS.BLOCKED_HOURS",
                                            "tooltip": "Total number of hours staff had blocked out in their calendars.",
                                            "source": "capacity",
                                            "key": "blocked",
                                            "calculateAvg": false,
                                            "query": [
                                            ],
                                            "aggregation": {
                                                "sum": {
                                                    "field": "blocked_time"
                                                }
                                            },
                                            "format": "hours"
                                        },
                                        {
                                            "title": "BB_REPORTS_CAPACITY.COLUMNS.FREE_HOURS",
                                            "tooltip": "Hours left after booked and blocked time have been subtracted from total available time.",
                                            "source": "capacity",
                                            "key": "free",
                                            "calculateAvg": false,
                                            "query": [
                                            ],
                                            "aggregation": {
                                                "sum": {
                                                    "field": "free_time"
                                                }
                                            }
                                        },
                                        {
                                            "title": "BB_REPORTS_CAPACITY.COLUMNS.AVG_AVAILABLE_HOURS",
                                            "tooltip": "Average number of available hours per staff member per day.",
                                            "source": "capacity",
                                            "key": "avg_capacity",
                                            "calculateAvg": true,
                                            "exclude": {
                                                "term": {
                                                    "capacity": 0
                                                }
                                            },
                                            "query": [
                                            ],
                                            "aggregation": {
                                                "avg": {
                                                    "field": "capacity"
                                                }
                                            },
                                            "format": "hours"
                                        },
                                        {
                                            "title": "BB_REPORTS_CAPACITY.COLUMNS.AVG_BOOKED_HOURS",
                                            "tooltip": "Average number of booked hours per staff member per day. Does not include blocked time.",
                                            "source": "capacity",
                                            "key": "avg_booked",
                                            "calculateAvg": true,
                                            "exclude": {
                                                "term": {
                                                    "capacity": 0
                                                }
                                            },
                                            "query": [
                                            ],
                                            "aggregation": {
                                                "avg": {
                                                    "field": "booked_time"
                                                }
                                            },
                                            "format": "hours"
                                        },
                                        {
                                            "title": "BB_REPORTS_CAPACITY.COLUMNS.PERCENT_BUSY",
                                            "tooltip": "Total booked hours % from total available hours. Does not include blocked time.",
                                            "source": "capacity",
                                            "key": "avg_busy_bucket_script",
                                            "query": [
                                            ],
                                            "aggregation": {
                                                "total_booked_time": {
                                                    "sum": {
                                                        "field": "booked_time"
                                                    }
                                                },
                                                "total_capacity_time": {
                                                    "sum": {
                                                        "field": "capacity"
                                                    }
                                                },
                                                "data": {
                                                    "bucket_script": {
                                                        "buckets_path": {
                                                            "total_booked": "total_booked_time",
                                                            "total_capacity": "total_capacity_time"
                                                        },
                                                        "script": "(params.total_booked / params.total_capacity)*100"
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        ]
                    ]
                },
                "values": "*bbc"
            },
            "report_lead_times": {
                "default": {
                    "style": "capacity",
                    "layout": [
                        [
                            {
                                "type": "bb-lead-times-report",
                                "width": 12,
                                "index": 0,
                                "panel_params": {
                                    "title": "BB_REPORTS_LEAD_TIMES.TITLE",
                                    "description": "BB_REPORTS_LEAD_TIMES.DESCRIPTION",
                                    "showDatePicker": false,
                                    "type": "lead_times",
                                    "query": [
                                    ],
                                    "rag": {
                                        "red": 30,
                                        "amber": 7
                                    }
                                }
                            }
                        ]
                    ]
                },
                "values": "*bbc"
            },
            "map": {
                "default": {
                    "style": "boxes",
                    "layout": [
                        [
                            {
                                "type": "bb-map-report-panel",
                                "width": 12,
                                "index": 0,
                                "panel_params": {
                                    "start_date": "now-6M",
                                    "ttl": 200,
                                    "presentation_type": "beacon",
                                    "time_step": 1,
                                    "refetch": 600,
                                    "sub_second": 1,
                                    "center": {
                                        "lat": 54,
                                        "lng": -4.5,
                                        "zoom": 6
                                    }
                                }
                            }
                        ]
                    ]
                },
                "values": "*bbc"
            },
            "report_sales": {
                "default": {},
                "values": "*bbc"
            },
            "custom_report1": {
                "default": {},
                "values": "*bbc"
            },
            "custom_report2": {
                "default": {},
                "values": "*bbc"
            },
            "custom_report3": {
                "default": {},
                "values": "*bbc"
            },
            "custom_report4": {
                "default": {},
                "values": "*bbc"
            },
            "custom_report5": {
                "default": {},
                "values": "*bbc"
            }
        }
    }
}
