---
# System prepended metadata

title: Documentation - Dashboard

---

# Documentation - Dashboard

This dashboard is a visual to display Shipping Provider data.

## Files

| Name   | Details                     |
|--------|-----------------------------|
| Repo   | tms                         |
| Branch | feature/analytics-big-query |

## Prerequisites
1. tms repository
2. GCP access

## How-to
1. Open [BigQuery](https://console.cloud.google.com/bigquery)
2. Create [materialized views](https://cloud.google.com/bigquery/docs/materialized-views-create)
3. Add query of your materialized views on src\models\order-bigquery.model.ts
4. Add new interaface on tms\src\definitions\order.ts
5. Use the services on tms\src\v1\services\analytic.service.ts

## Examples
| Name               | Details                                                                                                                                                                                                                                                                                                          |
|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Materialized Views | CREATE MATERIALIZED VIEW `hzn-one.tms_analytics.mv_service_provider_annual_revenue` AS (SELECT service_provder_id, EXTRACT(YEAR FROM DATE(created_at)) as year, SUM(grand_total_service_provider) as revenue FROM `hzn-one.tms_analytics.orders` WHERE status = "COMPLETED" GROUP BY service_provider_id, YEAR); |
| models             | # see tms\src\models\order-bigquery.model.ts line 197-215                                                                                                                                                                                                                                                        |
| definitions        | # see tms\src\definitions\order.ts line 169-173 and 182                                                                                                                                                                                                                                                          |
| services           | # see tms\src\v1\services\analytic.service.ts line 11-45                                                                                                                                                                                                                                                         |
