@spree/docs 0.1.228 → 0.1.230

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.
@@ -879,8 +879,8 @@ paths:
879
879
  example:
880
880
  data:
881
881
  - id: prod_UkLWZg9DAJ
882
- name: Product 2116979
883
- slug: product-2116979
882
+ name: Product 2506979
883
+ slug: product-2506979
884
884
  meta_title:
885
885
  meta_description:
886
886
  meta_keywords:
@@ -1054,8 +1054,8 @@ paths:
1054
1054
  example:
1055
1055
  data:
1056
1056
  - id: prod_UkLWZg9DAJ
1057
- name: Product 2589085
1058
- slug: product-2589085
1057
+ name: Product 2979085
1058
+ slug: product-2979085
1059
1059
  meta_title:
1060
1060
  meta_description:
1061
1061
  meta_keywords:
@@ -1086,8 +1086,8 @@ paths:
1086
1086
  original_price:
1087
1087
  seller_id:
1088
1088
  - id: prod_gbHJdmfrXB
1089
- name: Product 2598209
1090
- slug: product-2598209
1089
+ name: Product 2988209
1090
+ slug: product-2988209
1091
1091
  meta_title:
1092
1092
  meta_description:
1093
1093
  meta_keywords:
@@ -1216,8 +1216,8 @@ paths:
1216
1216
  application/json:
1217
1217
  example:
1218
1218
  id: prod_UkLWZg9DAJ
1219
- name: Product 2866885
1220
- slug: product-2866885
1219
+ name: Product 3256885
1220
+ slug: product-3256885
1221
1221
  meta_title:
1222
1222
  meta_description:
1223
1223
  meta_keywords:
@@ -1576,8 +1576,8 @@ paths:
1576
1576
  preorder_ships_at:
1577
1577
  quantity: 1
1578
1578
  currency: USD
1579
- name: Product 185715
1580
- slug: product-185715
1579
+ name: Product 224715
1580
+ slug: product-224715
1581
1581
  options_text: ''
1582
1582
  price: '10.0'
1583
1583
  display_price: "$10.00"
@@ -1695,8 +1695,8 @@ paths:
1695
1695
  preorder_ships_at:
1696
1696
  quantity: 1
1697
1697
  currency: USD
1698
- name: Product 1862171
1699
- slug: product-1862171
1698
+ name: Product 2252171
1699
+ slug: product-2252171
1700
1700
  options_text: ''
1701
1701
  price: '10.0'
1702
1702
  display_price: "$10.00"
@@ -2004,7 +2004,7 @@ paths:
2004
2004
  total_quantity: 0
2005
2005
  warnings:
2006
2006
  - code: line_item_removed
2007
- message: Product 190307 was removed because it was sold out
2007
+ message: Product 229307 was removed because it was sold out
2008
2008
  line_item_id: li_UkLWZg9DAJ
2009
2009
  variant_id: variant_UkLWZg9DAJ
2010
2010
  coupon_code:
@@ -2244,8 +2244,8 @@ paths:
2244
2244
  preorder_ships_at:
2245
2245
  quantity: 1
2246
2246
  currency: USD
2247
- name: Product 1913263
2248
- slug: product-1913263
2247
+ name: Product 2303263
2248
+ slug: product-2303263
2249
2249
  options_text: ''
2250
2250
  price: '10.0'
2251
2251
  display_price: "$10.00"
@@ -2530,8 +2530,8 @@ paths:
2530
2530
  preorder_ships_at:
2531
2531
  quantity: 1
2532
2532
  currency: USD
2533
- name: Product 1938992
2534
- slug: product-1938992
2533
+ name: Product 2328992
2534
+ slug: product-2328992
2535
2535
  options_text: ''
2536
2536
  price: '10.0'
2537
2537
  display_price: "$10.00"
@@ -2562,7 +2562,7 @@ paths:
2562
2562
  first_name: John
2563
2563
  last_name: Doe
2564
2564
  full_name: John Doe
2565
- address1: 234 Lovely Street
2565
+ address1: 252 Lovely Street
2566
2566
  address2: Northwest
2567
2567
  postal_code: '10118'
2568
2568
  city: New York
@@ -2584,7 +2584,7 @@ paths:
2584
2584
  first_name: John
2585
2585
  last_name: Doe
2586
2586
  full_name: John Doe
2587
- address1: 233 Lovely Street
2587
+ address1: 251 Lovely Street
2588
2588
  address2: Northwest
2589
2589
  postal_code: '10118'
2590
2590
  city: New York
@@ -2743,8 +2743,8 @@ paths:
2743
2743
  preorder_ships_at:
2744
2744
  quantity: 1
2745
2745
  currency: USD
2746
- name: Product 1964794
2747
- slug: product-1964794
2746
+ name: Product 2354794
2747
+ slug: product-2354794
2748
2748
  options_text: ''
2749
2749
  price: '10.0'
2750
2750
  display_price: "$10.00"
@@ -2878,7 +2878,7 @@ paths:
2878
2878
  first_name: John
2879
2879
  last_name: Doe
2880
2880
  full_name: John Doe
2881
- address1: 240 Lovely Street
2881
+ address1: 258 Lovely Street
2882
2882
  address2: Northwest
2883
2883
  postal_code: '10118'
2884
2884
  city: New York
@@ -2900,7 +2900,7 @@ paths:
2900
2900
  first_name: John
2901
2901
  last_name: Doe
2902
2902
  full_name: John Doe
2903
- address1: 239 Lovely Street
2903
+ address1: 257 Lovely Street
2904
2904
  address2: Northwest
2905
2905
  postal_code: '10118'
2906
2906
  city: New York
@@ -3083,8 +3083,8 @@ paths:
3083
3083
  preorder_ships_at:
3084
3084
  quantity: 1
3085
3085
  currency: USD
3086
- name: Product 2252614
3087
- slug: product-2252614
3086
+ name: Product 2642614
3087
+ slug: product-2642614
3088
3088
  options_text: ''
3089
3089
  price: '10.0'
3090
3090
  display_price: "$10.00"
@@ -3282,8 +3282,8 @@ paths:
3282
3282
  preorder_ships_at:
3283
3283
  quantity: 1
3284
3284
  currency: USD
3285
- name: Product 2263461
3286
- slug: product-2263461
3285
+ name: Product 2653461
3286
+ slug: product-2653461
3287
3287
  options_text: ''
3288
3288
  price: '10.0'
3289
3289
  display_price: "$10.00"
@@ -3469,8 +3469,8 @@ paths:
3469
3469
  preorder_ships_at:
3470
3470
  quantity: 1
3471
3471
  currency: USD
3472
- name: Product 2288182
3473
- slug: product-2288182
3472
+ name: Product 2678182
3473
+ slug: product-2678182
3474
3474
  options_text: ''
3475
3475
  price: '10.0'
3476
3476
  display_price: "$10.00"
@@ -3580,7 +3580,7 @@ paths:
3580
3580
  first_name: John
3581
3581
  last_name: Doe
3582
3582
  full_name: John Doe
3583
- address1: 336 Lovely Street
3583
+ address1: 354 Lovely Street
3584
3584
  address2: Northwest
3585
3585
  postal_code: '10118'
3586
3586
  city: New York
@@ -3766,8 +3766,8 @@ paths:
3766
3766
  preorder_ships_at:
3767
3767
  quantity: 1
3768
3768
  currency: USD
3769
- name: Product 2305702
3770
- slug: product-2305702
3769
+ name: Product 2695702
3770
+ slug: product-2695702
3771
3771
  options_text: ''
3772
3772
  price: '10.0'
3773
3773
  display_price: "$10.00"
@@ -4020,8 +4020,8 @@ paths:
4020
4020
  preorder_ships_at:
4021
4021
  quantity: 1
4022
4022
  currency: USD
4023
- name: Product 2349569
4024
- slug: product-2349569
4023
+ name: Product 2739569
4024
+ slug: product-2739569
4025
4025
  options_text: ''
4026
4026
  price: '10.0'
4027
4027
  display_price: "$10.00"
@@ -4174,10 +4174,10 @@ paths:
4174
4174
  total_quantity: 2
4175
4175
  warnings:
4176
4176
  - code: delivery_unavailable
4177
- message: Product 23763 cannot be delivered to the selected address
4177
+ message: Product 27663 cannot be delivered to the selected address
4178
4178
  line_item_id: li_UkLWZg9DAJ
4179
4179
  - code: delivery_unavailable
4180
- message: Product 238298 cannot be delivered to the selected address
4180
+ message: Product 277298 cannot be delivered to the selected address
4181
4181
  line_item_id: li_gbHJdmfrXB
4182
4182
  coupon_code:
4183
4183
  item_total: '29.99'
@@ -4235,8 +4235,8 @@ paths:
4235
4235
  preorder_ships_at:
4236
4236
  quantity: 1
4237
4237
  currency: USD
4238
- name: Product 23763
4239
- slug: product-23763
4238
+ name: Product 27663
4239
+ slug: product-27663
4240
4240
  options_text: ''
4241
4241
  price: '10.0'
4242
4242
  display_price: "$10.00"
@@ -4266,8 +4266,8 @@ paths:
4266
4266
  preorder_ships_at:
4267
4267
  quantity: 1
4268
4268
  currency: USD
4269
- name: Product 238298
4270
- slug: product-238298
4269
+ name: Product 277298
4270
+ slug: product-277298
4271
4271
  options_text: ''
4272
4272
  price: '19.99'
4273
4273
  display_price: "$19.99"
@@ -4496,8 +4496,8 @@ paths:
4496
4496
  preorder_ships_at:
4497
4497
  quantity: 1
4498
4498
  currency: USD
4499
- name: Product 2449165
4500
- slug: product-2449165
4499
+ name: Product 2839165
4500
+ slug: product-2839165
4501
4501
  options_text: ''
4502
4502
  price: '10.0'
4503
4503
  display_price: "$10.00"
@@ -5326,8 +5326,8 @@ paths:
5326
5326
  preorder_ships_at:
5327
5327
  quantity: 1
5328
5328
  currency: USD
5329
- name: Product 3069789
5330
- slug: product-3069789
5329
+ name: Product 3459789
5330
+ slug: product-3459789
5331
5331
  options_text: ''
5332
5332
  price: '10.0'
5333
5333
  display_price: "$10.00"
@@ -5544,8 +5544,8 @@ paths:
5544
5544
  preorder_ships_at:
5545
5545
  quantity: 1
5546
5546
  currency: USD
5547
- name: Product 308179
5548
- slug: product-308179
5547
+ name: Product 347179
5548
+ slug: product-347179
5549
5549
  options_text: ''
5550
5550
  price: '10.0'
5551
5551
  display_price: "$10.00"
@@ -5723,8 +5723,8 @@ paths:
5723
5723
  preorder_ships_at:
5724
5724
  quantity: 1
5725
5725
  currency: USD
5726
- name: Product 248496
5727
- slug: product-248496
5726
+ name: Product 287496
5727
+ slug: product-287496
5728
5728
  options_text: ''
5729
5729
  price: '10.0'
5730
5730
  display_price: "$10.00"
@@ -5842,7 +5842,7 @@ paths:
5842
5842
  first_name: John
5843
5843
  last_name: Doe
5844
5844
  full_name: John Doe
5845
- address1: 392 Lovely Street
5845
+ address1: 410 Lovely Street
5846
5846
  address2: Northwest
5847
5847
  postal_code: '10118'
5848
5848
  city: New York
@@ -5864,7 +5864,7 @@ paths:
5864
5864
  first_name: John
5865
5865
  last_name: Doe
5866
5866
  full_name: John Doe
5867
- address1: 393 Lovely Street
5867
+ address1: 411 Lovely Street
5868
5868
  address2: Northwest
5869
5869
  postal_code: '10118'
5870
5870
  city: New York
@@ -5970,7 +5970,7 @@ paths:
5970
5970
  first_name: John
5971
5971
  last_name: Doe
5972
5972
  full_name: John Doe
5973
- address1: 198 Lovely Street
5973
+ address1: 216 Lovely Street
5974
5974
  address2: Northwest
5975
5975
  postal_code: '10118'
5976
5976
  city: New York
@@ -5991,7 +5991,7 @@ paths:
5991
5991
  first_name: John
5992
5992
  last_name: Doe
5993
5993
  full_name: John Doe
5994
- address1: 199 Lovely Street
5994
+ address1: 217 Lovely Street
5995
5995
  address2: Northwest
5996
5996
  postal_code: '10118'
5997
5997
  city: New York
@@ -6012,7 +6012,7 @@ paths:
6012
6012
  first_name: John
6013
6013
  last_name: Doe
6014
6014
  full_name: John Doe
6015
- address1: 200 Lovely Street
6015
+ address1: 218 Lovely Street
6016
6016
  address2: Northwest
6017
6017
  postal_code: '10118'
6018
6018
  city: New York
@@ -6270,7 +6270,7 @@ paths:
6270
6270
  first_name: John
6271
6271
  last_name: Doe
6272
6272
  full_name: John Doe
6273
- address1: 212 Lovely Street
6273
+ address1: 230 Lovely Street
6274
6274
  address2: Northwest
6275
6275
  postal_code: '10118'
6276
6276
  city: New York
@@ -6352,7 +6352,7 @@ paths:
6352
6352
  first_name: John
6353
6353
  last_name: Doe
6354
6354
  full_name: John Doe
6355
- address1: 218 Lovely Street
6355
+ address1: 236 Lovely Street
6356
6356
  address2: Northwest
6357
6357
  postal_code: '10118'
6358
6358
  city: Los Angeles
@@ -6847,8 +6847,8 @@ paths:
6847
6847
  preorder_ships_at:
6848
6848
  quantity: 1
6849
6849
  currency: USD
6850
- name: Product 2135270
6851
- slug: product-2135270
6850
+ name: Product 2525270
6851
+ slug: product-2525270
6852
6852
  options_text: ''
6853
6853
  price: '10.0'
6854
6854
  display_price: "$10.00"
@@ -6966,7 +6966,7 @@ paths:
6966
6966
  first_name: John
6967
6967
  last_name: Doe
6968
6968
  full_name: John Doe
6969
- address1: 284 Lovely Street
6969
+ address1: 302 Lovely Street
6970
6970
  address2: Northwest
6971
6971
  postal_code: '10118'
6972
6972
  city: New York
@@ -6988,7 +6988,7 @@ paths:
6988
6988
  first_name: John
6989
6989
  last_name: Doe
6990
6990
  full_name: John Doe
6991
- address1: 285 Lovely Street
6991
+ address1: 303 Lovely Street
6992
6992
  address2: Northwest
6993
6993
  postal_code: '10118'
6994
6994
  city: New York
@@ -7169,8 +7169,8 @@ paths:
7169
7169
  preorder_ships_at:
7170
7170
  quantity: 1
7171
7171
  currency: USD
7172
- name: Product 2155633
7173
- slug: product-2155633
7172
+ name: Product 2545633
7173
+ slug: product-2545633
7174
7174
  options_text: ''
7175
7175
  price: '10.0'
7176
7176
  display_price: "$10.00"
@@ -7288,7 +7288,7 @@ paths:
7288
7288
  first_name: John
7289
7289
  last_name: Doe
7290
7290
  full_name: John Doe
7291
- address1: 290 Lovely Street
7291
+ address1: 308 Lovely Street
7292
7292
  address2: Northwest
7293
7293
  postal_code: '10118'
7294
7294
  city: New York
@@ -7310,7 +7310,7 @@ paths:
7310
7310
  first_name: John
7311
7311
  last_name: Doe
7312
7312
  full_name: John Doe
7313
- address1: 291 Lovely Street
7313
+ address1: 309 Lovely Street
7314
7314
  address2: Northwest
7315
7315
  postal_code: '10118'
7316
7316
  city: New York
@@ -7531,7 +7531,7 @@ paths:
7531
7531
  first_name: John
7532
7532
  last_name: Doe
7533
7533
  full_name: John Doe
7534
- address1: 296 Lovely Street
7534
+ address1: 314 Lovely Street
7535
7535
  address2: Northwest
7536
7536
  postal_code: '10118'
7537
7537
  city: New York
@@ -7552,7 +7552,7 @@ paths:
7552
7552
  first_name: John
7553
7553
  last_name: Doe
7554
7554
  full_name: John Doe
7555
- address1: 297 Lovely Street
7555
+ address1: 315 Lovely Street
7556
7556
  address2: Northwest
7557
7557
  postal_code: '10118'
7558
7558
  city: New York
@@ -7574,7 +7574,7 @@ paths:
7574
7574
  first_name: John
7575
7575
  last_name: Doe
7576
7576
  full_name: John Doe
7577
- address1: 297 Lovely Street
7577
+ address1: 315 Lovely Street
7578
7578
  address2: Northwest
7579
7579
  postal_code: '10118'
7580
7580
  city: New York
@@ -7596,7 +7596,7 @@ paths:
7596
7596
  first_name: John
7597
7597
  last_name: Doe
7598
7598
  full_name: John Doe
7599
- address1: 296 Lovely Street
7599
+ address1: 314 Lovely Street
7600
7600
  address2: Northwest
7601
7601
  postal_code: '10118'
7602
7602
  city: New York
@@ -7688,7 +7688,7 @@ paths:
7688
7688
  first_name: John
7689
7689
  last_name: Doe
7690
7690
  full_name: John Doe
7691
- address1: 298 Lovely Street
7691
+ address1: 316 Lovely Street
7692
7692
  address2: Northwest
7693
7693
  postal_code: '10118'
7694
7694
  city: New York
@@ -7709,7 +7709,7 @@ paths:
7709
7709
  first_name: John
7710
7710
  last_name: Doe
7711
7711
  full_name: John Doe
7712
- address1: 299 Lovely Street
7712
+ address1: 317 Lovely Street
7713
7713
  address2: Northwest
7714
7714
  postal_code: '10118'
7715
7715
  city: New York
@@ -7731,7 +7731,7 @@ paths:
7731
7731
  first_name: John
7732
7732
  last_name: Doe
7733
7733
  full_name: John Doe
7734
- address1: 299 Lovely Street
7734
+ address1: 317 Lovely Street
7735
7735
  address2: Northwest
7736
7736
  postal_code: '10118'
7737
7737
  city: New York
@@ -7753,7 +7753,7 @@ paths:
7753
7753
  first_name: John
7754
7754
  last_name: Doe
7755
7755
  full_name: John Doe
7756
- address1: 298 Lovely Street
7756
+ address1: 316 Lovely Street
7757
7757
  address2: Northwest
7758
7758
  postal_code: '10118'
7759
7759
  city: New York
@@ -9732,7 +9732,7 @@ paths:
9732
9732
  variant:
9733
9733
  id: variant_gbHJdmfrXB
9734
9734
  product_id: prod_gbHJdmfrXB
9735
- sku: SKU-366
9735
+ sku: SKU-435
9736
9736
  options_text: ''
9737
9737
  track_inventory: true
9738
9738
  media_count: 0
@@ -10663,7 +10663,7 @@ paths:
10663
10663
  first_name:
10664
10664
  last_name:
10665
10665
  full_name: ''
10666
- address1: 257 Lovely Street
10666
+ address1: 275 Lovely Street
10667
10667
  address2: Northwest
10668
10668
  postal_code: '10118'
10669
10669
  city: New York
@@ -10734,7 +10734,7 @@ paths:
10734
10734
  first_name:
10735
10735
  last_name:
10736
10736
  full_name: ''
10737
- address1: 260 Lovely Street
10737
+ address1: 278 Lovely Street
10738
10738
  address2: Northwest
10739
10739
  postal_code: '10118'
10740
10740
  city: New York
@@ -10913,8 +10913,8 @@ paths:
10913
10913
  preorder_ships_at:
10914
10914
  quantity: 1
10915
10915
  currency: USD
10916
- name: Product 2125649
10917
- slug: product-2125649
10916
+ name: Product 2515649
10917
+ slug: product-2515649
10918
10918
  options_text: ''
10919
10919
  price: '10.0'
10920
10920
  display_price: "$10.00"
@@ -11032,7 +11032,7 @@ paths:
11032
11032
  first_name: John
11033
11033
  last_name: Doe
11034
11034
  full_name: John Doe
11035
- address1: 268 Lovely Street
11035
+ address1: 286 Lovely Street
11036
11036
  address2: Northwest
11037
11037
  postal_code: '10118'
11038
11038
  city: New York
@@ -11054,7 +11054,7 @@ paths:
11054
11054
  first_name: John
11055
11055
  last_name: Doe
11056
11056
  full_name: John Doe
11057
- address1: 269 Lovely Street
11057
+ address1: 287 Lovely Street
11058
11058
  address2: Northwest
11059
11059
  postal_code: '10118'
11060
11060
  city: New York
@@ -35,6 +35,7 @@ A query names what to measure and how to slice it. This is the whole surface:
35
35
  "filters": [{ "dimension": "channel", "op": "eq", "value": "ch_86Rf07xd4z" }],
36
36
  "time_range": { "preset": "last_4_weeks" },
37
37
  "compare": "previous_period",
38
+ "currency": "EUR",
38
39
  "sort": "-total_sales",
39
40
  "limit": 50
40
41
  }
@@ -47,6 +48,7 @@ A query names what to measure and how to slice it. This is the whole surface:
47
48
  | `filters` | `eq` or `in` against a dimension. Values are prefixed IDs where the dimension identifies a record. |
48
49
  | `time_range` | A named preset, or `since`/`until` as ISO 8601. A bare date covers the store's whole day. |
49
50
  | `compare` | `previous_period` adds `previous` and `growth` to every metric. |
51
+ | `currency` | ISO 4217 code, e.g. `"EUR"`. Defaults to the store's own. Applies only to a query containing money — see [Metrics](#metrics). The values a store accepts are in the schema's `supported_currencies`. |
50
52
  | `sort` / `limit` | Ranking controls; ignored for time series, which are always chronological and complete. |
51
53
 
52
54
  Unknown members are rejected, never dropped. A malformed query answers 422,
@@ -88,12 +90,20 @@ Spree.reporting.metric :total_sales,
88
90
  a `:percent` metric arrives as the number a merchant reads (`42.5`), not the
89
91
  fraction.
90
92
 
91
- Amounts are **never converted**. A query answers in one currency — the one
92
- it names, or the store's default — and every base a money metric reads must
93
- filter by it, or two currencies end up added together under one symbol. A
94
- store selling in several therefore has as many answers as it has
95
- currencies, which is why the home screen offers a currency alongside its
93
+ Amounts are **never converted**. A query containing money answers in one
94
+ currency — the one it names, or the store's default — and every base a money
95
+ metric reads filters by it, or two currencies end up added together under one
96
+ symbol. A store selling in several therefore has as many money answers as it
97
+ has currencies, which is why the home screen offers a currency alongside its
96
98
  channel and date range.
99
+
100
+ **A query with no money in it is not scoped to a currency at all.** Counts
101
+ and quantities — orders, customers, units sold, payments taken — are not
102
+ amounts, so narrowing them would answer "how many orders did we take" with
103
+ only the share that happened to be priced in one currency. Ask for `orders`
104
+ alone and you get every order; ask for `orders` beside `total_sales` and the
105
+ whole query narrows, because the money figure has to. A ratio counts as
106
+ money when either side is: average order value does, sell-through does not.
97
107
  - `ratio: [:numerator, :denominator]` defines a **derived** metric, computed
98
108
  after aggregation so it is correct for both rows and totals. Average order
99
109
  value is `ratio: %i[total_sales orders]`, never `AVG()`.
@@ -198,6 +198,18 @@ These are limits of the compiler, not of registration:
198
198
  Registering a base is otherwise ordinary: declare its family, its table, a
199
199
  store-scoped relation, its time column and which bases its dimensions reach.
200
200
 
201
+ The relation's `currency` argument **is nil when the query contains no money
202
+ metric**, and a base must then not filter by it — a count restricted to one
203
+ currency is a wrong answer, not a narrower one. Guard the filter rather than
204
+ passing nil into `where`, which would match nothing:
205
+
206
+ ```ruby
207
+ relation: lambda { |store, range, currency|
208
+ scope = store.subscriptions.where(created_at: range)
209
+ currency ? scope.where(currency: currency) : scope
210
+ }
211
+ ```
212
+
201
213
  ```ruby
202
214
  Spree.reporting.base :subscriptions, family: :subscriptions,
203
215
  table: '%{subscriptions}',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spree/docs",
3
- "version": "0.1.228",
3
+ "version": "0.1.230",
4
4
  "description": "Spree Commerce developer documentation for AI agents and local reference",
5
5
  "type": "module",
6
6
  "license": "CC-BY-4.0",