chore: 更新和添加.gitignore文件
添加container目录下的.gitignore文件 更新根目录.gitignore文件,忽略日志文件和部署目录
This commit is contained in:
parent
f7c3037c18
commit
8dc85e4e4e
|
|
@ -1 +1,5 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
deploy
|
||||||
|
.DS_Store
|
||||||
|
**/*.log
|
||||||
|
.DS_Store
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
mysql
|
||||||
|
nginx
|
||||||
|
cube/conf/.cubestore
|
||||||
|
!docker-compose.yml
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
module.exports = {
|
||||||
|
dbType: 'mysql',
|
||||||
|
apiSecret: 'your-secret-here',
|
||||||
|
webSockets: true
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
cubes:
|
||||||
|
- name: area
|
||||||
|
sql_table: inventory_v2.area
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: code
|
||||||
|
sql: code
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
cubes:
|
||||||
|
- name: auth_code
|
||||||
|
sql_table: inventory_v2.auth_code
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: code
|
||||||
|
sql: code
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: device_id
|
||||||
|
sql: device_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: expires_at
|
||||||
|
sql: expires_at
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
cubes:
|
||||||
|
- name: category
|
||||||
|
sql_table: inventory_v2.category
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: shortname
|
||||||
|
sql: "{CUBE}.`shortName`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: title
|
||||||
|
sql: title
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: titlecn
|
||||||
|
sql: "{CUBE}.`titleCN`"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
cubes:
|
||||||
|
- name: category_attribute
|
||||||
|
sql_table: inventory_v2.category_attribute
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: category
|
||||||
|
sql: "{CUBE}.category_id = {category.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
cubes:
|
||||||
|
- name: category_v2
|
||||||
|
sql_table: inventory_v2.category_v2
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: title
|
||||||
|
sql: title
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: titlecn
|
||||||
|
sql: "{CUBE}.`titleCN`"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
cubes:
|
||||||
|
- name: customer
|
||||||
|
sql_table: inventory_v2.customer
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.site_id = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
- name: customer_state
|
||||||
|
sql: "JSON_EXTRACT({customer.shipping}, '$.state')"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: avatar
|
||||||
|
sql: avatar
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: billing
|
||||||
|
sql: billing
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: email
|
||||||
|
sql: email
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: first_name
|
||||||
|
sql: first_name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: fullname
|
||||||
|
sql: fullname
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: last_name
|
||||||
|
sql: last_name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: origin_id
|
||||||
|
sql: origin_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: phone
|
||||||
|
sql: phone
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: raw
|
||||||
|
sql: raw
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: shipping
|
||||||
|
sql: shipping
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: username
|
||||||
|
sql: username
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: created_at
|
||||||
|
sql: created_at
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: site_created_at
|
||||||
|
sql: site_created_at
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: site_updated_at
|
||||||
|
sql: site_updated_at
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updated_at
|
||||||
|
sql: updated_at
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
cubes:
|
||||||
|
- name: customer_tag
|
||||||
|
sql_table: inventory_v2.customer_tag
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: email
|
||||||
|
sql: email
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tag
|
||||||
|
sql: tag
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
cubes:
|
||||||
|
- name: device_whitelist
|
||||||
|
sql_table: inventory_v2.device_whitelist
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: device_id
|
||||||
|
sql: device_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: created_at
|
||||||
|
sql: created_at
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
cubes:
|
||||||
|
- name: dict
|
||||||
|
sql_table: inventory_v2.dict
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: title
|
||||||
|
sql: title
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
cubes:
|
||||||
|
- name: dict_item
|
||||||
|
sql_table: inventory_v2.dict_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: dict
|
||||||
|
sql: "{CUBE}.dict_id = {dict.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: shortname
|
||||||
|
sql: "{CUBE}.`shortName`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: title
|
||||||
|
sql: title
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: titlecn
|
||||||
|
sql: "{CUBE}.`titleCN`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: value
|
||||||
|
sql: value
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,160 @@
|
||||||
|
cubes:
|
||||||
|
- name: order
|
||||||
|
sql_table: inventory_v2.order
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: customer
|
||||||
|
sql: "{CUBE}.customer_id = {customer.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: shipment
|
||||||
|
sql: "{CUBE}.shipment_id = {shipment.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: billing
|
||||||
|
sql: billing
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: cart_hash
|
||||||
|
sql: cart_hash
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: created_via
|
||||||
|
sql: created_via
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: currency
|
||||||
|
sql: currency
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: currency_symbol
|
||||||
|
sql: currency_symbol
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: customer_email
|
||||||
|
sql: customer_email
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: customer_ip_address
|
||||||
|
sql: customer_ip_address
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: customer_note
|
||||||
|
sql: customer_note
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: customer_user_agent
|
||||||
|
sql: customer_user_agent
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: device_type
|
||||||
|
sql: device_type
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalorderid
|
||||||
|
sql: "{CUBE}.`externalOrderId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: meta_data
|
||||||
|
sql: meta_data
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: number
|
||||||
|
sql: number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: order_key
|
||||||
|
sql: order_key
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: orderstatus
|
||||||
|
sql: "{CUBE}.`orderStatus`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: payment_method
|
||||||
|
sql: payment_method
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: payment_method_title
|
||||||
|
sql: payment_method_title
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: payment_url
|
||||||
|
sql: payment_url
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: shipping
|
||||||
|
sql: shipping
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: source_type
|
||||||
|
sql: source_type
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: status
|
||||||
|
sql: status
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: transaction_id
|
||||||
|
sql: transaction_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: utm_source
|
||||||
|
sql: utm_source
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: date_created
|
||||||
|
sql: date_created
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: date_completed
|
||||||
|
sql: date_completed
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: date_modified
|
||||||
|
sql: date_modified
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: date_paid
|
||||||
|
sql: date_paid
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: discount_total
|
||||||
|
sql: discount_total
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
- name: shipping_total
|
||||||
|
sql: shipping_total
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
- name: total
|
||||||
|
sql: total
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_coupon
|
||||||
|
sql_table: inventory_v2.order_coupon
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.`orderId` = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: code
|
||||||
|
sql: code
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: discount
|
||||||
|
sql: discount
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: discount_tax
|
||||||
|
sql: discount_tax
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: discount_type
|
||||||
|
sql: discount_type
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalordercouponid
|
||||||
|
sql: "{CUBE}.`externalOrderCouponId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalorderid
|
||||||
|
sql: "{CUBE}.`externalOrderId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: nominal_amount
|
||||||
|
sql: nominal_amount
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_fee
|
||||||
|
sql_table: inventory_v2.order_fee
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.`orderId` = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: amount
|
||||||
|
sql: amount
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalorderfeeid
|
||||||
|
sql: "{CUBE}.`externalOrderFeeId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalorderid
|
||||||
|
sql: "{CUBE}.`externalOrderId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tax_class
|
||||||
|
sql: tax_class
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tax_status
|
||||||
|
sql: tax_status
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: total
|
||||||
|
sql: total
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_fulfillment
|
||||||
|
sql_table: inventory_v2.order_fulfillment
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.order_id = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.site_id = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: external_fulfillment_id
|
||||||
|
sql: external_fulfillment_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: external_order_id
|
||||||
|
sql: external_order_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: items
|
||||||
|
sql: items
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: shipping_method
|
||||||
|
sql: shipping_method
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: shipping_provider
|
||||||
|
sql: shipping_provider
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: status
|
||||||
|
sql: status
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_number
|
||||||
|
sql: tracking_number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: created_at
|
||||||
|
sql: created_at
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: date_created
|
||||||
|
sql: date_created
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updated_at
|
||||||
|
sql: updated_at
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_item
|
||||||
|
sql_table: inventory_v2.order_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.`orderId` = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: bundled_by
|
||||||
|
sql: bundled_by
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: bundled_item_title
|
||||||
|
sql: bundled_item_title
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: bundled_items
|
||||||
|
sql: bundled_items
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalorderid
|
||||||
|
sql: "{CUBE}.`externalOrderId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalorderitemid
|
||||||
|
sql: "{CUBE}.`externalOrderItemId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalproductid
|
||||||
|
sql: "{CUBE}.`externalProductId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalvariationid
|
||||||
|
sql: "{CUBE}.`externalVariationId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: global_unique_id
|
||||||
|
sql: global_unique_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: image
|
||||||
|
sql: image
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: meta_data
|
||||||
|
sql: meta_data
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: parent_name
|
||||||
|
sql: parent_name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tax_class
|
||||||
|
sql: tax_class
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: taxes
|
||||||
|
sql: taxes
|
||||||
|
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: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
- name: subtotal
|
||||||
|
sql: subtotal
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
- name: total
|
||||||
|
sql: total
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_item_original
|
||||||
|
sql_table: inventory_v2.order_item_original
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.order_id = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: product
|
||||||
|
sql: "{CUBE}.`productId` = {product.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: externalorderitemid
|
||||||
|
sql: "{CUBE}.`externalOrderItemId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_note
|
||||||
|
sql_table: inventory_v2.order_note
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.`orderId` = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: user
|
||||||
|
sql: "{CUBE}.`userId` = {user.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: content
|
||||||
|
sql: content
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_refund
|
||||||
|
sql_table: inventory_v2.order_refund
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.`orderId` = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: externalorderid
|
||||||
|
sql: "{CUBE}.`externalOrderId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalrefundid
|
||||||
|
sql: "{CUBE}.`externalRefundId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: meta_data
|
||||||
|
sql: meta_data
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: reason
|
||||||
|
sql: reason
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: date_created
|
||||||
|
sql: date_created
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: amount
|
||||||
|
sql: amount
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_refund_item
|
||||||
|
sql_table: inventory_v2.order_refund_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: externalproductid
|
||||||
|
sql: "{CUBE}.`externalProductId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalrefundid
|
||||||
|
sql: "{CUBE}.`externalRefundId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalrefunditemid
|
||||||
|
sql: "{CUBE}.`externalRefundItemId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalvariationid
|
||||||
|
sql: "{CUBE}.`externalVariationId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tax_class
|
||||||
|
sql: tax_class
|
||||||
|
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: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
- name: subtotal
|
||||||
|
sql: subtotal
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
- name: total
|
||||||
|
sql: total
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_sale
|
||||||
|
sql_table: inventory_v2.order_sale
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.`orderId` = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: product
|
||||||
|
sql: "{CUBE}.`productId` = {product.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: brand
|
||||||
|
sql: brand
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: category
|
||||||
|
sql: category
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalorderitemid
|
||||||
|
sql: "{CUBE}.`externalOrderItemId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: flavor
|
||||||
|
sql: flavor
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: humidity
|
||||||
|
sql: humidity
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: size
|
||||||
|
sql: size
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: strength
|
||||||
|
sql: strength
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: version
|
||||||
|
sql: version
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_sale_original
|
||||||
|
sql_table: inventory_v2.order_sale_original
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.order_id = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: product
|
||||||
|
sql: "{CUBE}.`productId` = {product.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE.siteid} = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: externalorderitemid
|
||||||
|
sql: "{CUBE}.`externalOrderItemId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: siteid
|
||||||
|
sql: "{CUBE}.`siteId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_shipment
|
||||||
|
sql_table: inventory_v2.order_shipment
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.order_id = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: shipment
|
||||||
|
sql: "{CUBE}.shipment_id = {shipment.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: id
|
||||||
|
sql: id
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_shipping
|
||||||
|
sql_table: inventory_v2.order_shipping
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.`orderId` = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: externalorderid
|
||||||
|
sql: "{CUBE}.`externalOrderId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalordershippingid
|
||||||
|
sql: "{CUBE}.`externalOrderShippingId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: instance_id
|
||||||
|
sql: instance_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: method_id
|
||||||
|
sql: method_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: method_title
|
||||||
|
sql: method_title
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: total
|
||||||
|
sql: total
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_tracking
|
||||||
|
sql_table: inventory_v2.order_tracking
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE.orderid} = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: shipment
|
||||||
|
sql: "{CUBE.shipment_id} = {shipment.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE.siteid} = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: custom_tracking_provider
|
||||||
|
sql: custom_tracking_provider
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalorderid
|
||||||
|
sql: "{CUBE}.`externalOrderId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: orderid
|
||||||
|
sql: "{CUBE}.`orderId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: shipment_id
|
||||||
|
sql: shipment_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: siteid
|
||||||
|
sql: "{CUBE}.`siteId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: status_shipped
|
||||||
|
sql: status_shipped
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_id
|
||||||
|
sql: tracking_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_link
|
||||||
|
sql: tracking_link
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_number
|
||||||
|
sql: tracking_number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_product_code
|
||||||
|
sql: tracking_product_code
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_provider
|
||||||
|
sql: tracking_provider
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: date_shipped
|
||||||
|
sql: date_shipped
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
cubes:
|
||||||
|
- name: order_tracking_product
|
||||||
|
sql_table: inventory_v2.order_tracking_product
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order_tracking
|
||||||
|
sql: "{CUBE}.`orderTrackingId` = {order_tracking.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: product
|
||||||
|
sql: "{CUBE}.`productId` = {product.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: nume
|
||||||
|
sql: nume
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
cubes:
|
||||||
|
- name: product_attributes_dict_item
|
||||||
|
sql_table: inventory_v2.product_attributes_dict_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: dict_item
|
||||||
|
sql: "{CUBE}.dictItemId = {dict_item.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: product
|
||||||
|
sql: "{CUBE}.productId = {product.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: dictItemId
|
||||||
|
sql: dictItemId
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
cubes:
|
||||||
|
- name: product_site_sku
|
||||||
|
sql_table: inventory_v2.product_site_sku
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: product
|
||||||
|
sql: "{CUBE}.`productId` = {product.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: sitesku
|
||||||
|
sql: "{CUBE}.`siteSku`"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
cubes:
|
||||||
|
- name: product_stock_component
|
||||||
|
sql_table: inventory_v2.product_stock_component
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: product
|
||||||
|
sql: "{CUBE}.`productId` = {product.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
cubes:
|
||||||
|
- name: product_v2
|
||||||
|
sql_table: inventory_v2.product_v2
|
||||||
|
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: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: namecn
|
||||||
|
sql: "{CUBE}.`nameCn`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: shortdescription
|
||||||
|
sql: "{CUBE}.`shortDescription`"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
cubes:
|
||||||
|
- name: product_v2_attributes_dict_item
|
||||||
|
sql_table: inventory_v2.product_v2_attributes_dict_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: dict_item
|
||||||
|
sql: "{CUBE}.dictItemId = {dict_item.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: product_v2
|
||||||
|
sql: "{CUBE}.productV2Id = {product_v2.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: dictItemId
|
||||||
|
sql: dictItemId
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
cubes:
|
||||||
|
- name: purchase_order
|
||||||
|
sql_table: inventory_v2.purchase_order
|
||||||
|
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: note
|
||||||
|
sql: note
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: ordernumber
|
||||||
|
sql: "{CUBE}.`orderNumber`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: status
|
||||||
|
sql: status
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: expectedarrivaltime
|
||||||
|
sql: "{CUBE}.`expectedArrivalTime`"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
cubes:
|
||||||
|
- name: purchase_order_item
|
||||||
|
sql_table: inventory_v2.purchase_order_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: purchase_order
|
||||||
|
sql: "{CUBE}.`purchaseOrderId` = {purchase_order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: price
|
||||||
|
sql: price
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
cubes:
|
||||||
|
- name: service
|
||||||
|
sql_table: inventory_v2.service
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: string
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: carrier_name
|
||||||
|
sql: carrier_name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: service_name
|
||||||
|
sql: service_name
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
cubes:
|
||||||
|
- name: shipment
|
||||||
|
sql_table: inventory_v2.shipment
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.order_id = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: stock_point
|
||||||
|
sql: "{CUBE}.stock_point_id = {stock_point.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: bol_number
|
||||||
|
sql: bol_number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: customs_invoice_url
|
||||||
|
sql: customs_invoice_url
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: labels
|
||||||
|
sql: labels
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: pickup_confirmation_number
|
||||||
|
sql: pickup_confirmation_number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: primary_tracking_number
|
||||||
|
sql: primary_tracking_number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: rate
|
||||||
|
sql: rate
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: return_tracking_number
|
||||||
|
sql: return_tracking_number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: state
|
||||||
|
sql: state
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_id
|
||||||
|
sql: tracking_id
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_numbers
|
||||||
|
sql: tracking_numbers
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_provider
|
||||||
|
sql: tracking_provider
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: tracking_url
|
||||||
|
sql: tracking_url
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: transaction_number
|
||||||
|
sql: transaction_number
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: type
|
||||||
|
sql: type
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: unique_id
|
||||||
|
sql: unique_id
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
cubes:
|
||||||
|
- name: shipment_item
|
||||||
|
sql_table: inventory_v2.shipment_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.order_id = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: shipment
|
||||||
|
sql: "{CUBE}.shipment_id = {shipment.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
cubes:
|
||||||
|
- name: shipping_item
|
||||||
|
sql_table: inventory_v2.shipping_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: order
|
||||||
|
sql: "{CUBE}.`orderId` = {order.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: product
|
||||||
|
sql: "{CUBE}.`productId` = {product.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
cubes:
|
||||||
|
- name: site
|
||||||
|
sql_table: inventory_v2.site
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: apiurl
|
||||||
|
sql: "{CUBE}.`apiUrl`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: consumerkey
|
||||||
|
sql: "{CUBE}.`consumerKey`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: consumersecret
|
||||||
|
sql: "{CUBE}.`consumerSecret`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: description
|
||||||
|
sql: description
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: skuprefix
|
||||||
|
sql: "{CUBE}.`skuPrefix`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: token
|
||||||
|
sql: token
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: type
|
||||||
|
sql: type
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: webhook_url
|
||||||
|
sql: webhook_url
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: website_url
|
||||||
|
sql: website_url
|
||||||
|
type: string
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
cubes:
|
||||||
|
- name: site_areas_area
|
||||||
|
sql_table: inventory_v2.site_areas_area
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: area
|
||||||
|
sql: "{CUBE}.areaId = {area.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.siteId = {site.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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
cubes:
|
||||||
|
- name: site_stock_points_stock_point
|
||||||
|
sql_table: inventory_v2.site_stock_points_stock_point
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.siteId = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: stock_point
|
||||||
|
sql: "{CUBE}.stockPointId = {stock_point.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: stockPointId
|
||||||
|
sql: stockPointId
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
cubes:
|
||||||
|
- name: site_v2
|
||||||
|
sql_table: inventory_v2.site_v2
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: apiurl
|
||||||
|
sql: "{CUBE}.`apiUrl`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: consumerkey
|
||||||
|
sql: "{CUBE}.`consumerKey`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: consumersecret
|
||||||
|
sql: "{CUBE}.`consumerSecret`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: description
|
||||||
|
sql: description
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: skuprefix
|
||||||
|
sql: "{CUBE}.`skuPrefix`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: token
|
||||||
|
sql: token
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: type
|
||||||
|
sql: type
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: website_url
|
||||||
|
sql: website_url
|
||||||
|
type: string
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
cubes:
|
||||||
|
- name: site_v2_areas_area
|
||||||
|
sql_table: inventory_v2.site_v2_areas_area
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: area
|
||||||
|
sql: "{CUBE}.areaId = {area.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site_v2
|
||||||
|
sql: "{CUBE}.siteV2Id = {site_v2.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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
cubes:
|
||||||
|
- name: site_v2_stock_points_stock_point
|
||||||
|
sql_table: inventory_v2.site_v2_stock_points_stock_point
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: site_v2
|
||||||
|
sql: "{CUBE}.siteV2Id = {site_v2.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: stock_point
|
||||||
|
sql: "{CUBE}.stockPointId = {stock_point.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: stockPointId
|
||||||
|
sql: stockPointId
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
cubes:
|
||||||
|
- name: stock
|
||||||
|
sql_table: inventory_v2.stock
|
||||||
|
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: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
cubes:
|
||||||
|
- name: stock_point
|
||||||
|
sql_table: inventory_v2.stock_point
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: contactperson
|
||||||
|
sql: "{CUBE}.`contactPerson`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: contactphone
|
||||||
|
sql: "{CUBE}.`contactPhone`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: location
|
||||||
|
sql: location
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: upstreamname
|
||||||
|
sql: "{CUBE}.`upStreamName`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: deletedat
|
||||||
|
sql: "{CUBE}.`deletedAt`"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
cubes:
|
||||||
|
- name: stock_record
|
||||||
|
sql_table: inventory_v2.stock_record
|
||||||
|
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: note
|
||||||
|
sql: note
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: operationtype
|
||||||
|
sql: "{CUBE}.`operationType`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
cubes:
|
||||||
|
- name: subscription
|
||||||
|
sql_table: inventory_v2.subscription
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: customer
|
||||||
|
sql: "{CUBE}.customer_id = {customer.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
- name: site
|
||||||
|
sql: "{CUBE}.`siteId` = {site.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: billing_period
|
||||||
|
sql: billing_period
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: currency
|
||||||
|
sql: currency
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: customer_email
|
||||||
|
sql: customer_email
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: externalsubscriptionid
|
||||||
|
sql: "{CUBE}.`externalSubscriptionId`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: line_items
|
||||||
|
sql: line_items
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: meta_data
|
||||||
|
sql: meta_data
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: status
|
||||||
|
sql: status
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: end_date
|
||||||
|
sql: end_date
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: next_payment_date
|
||||||
|
sql: next_payment_date
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: start_date
|
||||||
|
sql: start_date
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: trial_end
|
||||||
|
sql: trial_end
|
||||||
|
type: time
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: total
|
||||||
|
sql: total
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
cubes:
|
||||||
|
- name: template
|
||||||
|
sql_table: inventory_v2.template
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: description
|
||||||
|
sql: description
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: testdata
|
||||||
|
sql: "{CUBE}.`testData`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: value
|
||||||
|
sql: value
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
cubes:
|
||||||
|
- name: transfer
|
||||||
|
sql_table: inventory_v2.transfer
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: note
|
||||||
|
sql: note
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: ordernumber
|
||||||
|
sql: "{CUBE}.`orderNumber`"
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: createdat
|
||||||
|
sql: "{CUBE}.`createdAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: updatedat
|
||||||
|
sql: "{CUBE}.`updatedAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: arriveat
|
||||||
|
sql: "{CUBE}.`arriveAt`"
|
||||||
|
type: time
|
||||||
|
|
||||||
|
- name: sendat
|
||||||
|
sql: "{CUBE}.`sendAt`"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
cubes:
|
||||||
|
- name: transfer_item
|
||||||
|
sql_table: inventory_v2.transfer_item
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins:
|
||||||
|
- name: transfer
|
||||||
|
sql: "{CUBE}.`transferId` = {transfer.id}"
|
||||||
|
relationship: many_to_one
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
sql: name
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: sku
|
||||||
|
sql: sku
|
||||||
|
type: string
|
||||||
|
|
||||||
|
measures:
|
||||||
|
- name: count
|
||||||
|
type: count
|
||||||
|
|
||||||
|
- name: quantity
|
||||||
|
sql: quantity
|
||||||
|
type: sum
|
||||||
|
|
||||||
|
pre_aggregations:
|
||||||
|
# Pre-aggregation definitions go here.
|
||||||
|
# Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
|
||||||
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
cubes:
|
||||||
|
- name: user
|
||||||
|
sql_table: inventory_v2.user
|
||||||
|
data_source: default
|
||||||
|
|
||||||
|
joins: []
|
||||||
|
|
||||||
|
dimensions:
|
||||||
|
- name: id
|
||||||
|
sql: id
|
||||||
|
type: number
|
||||||
|
primary_key: true
|
||||||
|
|
||||||
|
- name: email
|
||||||
|
sql: email
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: password
|
||||||
|
sql: password
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: permissions
|
||||||
|
sql: permissions
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: remark
|
||||||
|
sql: remark
|
||||||
|
type: string
|
||||||
|
|
||||||
|
- name: username
|
||||||
|
sql: username
|
||||||
|
type: string
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
# In Cube, views are used to expose slices of your data graph and act as data marts.
|
||||||
|
# You can control which measures and dimensions are exposed to BIs or data apps,
|
||||||
|
# as well as the direction of joins between the exposed cubes.
|
||||||
|
# You can learn more about views in documentation here - https://cube.dev/docs/schema/reference/view
|
||||||
|
|
||||||
|
|
||||||
|
# The following example shows a view defined on top of orders and customers cubes.
|
||||||
|
# Both orders and customers cubes are exposed using the "includes" parameter to
|
||||||
|
# control which measures and dimensions are exposed.
|
||||||
|
# Prefixes can also be applied when exposing measures or dimensions.
|
||||||
|
# In this case, the customers' city dimension is prefixed with the cube name,
|
||||||
|
# resulting in "customers_city" when querying the view.
|
||||||
|
|
||||||
|
# views:
|
||||||
|
# - name: example_view
|
||||||
|
#
|
||||||
|
# cubes:
|
||||||
|
# - join_path: orders
|
||||||
|
# includes:
|
||||||
|
# - status
|
||||||
|
# - created_date
|
||||||
|
#
|
||||||
|
# - total_amount
|
||||||
|
# - count
|
||||||
|
#
|
||||||
|
# - join_path: orders.customers
|
||||||
|
# prefix: true
|
||||||
|
# includes:
|
||||||
|
# - city
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"measures": [
|
||||||
|
"customer.count"
|
||||||
|
],
|
||||||
|
"dimensions": [
|
||||||
|
"customer.customer_state"
|
||||||
|
],
|
||||||
|
"filters": [],
|
||||||
|
"timeDimensions": [],
|
||||||
|
"order": [
|
||||||
|
{
|
||||||
|
"id": "customer.count",
|
||||||
|
"desc": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"limit": 100
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
# MySQL 服务(可选,如果需要可以取消注释)
|
||||||
|
# mysql:
|
||||||
|
# image: mysql:8.0
|
||||||
|
# container_name: mysql-container
|
||||||
|
# restart: on-failure
|
||||||
|
# environment:
|
||||||
|
# MYSQL_ROOT_PASSWORD: root
|
||||||
|
# MYSQL_DATABASE: mydb
|
||||||
|
# ports:
|
||||||
|
# - "3306:3306"
|
||||||
|
# volumes:
|
||||||
|
# - mysql-data:/var/lib/mysql
|
||||||
|
# networks:
|
||||||
|
# - app-network
|
||||||
|
|
||||||
|
# API 服务
|
||||||
|
api:
|
||||||
|
build:
|
||||||
|
context: ../../API
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: api-container
|
||||||
|
restart: on-failure
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=prod
|
||||||
|
# 数据库连接信息(连接到外部 MySQL 容器)
|
||||||
|
- MYSQL_HOST=host.docker.internal
|
||||||
|
- MYSQL_PORT=23306
|
||||||
|
- MYSQL_USERNAME=root
|
||||||
|
- MYSQL_PASSWORD=root
|
||||||
|
- MYSQL_DATABASE=inventory
|
||||||
|
ports:
|
||||||
|
- "7001:7001"
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
|
||||||
|
# WEB 服务
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../../WEB
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: web-container
|
||||||
|
restart: on-failure
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=prod
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
depends_on:
|
||||||
|
- api
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
|
||||||
|
# volumes:
|
||||||
|
# mysql-data:
|
||||||
|
# driver: local
|
||||||
|
|
||||||
|
networks:
|
||||||
|
app-network:
|
||||||
|
driver: bridge
|
||||||
|
|
@ -7,12 +7,12 @@ services:
|
||||||
# container_name: mysql-container
|
# container_name: mysql-container
|
||||||
# restart: on-failure
|
# restart: on-failure
|
||||||
# environment:
|
# environment:
|
||||||
# MYSQL_ROOT_PASSWORD: root
|
# MYSQL_ROOT_PASSWORD: 12345678
|
||||||
# MYSQL_DATABASE: mydb
|
# MYSQL_DATABASE: inventory_v2
|
||||||
# ports:
|
# ports:
|
||||||
# - "3306:3306"
|
# - "23306:3306"
|
||||||
# volumes:
|
# volumes:
|
||||||
# - mysql-data:/var/lib/mysql
|
# - ./mysql/data:/var/lib/mysql
|
||||||
# networks:
|
# networks:
|
||||||
# - app-network
|
# - app-network
|
||||||
|
|
||||||
|
|
@ -35,6 +35,32 @@ services:
|
||||||
command: sh -c "npm run dev"
|
command: sh -c "npm run dev"
|
||||||
ports:
|
ports:
|
||||||
- "7001:7001"
|
- "7001:7001"
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
|
||||||
|
# Cube 服务
|
||||||
|
cube:
|
||||||
|
image: cubejs/cube:latest
|
||||||
|
ports:
|
||||||
|
- 4000:4000
|
||||||
|
environment:
|
||||||
|
- CUBEJS_DEV_MODE=true
|
||||||
|
- CUBEJS_DB_TYPE=mysql
|
||||||
|
- CUBEJS_DB_HOST=host.docker.internal
|
||||||
|
- CUBEJS_DB_PORT=23306
|
||||||
|
- CUBEJS_DB_USER=cubejs
|
||||||
|
- CUBEJS_DB_PASS=12345678
|
||||||
|
- CUBEJS_DB_NAME=inventory_v2
|
||||||
|
- CUBEJS_DB_SSL=false
|
||||||
|
- CUBEJS_API_SECRET=your-secret-here
|
||||||
|
- CUBEJS_WEB_SOCKETS=true
|
||||||
|
# - CUBEJS_REFRESH_SCHEMA=true
|
||||||
|
volumes:
|
||||||
|
- ./cube/conf:/cube/conf
|
||||||
|
|
||||||
|
# networks:
|
||||||
|
# - app-network
|
||||||
|
# network_mode: host
|
||||||
|
|
||||||
# WEB 服务
|
# WEB 服务
|
||||||
web:
|
web:
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
|
|
||||||
## 【使用流程】
|
## 【使用流程】
|
||||||
|
|
||||||
### 方案一:忽略SSL验证(仅开发环境)
|
### 方案一:忽略SSL验证(仅开发环境)
|
||||||
|
|
||||||
#### 1. 修改axios配置
|
#### 1. 修改axios配置
|
||||||
|
|
||||||
在`src/service/wp.service.ts`中的`fetchPagedData`方法添加SSL配置:
|
在`src/service/wp.service.ts`中的`fetchPagedData`方法添加SSL配置:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// 在fetchPagedData方法中修改config配置
|
// 在fetchPagedData方法中修改config配置
|
||||||
|
|
@ -46,7 +46,7 @@ const config: AxiosRequestConfig = {
|
||||||
|
|
||||||
#### 2. 全局axios配置
|
#### 2. 全局axios配置
|
||||||
|
|
||||||
在项目入口文件中添加全局配置:
|
在项目入口文件中添加全局配置:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// 在src/configuration.ts或app.ts中添加
|
// 在src/configuration.ts或app.ts中添加
|
||||||
|
|
@ -61,11 +61,11 @@ if (process.env.NODE_ENV === 'development') {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 方案二:环境变量控制(推荐)
|
### 方案二:环境变量控制(推荐)
|
||||||
|
|
||||||
#### 1. 创建环境配置
|
#### 1. 创建环境配置
|
||||||
|
|
||||||
在`.env`文件中添加:
|
在`.env`文件中添加:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# SSL配置
|
# SSL配置
|
||||||
|
|
@ -83,7 +83,7 @@ import { Config } from '@midwayjs/core';
|
||||||
@Provide()
|
@Provide()
|
||||||
export class WPService {
|
export class WPService {
|
||||||
@Config('wpSite')
|
@Config('wpSite')
|
||||||
sites: WpSite[];
|
sites: Site[];
|
||||||
|
|
||||||
// 获取SSL配置
|
// 获取SSL配置
|
||||||
private getHttpsAgent() {
|
private getHttpsAgent() {
|
||||||
|
|
@ -100,7 +100,7 @@ export class WPService {
|
||||||
|
|
||||||
async fetchPagedData<T>(
|
async fetchPagedData<T>(
|
||||||
endpoint: string,
|
endpoint: string,
|
||||||
site: WpSite,
|
site: Site,
|
||||||
page: number = 1,
|
page: number = 1,
|
||||||
perPage: number = 100
|
perPage: number = 100
|
||||||
): Promise<T[]> {
|
): Promise<T[]> {
|
||||||
|
|
@ -141,7 +141,7 @@ export class WPService {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 增强错误处理
|
// 增强错误处理
|
||||||
if (error.code === 'DEPTH_ZERO_SELF_SIGNED_CERT') {
|
if (error.code === 'DEPTH_ZERO_SELF_SIGNED_CERT') {
|
||||||
console.error('SSL证书错误:请检查证书配置或在开发环境中忽略SSL验证');
|
console.error('SSL证书错误:请检查证书配置或在开发环境中忽略SSL验证');
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ export class WPService {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 方案三:安装自签名证书(生产环境推荐)
|
### 方案三:安装自签名证书(生产环境推荐)
|
||||||
|
|
||||||
#### 1. 生成证书
|
#### 1. 生成证书
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
|
||||||
| 测试环境 | 建议验证 | 使用测试证书 | 中 |
|
| 测试环境 | 建议验证 | 使用测试证书 | 中 |
|
||||||
| 生产环境 | 必须验证 | 有效SSL证书 | 高 |
|
| 生产环境 | 必须验证 | 有效SSL证书 | 高 |
|
||||||
|
|
||||||
### 代码示例:环境检测
|
### 代码示例:环境检测
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// 环境安全检测
|
// 环境安全检测
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
## 【使用流程】
|
## 【使用流程】
|
||||||
|
|
||||||
### 步骤1:创建URL工具类
|
### 步骤1:创建URL工具类
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// src/utils/url.util.ts
|
// src/utils/url.util.ts
|
||||||
|
|
@ -56,12 +56,12 @@ export class UrlUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标准化URL路径(移除重复斜杠)
|
* 标准化URL路径(移除重复斜杠)
|
||||||
* @param url 原始URL
|
* @param url 原始URL
|
||||||
* @returns 标准化后的URL
|
* @returns 标准化后的URL
|
||||||
*/
|
*/
|
||||||
static normalizeUrl(url: string): string {
|
static normalizeUrl(url: string): string {
|
||||||
// 保护协议部分的双斜杠(如 http://)
|
// 保护协议部分的双斜杠(如 http://)
|
||||||
const protocolMatch = url.match(/^([a-zA-Z][a-zA-Z\d+\-.]*:\/\/)/);
|
const protocolMatch = url.match(/^([a-zA-Z][a-zA-Z\d+\-.]*:\/\/)/);
|
||||||
const protocol = protocolMatch ? protocolMatch[1] : '';
|
const protocol = protocolMatch ? protocolMatch[1] : '';
|
||||||
const restUrl = protocolMatch ? url.slice(protocol.length) : url;
|
const restUrl = protocolMatch ? url.slice(protocol.length) : url;
|
||||||
|
|
@ -72,7 +72,7 @@ export class UrlUtil {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 步骤2:创建专用API URL构建器
|
### 步骤2:创建专用API URL构建器
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// 扩展UrlUtil类,添加WordPress专用方法
|
// 扩展UrlUtil类,添加WordPress专用方法
|
||||||
|
|
@ -102,7 +102,7 @@ export class UrlUtil {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 步骤3:在服务中应用
|
### 步骤3:在服务中应用
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// src/service/wp.service.ts
|
// src/service/wp.service.ts
|
||||||
|
|
@ -112,22 +112,22 @@ import { UrlUtil } from '../utils/url.util';
|
||||||
export class WPService {
|
export class WPService {
|
||||||
async fetchPagedData<T>(
|
async fetchPagedData<T>(
|
||||||
endpoint: string,
|
endpoint: string,
|
||||||
site: WpSite,
|
site: Site,
|
||||||
page: number = 1,
|
page: number = 1,
|
||||||
perPage: number = 100
|
perPage: number = 100
|
||||||
): Promise<T[]> {
|
): Promise<T[]> {
|
||||||
const { wpApiUrl, consumerKey, consumerSecret } = site;
|
const { wpApiUrl, consumerKey, consumerSecret } = site;
|
||||||
|
|
||||||
// 原始方式(容易出错)
|
// 原始方式(容易出错)
|
||||||
// const url = `${wpApiUrl}/wp-json${endpoint}`;
|
// const url = `${wpApiUrl}/wp-json${endpoint}`;
|
||||||
|
|
||||||
// 推荐方式(安全可靠)
|
// 推荐方式(安全可靠)
|
||||||
const url = UrlUtil.buildWpApiUrl(wpApiUrl, endpoint);
|
const url = UrlUtil.buildWpApiUrl(wpApiUrl, endpoint);
|
||||||
|
|
||||||
// ... 其他代码
|
// ... 其他代码
|
||||||
}
|
}
|
||||||
|
|
||||||
async createShipment(site: WpSite, orderId: string, data: Record<string, any>) {
|
async createShipment(site: Site, orderId: string, data: Record<string, any>) {
|
||||||
const { wpApiUrl, consumerKey, consumerSecret } = site;
|
const { wpApiUrl, consumerKey, consumerSecret } = site;
|
||||||
|
|
||||||
// 复杂路径拼接示例
|
// 复杂路径拼接示例
|
||||||
|
|
@ -151,7 +151,7 @@ export class WPService {
|
||||||
### 问题场景演示
|
### 问题场景演示
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// 问题场景:配置文件中的URL格式不统一
|
// 问题场景:配置文件中的URL格式不统一
|
||||||
const configs = [
|
const configs = [
|
||||||
{ wpApiUrl: 'http://wp-test.local/' }, // 带尾部斜杠
|
{ wpApiUrl: 'http://wp-test.local/' }, // 带尾部斜杠
|
||||||
{ wpApiUrl: 'http://wp-test.local' }, // 不带尾部斜杠
|
{ wpApiUrl: 'http://wp-test.local' }, // 不带尾部斜杠
|
||||||
|
|
@ -169,7 +169,7 @@ configs.forEach(config => {
|
||||||
endpoints.forEach(endpoint => {
|
endpoints.forEach(endpoint => {
|
||||||
const badUrl = `${config.wpApiUrl}/wp-json${endpoint}`;
|
const badUrl = `${config.wpApiUrl}/wp-json${endpoint}`;
|
||||||
console.log('问题URL:', badUrl);
|
console.log('问题URL:', badUrl);
|
||||||
// 输出可能包含:
|
// 输出可能包含:
|
||||||
// http://wp-test.local//wp-json/wc/v3/orders
|
// http://wp-test.local//wp-json/wc/v3/orders
|
||||||
// http://wp-test.localwp-json/wc/v3/products
|
// http://wp-test.localwp-json/wc/v3/products
|
||||||
});
|
});
|
||||||
|
|
@ -184,7 +184,7 @@ configs.forEach(config => {
|
||||||
endpoints.forEach(endpoint => {
|
endpoints.forEach(endpoint => {
|
||||||
const safeUrl = UrlUtil.buildWpApiUrl(config.wpApiUrl, endpoint);
|
const safeUrl = UrlUtil.buildWpApiUrl(config.wpApiUrl, endpoint);
|
||||||
console.log('安全URL:', safeUrl);
|
console.log('安全URL:', safeUrl);
|
||||||
// 输出始终正确:
|
// 输出始终正确:
|
||||||
// http://wp-test.local/wp-json/wc/v3/orders
|
// http://wp-test.local/wp-json/wc/v3/orders
|
||||||
// http://wp-test.local/wp-json/wc/v3/products
|
// http://wp-test.local/wp-json/wc/v3/products
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
## erp-API 服务非 https 也可用配置
|
## erp-API 服务非 https 也可用配置
|
||||||
|
|
||||||
webhook 调用的时候默认是需要 https,但开发时本地一般不配置 ssl(或者只是自签名),所以需要在 wordpress 中添加非 https 也可用配置。
|
webhook 调用的时候默认是需要 https,但开发时本地一般不配置 ssl(或者只是自签名),所以需要在 wordpress 中添加非 https 也可用配置。
|
||||||
执行:在你应用的主题对应的 `functions.php` 中添加以下代码(可以放在最后)即可访问非https地址
|
执行:在你应用的主题对应的 `functions.php` 中添加以下代码(可以放在最后)即可访问非https地址
|
||||||
备注:路径:比如你应用的主题是 `twentytwentyfive`,则对应的文件路径是 `<siteFolder>/app/public/wp-content/themes/twentytwentyfive/functions.php`
|
备注:路径:比如你应用的主题是 `twentytwentyfive`,则对应的文件路径是 `<siteFolder>/app/public/wp-content/themes/twentytwentyfive/functions.php`
|
||||||
|
|
||||||
```php
|
```php
|
||||||
add_filter( 'http_request_args', function( $args ) {
|
add_filter( 'http_request_args', function( $args ) {
|
||||||
|
|
@ -33,8 +33,8 @@ if ( (isset($_GET['consumer_key']) && isset($_GET['consumer_secret'])) || isset(
|
||||||
|
|
||||||
## 在wordpress管理端网页添加webhook
|
## 在wordpress管理端网页添加webhook
|
||||||
|
|
||||||
地址: <http://wp-test.local/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=webhooks>
|
地址: <http://wp-test.local/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=webhooks>
|
||||||
举例说明:
|
举例说明:
|
||||||

|

|
||||||
|
|
||||||
## 最终在订单更新时会调用地址,然后进而调用 syncSingleOrder 函数
|
## 最终在订单更新时会调用地址,然后进而调用 syncSingleOrder 函数
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ const config = {
|
||||||
wpApiUrl: 'http://wp-test.local', // wordpress地址
|
wpApiUrl: 'http://wp-test.local', // wordpress地址
|
||||||
consumerKey: 'ck_d6fc55914e2aba162bcf979a549e965a751e71ee', // woocommerce advanced 中创建rest api的key
|
consumerKey: 'ck_d6fc55914e2aba162bcf979a549e965a751e71ee', // woocommerce advanced 中创建rest api的key
|
||||||
consumerSecret: 'cs_5828d66ddd23f17f7c7693f4414756ddb637fb47',// woocommerce advanced 中创建rest api的key
|
consumerSecret: 'cs_5828d66ddd23f17f7c7693f4414756ddb637fb47',// woocommerce advanced 中创建rest api的key
|
||||||
siteName: 'Local',
|
name: 'Local',
|
||||||
// email配置对访问不重要
|
// email配置对访问不重要
|
||||||
email: '*',
|
email: '*',
|
||||||
emailPswd: '*',
|
emailPswd: '*',
|
||||||
|
|
@ -24,15 +24,15 @@ const config = {
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 开通woocommere 权限(key)
|
## 开通woocommere 权限(key)
|
||||||
|
|
||||||
key只要添加即可使用(一般测试直接添加具有 READ WRITE 权限即可)
|
key只要添加即可使用(一般测试直接添加具有 READ WRITE 权限即可)
|
||||||

|

|
||||||
|
|
||||||
## 常见问题
|
## 常见问题
|
||||||
|
|
||||||
### SSL证书问题
|
### SSL证书问题
|
||||||
|
|
||||||
因为是我们访问 woocommerce 所以可以直接忽略 ssl 错误(比如 axios 直接忽略)
|
因为是我们访问 woocommerce 所以可以直接忽略 ssl 错误(比如 axios 直接忽略)
|
||||||
|
|
||||||
如果遇到SSL证书错误(如`DEPTH_ZERO_SELF_SIGNED_CERT`),请参考:[SSL证书问题解决方案](./SSL证书问题解决方案.md)
|
如果遇到SSL证书错误(如`DEPTH_ZERO_SELF_SIGNED_CERT`),请参考:[SSL证书问题解决方案](./SSL证书问题解决方案.md)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# 如何快速搭建你的wordpress
|
# 如何快速搭建你的wordpress
|
||||||
|
|
||||||
## 直接使用 `local` 这个软件进行搭建
|
## 直接使用 `local` 这个软件进行搭建
|
||||||
网站: https://localwp.com/
|
网站: https://localwp.com/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
### ECONNRESET 错误原因
|
### ECONNRESET 错误原因
|
||||||
|
|
||||||
`ECONNRESET` 是一个网络连接重置错误,通常由以下原因引起:
|
`ECONNRESET` 是一个网络连接重置错误,通常由以下原因引起:
|
||||||
|
|
||||||
1. **服务器主动断开连接**
|
1. **服务器主动断开连接**
|
||||||
- 服务器负载过高
|
- 服务器负载过高
|
||||||
|
|
@ -103,7 +103,7 @@ if (hasMore) {
|
||||||
|
|
||||||
### 2. 超时配置
|
### 2. 超时配置
|
||||||
|
|
||||||
- 设置合理的请求超时时间(建议 30-60 秒)
|
- 设置合理的请求超时时间(建议 30-60 秒)
|
||||||
- 根据网络环境调整超时参数
|
- 根据网络环境调整超时参数
|
||||||
|
|
||||||
### 3. 重试策略
|
### 3. 重试策略
|
||||||
|
|
@ -120,9 +120,9 @@ if (hasMore) {
|
||||||
|
|
||||||
## 代码实现
|
## 代码实现
|
||||||
|
|
||||||
已在 `wp.service.ts` 的 `fetchPagedData` 方法中实现以下改进:
|
已在 `wp.service.ts` 的 `fetchPagedData` 方法中实现以下改进:
|
||||||
|
|
||||||
1. ✅ 添加重试机制(最多重试3次)
|
1. ✅ 添加重试机制(最多重试3次)
|
||||||
2. ✅ 实现指数退避算法
|
2. ✅ 实现指数退避算法
|
||||||
3. ✅ 优化 HTTPS Agent 配置
|
3. ✅ 优化 HTTPS Agent 配置
|
||||||
4. ✅ 添加请求超时设置
|
4. ✅ 添加请求超时设置
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
# 商品上架流程
|
||||||
|
|
||||||
|
本文档描述了从准备商品数据到同步至多个 WooCommerce 站点的完整流程。
|
||||||
|
|
||||||
|
## 流程图 (Mermaid)
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
%% 节点样式定义
|
||||||
|
classDef process fill:#e1f5fe,stroke:#01579b,stroke-width:2px;
|
||||||
|
classDef storage fill:#fff9c4,stroke:#fbc02d,stroke-width:2px;
|
||||||
|
classDef action fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px;
|
||||||
|
|
||||||
|
Start((开始)) --> Step1[制作批量导入表]
|
||||||
|
|
||||||
|
subgraph 数据准备阶段
|
||||||
|
Step1 -->|包含| Info1[基础属性]
|
||||||
|
Step1 -->|包含| Info2[商品组成/SKU]
|
||||||
|
Info1 -.-> TableFile(Excel/CSV 文件)
|
||||||
|
Info2 -.-> TableFile
|
||||||
|
end
|
||||||
|
|
||||||
|
TableFile --> Step2{导入 ERP 系统}
|
||||||
|
|
||||||
|
subgraph ERP处理阶段
|
||||||
|
Step2 -->|解析 & 存储| ERPDB[(ERP 商品数据库)]
|
||||||
|
ERPDB --> Step3[用户操作: 点击同步按钮]
|
||||||
|
end
|
||||||
|
|
||||||
|
Step3 --> SyncProcess{分发同步任务}
|
||||||
|
|
||||||
|
subgraph 多站点同步
|
||||||
|
SyncProcess -->|API 推送| SiteA[WooCommerce 站点 A]
|
||||||
|
SyncProcess -->|API 推送| SiteB[WooCommerce 站点 B]
|
||||||
|
SyncProcess -->|API 推送| SiteC[WooCommerce 站点 C]
|
||||||
|
end
|
||||||
|
|
||||||
|
SiteA --> End((上架完成))
|
||||||
|
SiteB --> End
|
||||||
|
SiteC --> End
|
||||||
|
|
||||||
|
%% 应用样式
|
||||||
|
class Step1,Step2,Step3,SyncProcess process;
|
||||||
|
class ERPDB,TableFile storage;
|
||||||
|
class Start,End action;
|
||||||
|
```
|
||||||
|
|
||||||
|
## 详细步骤说明
|
||||||
|
|
||||||
|
1. **制作批量导入表**
|
||||||
|
* 准备 Excel 或 CSV 格式的数据表。
|
||||||
|
* **关键内容**:必须包含商品的**基础属性**(如名称、描述、分类)和**商品组成**(如变体 SKU、价格、库存)。
|
||||||
|
|
||||||
|
2. **导入 ERP 系统**
|
||||||
|
* 将制作好的表格上传至 ERP 系统。
|
||||||
|
* 系统会自动解析文件,将商品数据存入 ERP 的商品数据库中。
|
||||||
|
|
||||||
|
3. **多站点同步**
|
||||||
|
* 在 ERP 系统中找到已导入的商品。
|
||||||
|
* 点击**“同步”**按钮。
|
||||||
|
* 系统将自动把商品信息推送到配置好的多个 **WooCommerce** 站点,完成上架。
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
||||||
|
网站,账号 ,密码,验证码
|
||||||
|
admin.yoone.ca,admin,yoone2025.,yoone2025!@YOONE0923
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
**业务描述**: 完整的订单生命周期管理,从创建到发货的全流程
|
**业务描述**: 完整的订单生命周期管理,从创建到发货的全流程
|
||||||
|
|
||||||
**精彩之处**:
|
**精彩之处**:
|
||||||
- 双状态管理:WooCommerce状态 + ERP内部状态
|
- 双状态管理:WooCommerce状态 + ERP内部状态
|
||||||
- 完整的订单项目管理,支持原始订单和销售订单分离
|
- 完整的订单项目管理,支持原始订单和销售订单分离
|
||||||
- 订单退款、优惠券、运费等复杂业务场景支持
|
- 订单退款、优惠券、运费等复杂业务场景支持
|
||||||
- 订单同步机制,支持从WooCommerce自动同步订单
|
- 订单同步机制,支持从WooCommerce自动同步订单
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
**业务描述**: 集成多个物流服务商的发货管理系统
|
**业务描述**: 集成多个物流服务商的发货管理系统
|
||||||
|
|
||||||
**精彩之处**:
|
**精彩之处**:
|
||||||
- 集成多个物流服务商:FreightCom、CanadaPost、UniExpress
|
- 集成多个物流服务商:FreightCom、CanadaPost、UniExpress
|
||||||
- 运费计算和比较功能
|
- 运费计算和比较功能
|
||||||
- 自动生成运单和跟踪号
|
- 自动生成运单和跟踪号
|
||||||
- 物流状态同步到WooCommerce
|
- 物流状态同步到WooCommerce
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue