@hed-hog/finance 0.0.245 → 0.0.246

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.
@@ -58,10 +58,34 @@ SELECT
58
58
  NOW()
59
59
  FROM ordered_missing;
60
60
 
61
+ -- Sincroniza o campo setting.value com os valores atuais da setting_list
62
+ WITH target AS (
63
+ SELECT id
64
+ FROM setting
65
+ WHERE slug = 'storage-accept-mimetype'
66
+ ),
67
+ rebuilt AS (
68
+ SELECT
69
+ t.id,
70
+ COALESCE(
71
+ jsonb_agg(to_jsonb(sl.value) ORDER BY sl."order", sl.id)::text,
72
+ '[]'
73
+ ) AS value_array
74
+ FROM target t
75
+ LEFT JOIN setting_list sl ON sl.setting_id = t.id
76
+ GROUP BY t.id
77
+ )
78
+ UPDATE setting s
79
+ SET value = r.value_array,
80
+ updated_at = NOW()
81
+ FROM rebuilt r
82
+ WHERE s.id = r.id;
83
+
61
84
  -- Verificação
62
85
  SELECT
63
86
  s.id,
64
87
  s.slug,
88
+ s.value,
65
89
  sl."order",
66
90
  sl.value
67
91
  FROM setting s
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/finance",
3
- "version": "0.0.245",
3
+ "version": "0.0.246",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -10,12 +10,12 @@
10
10
  "@nestjs/jwt": "^11",
11
11
  "@nestjs/mapped-types": "*",
12
12
  "@hed-hog/api-pagination": "0.0.5",
13
- "@hed-hog/api-prisma": "0.0.4",
14
13
  "@hed-hog/tag": "0.0.240",
15
- "@hed-hog/api-locale": "0.0.11",
14
+ "@hed-hog/api-prisma": "0.0.4",
16
15
  "@hed-hog/api": "0.0.3",
17
16
  "@hed-hog/contact": "0.0.240",
18
17
  "@hed-hog/api-types": "0.0.1",
18
+ "@hed-hog/api-locale": "0.0.11",
19
19
  "@hed-hog/core": "0.0.240"
20
20
  },
21
21
  "exports": {