cubes:
  - name: stock_point_areas_area
    sql_table: inventory_v2.stock_point_areas_area
    data_source: default

    joins:
      - name: area
        sql: "{CUBE}.areaId = {area.id}"
        relationship: many_to_one

      - name: site_stock_points_stock_point
        sql: "{CUBE}.stockPointId = {site_stock_points_stock_point}.stockPointId"
        relationship: many_to_one

      - name: site_v2_stock_points_stock_point
        sql: "{CUBE}.stockPointId = {site_v2_stock_points_stock_point}.stockPointId"
        relationship: many_to_one

      - name: stock_point
        sql: "{CUBE}.stockPointId = {stock_point.id}"
        relationship: many_to_one

    dimensions:
      - name: areaId
        sql: areaId
        type: number
        primary_key: true

    measures:
      - name: count
        type: count

    pre_aggregations:
      # Pre-aggregation definitions go here.
      # Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started

