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

    joins:
      - 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: id
        sql: id
        type: number
        primary_key: true

      - name: address
        sql: address
        type: string

      - name: name
        sql: name
        type: string

      - name: phone_number
        sql: phone_number
        type: string

      - name: phone_number_country
        sql: phone_number_country
        type: string

      - name: phone_number_extension
        sql: phone_number_extension
        type: string

      - name: createdat
        sql: "{CUBE}.`createdAt`"
        type: time

      - name: updatedat
        sql: "{CUBE}.`updatedAt`"
        type: time

    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

