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

    joins:
      - name: category
        sql: "{CUBE}.`categoryId` = {category.id}"
        relationship: many_to_one

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

      - name: description
        sql: description
        type: string

      - name: image
        sql: image
        type: string

      - name: name
        sql: name
        type: string

      - name: namecn
        sql: "{CUBE}.`nameCn`"
        type: string

      - name: shortdescription
        sql: "{CUBE}.`shortDescription`"
        type: string

      - name: siteskus
        sql: "{CUBE}.`siteSkus`"
        type: string

      - name: sku
        sql: sku
        type: string

      - name: type
        sql: type
        type: string

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

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

    measures:
      - name: count
        type: count

      - name: price
        sql: price
        type: sum

      - name: promotionprice
        sql: "{CUBE}.`promotionPrice`"
        type: sum

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

