@fayz-ai/db 0.24.1 → 0.24.2

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.
@@ -0,0 +1,37 @@
1
+ -- ============================================================================
2
+ -- 209 — the store gets a "Loja" group in the ChefControl and GoControl rails
3
+ --
4
+ -- A tenant's rail is its FIRST app's preset (app_config orders trades first).
5
+ -- Artorius runs ChefControl + StoreControl + GoControl, so it draws the
6
+ -- ChefControl rail, which has no group for the shop's screens: Descontos and
7
+ -- Conteúdo fell loose at the bottom, and nothing said "Loja". StoreControl's
8
+ -- own rail has the group; the trades that also sell online did not.
9
+ --
10
+ -- The group only collects routes that exist: a tenant without the shop sees
11
+ -- no empty heading. /products and /orders stay where these rails already put
12
+ -- them (Estoque, Operação).
13
+ --
14
+ -- Placed right after the Estoque group. Idempotent: skipped where a "Loja"
15
+ -- group is already present.
16
+ -- ============================================================================
17
+
18
+ UPDATE app.apps a
19
+ SET preset = jsonb_set(
20
+ a.preset,
21
+ '{rail}',
22
+ jsonb_insert(
23
+ a.preset -> 'rail',
24
+ ARRAY[(
25
+ SELECT (e.ord)::text
26
+ FROM jsonb_array_elements(a.preset -> 'rail') WITH ORDINALITY AS e(item, ord)
27
+ WHERE e.item ->> 'label' = 'Estoque'
28
+ LIMIT 1
29
+ )],
30
+ '{"icon":"ShoppingBag","label":"Loja","under":["/discounts","/content","/shop"]}'::jsonb
31
+ )
32
+ ),
33
+ updated_at = now()
34
+ WHERE a.id IN ('resto', 'full')
35
+ AND jsonb_typeof(a.preset -> 'rail') = 'array'
36
+ AND EXISTS (SELECT 1 FROM jsonb_array_elements(a.preset -> 'rail') e WHERE e ->> 'label' = 'Estoque')
37
+ AND NOT EXISTS (SELECT 1 FROM jsonb_array_elements(a.preset -> 'rail') e WHERE e ->> 'label' = 'Loja');
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "fayz": {
4
4
  "status": "beta"
5
5
  },
6
- "version": "0.24.1",
6
+ "version": "0.24.2",
7
7
  "description": "Fayz SDK database layer — Drizzle schema primitives, spine references, and migration helpers shared across plugins.",
8
8
  "type": "module",
9
9
  "sideEffects": false,