@fayz-ai/plugin-shop 0.31.3 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/analytics/cards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAwC,MAAM,eAAe,CAAA;AAoJ3F,wBAAgB,uBAAuB,IAAI,gBAAgB,EAAE,CAivB5D"}
1
+ {"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/analytics/cards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAwC,MAAM,eAAe,CAAA;AAoJ3F,wBAAgB,uBAAuB,IAAI,gBAAgB,EAAE,CAoxB5D"}
package/dist/index.js CHANGED
@@ -5673,6 +5673,41 @@ function buildShopAnalyticsCards() {
5673
5673
  viz: { type: "breakdown", measures: ["total"] },
5674
5674
  dashboard: { span: 2, order: 24 }
5675
5675
  },
5676
+ {
5677
+ ...base,
5678
+ // Every channel, not only the site: the read model is over all orders
5679
+ // (0155), so its canonical owner is orders, not the shop's order view.
5680
+ canonicalOwner: "public.orders",
5681
+ id: "shop.sales-by-line",
5682
+ name: tl("Sales by channel", "Vendas por canal"),
5683
+ description: tl(
5684
+ "Delivery, each B2B price table, counter and dine-in apart: orders, revenue, average ticket and freight. The same channel the orders list filters on, and the revenue account it lands on in the P&L.",
5685
+ "Delivery, cada tabela de pre\xE7o do B2B, balc\xE3o e sal\xE3o separados: pedidos, faturamento, ticket m\xE9dio e frete. O mesmo canal que filtra a lista de pedidos, e a conta da DRE em que a venda entra."
5686
+ ),
5687
+ icon: "Split",
5688
+ category: CAT.sales,
5689
+ grain: "order",
5690
+ query: {
5691
+ // Cancelled, test and purchase orders are already out of the view.
5692
+ source: { kind: "view", name: "plg_shop_rep_sales_lines" },
5693
+ dimensions: [
5694
+ { key: "sales_line_label", label: tl("Channel", "Canal") },
5695
+ { key: "revenue_account", label: tl("Revenue account", "Conta da DRE") }
5696
+ ],
5697
+ measures: [
5698
+ { key: "total", label: tl("Revenue", "Faturamento"), agg: "sum", format: "currency" },
5699
+ { key: "orders", label: tl("Orders", "Pedidos"), agg: "count", format: "number" },
5700
+ { ...AOV },
5701
+ { key: "customers", label: tl("Customers", "Clientes"), agg: "count_distinct", column: "customer_id", format: "number" },
5702
+ { key: "shipping", label: tl("Freight", "Frete"), agg: "sum", format: "currency" },
5703
+ { key: "discounts", label: tl("Discounts", "Descontos"), agg: "sum", format: "currency" }
5704
+ ],
5705
+ defaultSort: "total",
5706
+ defaultSortDir: "desc"
5707
+ },
5708
+ viz: { type: "breakdown", measures: ["total"] },
5709
+ dashboard: { span: 2, order: 23 }
5710
+ },
5676
5711
  {
5677
5712
  ...base,
5678
5713
  id: "shop.orders-by-fulfillment-status",