@hed-hog/catalog 0.0.293 → 0.0.294
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.
- package/README.md +409 -379
- package/dist/catalog-resource.config.d.ts.map +1 -1
- package/dist/catalog-resource.config.js +51 -24
- package/dist/catalog-resource.config.js.map +1 -1
- package/dist/catalog.controller.d.ts +420 -0
- package/dist/catalog.controller.d.ts.map +1 -1
- package/dist/catalog.controller.js +98 -0
- package/dist/catalog.controller.js.map +1 -1
- package/dist/catalog.module.d.ts.map +1 -1
- package/dist/catalog.module.js +5 -1
- package/dist/catalog.module.js.map +1 -1
- package/dist/catalog.service.d.ts +216 -1
- package/dist/catalog.service.d.ts.map +1 -1
- package/dist/catalog.service.js +1111 -5
- package/dist/catalog.service.js.map +1 -1
- package/hedhog/data/catalog_attribute.yaml +202 -0
- package/hedhog/data/catalog_attribute_option.yaml +109 -0
- package/hedhog/data/catalog_category.yaml +47 -0
- package/hedhog/data/catalog_category_attribute.yaml +209 -0
- package/hedhog/data/menu.yaml +133 -99
- package/hedhog/data/route.yaml +72 -8
- package/hedhog/frontend/app/[resource]/page.tsx.ejs +391 -33
- package/hedhog/frontend/app/_components/catalog-ai-form-assist-dialog.tsx.ejs +340 -0
- package/hedhog/frontend/app/_components/catalog-resource-form-sheet.tsx.ejs +907 -92
- package/hedhog/frontend/app/_lib/catalog-resources.tsx.ejs +929 -1161
- package/hedhog/frontend/messages/en.json +389 -299
- package/hedhog/frontend/messages/pt.json +389 -299
- package/hedhog/table/catalog_attribute.yaml +67 -52
- package/hedhog/table/catalog_attribute_option.yaml +40 -0
- package/hedhog/table/catalog_category.yaml +40 -0
- package/hedhog/table/catalog_category_attribute.yaml +37 -31
- package/hedhog/table/catalog_comparison.yaml +19 -22
- package/hedhog/table/catalog_product.yaml +30 -28
- package/hedhog/table/catalog_product_attribute_value.yaml +44 -31
- package/hedhog/table/catalog_product_category.yaml +13 -13
- package/hedhog/table/catalog_score_criterion.yaml +42 -25
- package/hedhog/table/catalog_seo_page_rule.yaml +10 -10
- package/hedhog/table/catalog_similarity_rule.yaml +33 -20
- package/hedhog/table/catalog_site.yaml +21 -13
- package/hedhog/table/catalog_site_category.yaml +12 -12
- package/package.json +6 -6
- package/src/catalog-resource.config.ts +132 -105
- package/src/catalog.controller.ts +91 -24
- package/src/catalog.module.ts +16 -12
- package/src/catalog.service.ts +1569 -56
|
@@ -1,53 +1,68 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name:
|
|
4
|
-
type:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- name:
|
|
14
|
-
type: varchar
|
|
15
|
-
length: 255
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- name:
|
|
24
|
-
type:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: code
|
|
4
|
+
type: varchar
|
|
5
|
+
length: 120
|
|
6
|
+
- name: group_id
|
|
7
|
+
type: fk
|
|
8
|
+
isNullable: true
|
|
9
|
+
references:
|
|
10
|
+
table: catalog_attribute_group
|
|
11
|
+
column: id
|
|
12
|
+
onDelete: SET NULL
|
|
13
|
+
- name: group_name
|
|
14
|
+
type: varchar
|
|
15
|
+
length: 255
|
|
16
|
+
isNullable: true
|
|
17
|
+
- name: slug
|
|
18
|
+
type: varchar
|
|
19
|
+
length: 255
|
|
20
|
+
- name: name
|
|
21
|
+
type: varchar
|
|
22
|
+
length: 255
|
|
23
|
+
- name: description
|
|
24
|
+
type: text
|
|
25
|
+
isNullable: true
|
|
26
|
+
- name: data_type
|
|
27
|
+
type: enum
|
|
28
|
+
values: [text, long_text, number, boolean, option]
|
|
29
|
+
default: text
|
|
30
|
+
- name: unit
|
|
31
|
+
type: varchar
|
|
32
|
+
length: 63
|
|
33
|
+
isNullable: true
|
|
34
|
+
- name: comparison_mode
|
|
35
|
+
type: enum
|
|
36
|
+
values: [neutral, higher_better, lower_better, boolean_true_better, exact_match]
|
|
37
|
+
default: neutral
|
|
38
|
+
- name: is_filterable
|
|
39
|
+
type: boolean
|
|
33
40
|
default: false
|
|
34
|
-
- name: is_sortable
|
|
35
|
-
type: boolean
|
|
36
|
-
default: false
|
|
37
|
-
- name:
|
|
38
|
-
type: boolean
|
|
39
|
-
default:
|
|
40
|
-
- name:
|
|
41
|
-
type:
|
|
42
|
-
|
|
43
|
-
- name:
|
|
44
|
-
type:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
- columns: [
|
|
41
|
+
- name: is_sortable
|
|
42
|
+
type: boolean
|
|
43
|
+
default: false
|
|
44
|
+
- name: is_comparable
|
|
45
|
+
type: boolean
|
|
46
|
+
default: true
|
|
47
|
+
- name: is_required_default
|
|
48
|
+
type: boolean
|
|
49
|
+
default: false
|
|
50
|
+
- name: status
|
|
51
|
+
type: enum
|
|
52
|
+
values: [active, inactive]
|
|
53
|
+
default: active
|
|
54
|
+
- name: display_order
|
|
55
|
+
type: int
|
|
56
|
+
default: 0
|
|
57
|
+
- type: created_at
|
|
58
|
+
- type: updated_at
|
|
59
|
+
indices:
|
|
60
|
+
- columns: [code]
|
|
61
|
+
isUnique: true
|
|
62
|
+
- columns: [slug]
|
|
63
|
+
isUnique: true
|
|
64
|
+
- columns: [group_id, display_order]
|
|
65
|
+
- columns: [group_name, display_order]
|
|
66
|
+
- columns: [data_type]
|
|
67
|
+
- columns: [is_filterable]
|
|
68
|
+
- columns: [status]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: attribute_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_attribute
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: slug
|
|
10
|
+
type: varchar
|
|
11
|
+
length: 255
|
|
12
|
+
- name: label
|
|
13
|
+
type: varchar
|
|
14
|
+
length: 255
|
|
15
|
+
- name: option_value
|
|
16
|
+
type: varchar
|
|
17
|
+
length: 255
|
|
18
|
+
- name: normalized_value
|
|
19
|
+
type: varchar
|
|
20
|
+
length: 255
|
|
21
|
+
isNullable: true
|
|
22
|
+
- name: sort_order
|
|
23
|
+
type: int
|
|
24
|
+
default: 0
|
|
25
|
+
- name: status
|
|
26
|
+
type: enum
|
|
27
|
+
values: [active, inactive]
|
|
28
|
+
default: active
|
|
29
|
+
- name: is_default
|
|
30
|
+
type: boolean
|
|
31
|
+
default: false
|
|
32
|
+
- type: created_at
|
|
33
|
+
- type: updated_at
|
|
34
|
+
indices:
|
|
35
|
+
- columns: [attribute_id, slug]
|
|
36
|
+
isUnique: true
|
|
37
|
+
- columns: [attribute_id, option_value]
|
|
38
|
+
isUnique: true
|
|
39
|
+
- columns: [attribute_id, sort_order]
|
|
40
|
+
- columns: [status]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: parent_category_id
|
|
4
|
+
type: fk
|
|
5
|
+
isNullable: true
|
|
6
|
+
references:
|
|
7
|
+
table: catalog_category
|
|
8
|
+
column: id
|
|
9
|
+
onDelete: SET NULL
|
|
10
|
+
- name: slug
|
|
11
|
+
type: varchar
|
|
12
|
+
length: 255
|
|
13
|
+
- name: name
|
|
14
|
+
type: varchar
|
|
15
|
+
length: 255
|
|
16
|
+
- name: normalized_name
|
|
17
|
+
type: varchar
|
|
18
|
+
length: 255
|
|
19
|
+
isNullable: true
|
|
20
|
+
- name: description
|
|
21
|
+
type: text
|
|
22
|
+
isNullable: true
|
|
23
|
+
- name: comparison_enabled
|
|
24
|
+
type: boolean
|
|
25
|
+
default: true
|
|
26
|
+
- name: status
|
|
27
|
+
type: enum
|
|
28
|
+
values: [active, inactive]
|
|
29
|
+
default: active
|
|
30
|
+
- name: sort_order
|
|
31
|
+
type: int
|
|
32
|
+
default: 0
|
|
33
|
+
- type: created_at
|
|
34
|
+
- type: updated_at
|
|
35
|
+
indices:
|
|
36
|
+
- columns: [slug]
|
|
37
|
+
isUnique: true
|
|
38
|
+
- columns: [parent_category_id, sort_order]
|
|
39
|
+
- columns: [status]
|
|
40
|
+
- columns: [comparison_enabled]
|
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name:
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table:
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: CASCADE
|
|
9
|
-
- name: attribute_id
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: catalog_category_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_category
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: attribute_id
|
|
10
10
|
type: fk
|
|
11
11
|
references:
|
|
12
12
|
table: catalog_attribute
|
|
13
13
|
column: id
|
|
14
14
|
onDelete: CASCADE
|
|
15
|
-
- name: is_required
|
|
16
|
-
type: boolean
|
|
17
|
-
default: false
|
|
18
|
-
- name:
|
|
19
|
-
type: boolean
|
|
20
|
-
default: false
|
|
21
|
-
- name:
|
|
22
|
-
type:
|
|
23
|
-
default:
|
|
24
|
-
- name:
|
|
25
|
-
type:
|
|
26
|
-
default:
|
|
27
|
-
- name:
|
|
28
|
-
type:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
15
|
+
- name: is_required
|
|
16
|
+
type: boolean
|
|
17
|
+
default: false
|
|
18
|
+
- name: is_highlight
|
|
19
|
+
type: boolean
|
|
20
|
+
default: false
|
|
21
|
+
- name: is_filter_visible
|
|
22
|
+
type: boolean
|
|
23
|
+
default: true
|
|
24
|
+
- name: is_comparison_visible
|
|
25
|
+
type: boolean
|
|
26
|
+
default: true
|
|
27
|
+
- name: sort_order
|
|
28
|
+
type: int
|
|
29
|
+
default: 0
|
|
30
|
+
- name: weight
|
|
31
|
+
type: int
|
|
32
|
+
default: 1
|
|
33
|
+
- name: facet_mode
|
|
34
|
+
type: enum
|
|
35
|
+
values: [default, range, select, hidden]
|
|
36
|
+
default: default
|
|
37
|
+
- type: created_at
|
|
38
|
+
- type: updated_at
|
|
39
|
+
indices:
|
|
40
|
+
- columns: [catalog_category_id, attribute_id]
|
|
41
|
+
isUnique: true
|
|
42
|
+
- columns: [catalog_category_id, sort_order]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name:
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table:
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: RESTRICT
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: catalog_category_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_category
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: RESTRICT
|
|
9
9
|
- name: site_id
|
|
10
10
|
type: fk
|
|
11
11
|
references:
|
|
@@ -43,23 +43,20 @@ columns:
|
|
|
43
43
|
- name: intro
|
|
44
44
|
type: text
|
|
45
45
|
isNullable: true
|
|
46
|
-
- name: verdict
|
|
47
|
-
type: text
|
|
48
|
-
isNullable: true
|
|
49
|
-
- name:
|
|
50
|
-
type:
|
|
51
|
-
|
|
52
|
-
- name: eligibility_hash
|
|
53
|
-
type: varchar
|
|
54
|
-
length: 255
|
|
46
|
+
- name: verdict
|
|
47
|
+
type: text
|
|
48
|
+
isNullable: true
|
|
49
|
+
- name: eligibility_hash
|
|
50
|
+
type: varchar
|
|
51
|
+
length: 255
|
|
55
52
|
isNullable: true
|
|
56
53
|
- name: published_at
|
|
57
54
|
type: datetime
|
|
58
55
|
isNullable: true
|
|
59
56
|
- type: created_at
|
|
60
57
|
- type: updated_at
|
|
61
|
-
indices:
|
|
62
|
-
- columns: [site_id, slug]
|
|
63
|
-
isUnique: true
|
|
64
|
-
- columns: [
|
|
65
|
-
- columns: [generation_mode, status]
|
|
58
|
+
indices:
|
|
59
|
+
- columns: [site_id, slug]
|
|
60
|
+
isUnique: true
|
|
61
|
+
- columns: [catalog_category_id, status]
|
|
62
|
+
- columns: [generation_mode, status]
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: brand_id
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: brand_id
|
|
4
4
|
type: fk
|
|
5
5
|
isNullable: true
|
|
6
6
|
references:
|
|
7
7
|
table: catalog_brand
|
|
8
8
|
column: id
|
|
9
9
|
onDelete: SET NULL
|
|
10
|
-
- name:
|
|
11
|
-
type: fk
|
|
12
|
-
references:
|
|
13
|
-
table:
|
|
14
|
-
column: id
|
|
15
|
-
onDelete: RESTRICT
|
|
10
|
+
- name: catalog_category_id
|
|
11
|
+
type: fk
|
|
12
|
+
references:
|
|
13
|
+
table: catalog_category
|
|
14
|
+
column: id
|
|
15
|
+
onDelete: RESTRICT
|
|
16
16
|
- name: primary_content_id
|
|
17
17
|
type: fk
|
|
18
18
|
isNullable: true
|
|
@@ -53,24 +53,26 @@ columns:
|
|
|
53
53
|
type: enum
|
|
54
54
|
values: [draft, ready, disabled]
|
|
55
55
|
default: draft
|
|
56
|
-
- name: release_date
|
|
57
|
-
type: datetime
|
|
58
|
-
isNullable: true
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
- name: release_date
|
|
57
|
+
type: datetime
|
|
58
|
+
isNullable: true
|
|
59
|
+
# Secondary cache/snapshot used for denormalized reads and legacy payload compatibility.
|
|
60
|
+
- name: spec_snapshot_json
|
|
61
|
+
type: json
|
|
62
|
+
isNullable: true
|
|
63
|
+
# Secondary cache/snapshot used for denormalized comparison payloads.
|
|
64
|
+
- name: comparison_snapshot_json
|
|
65
|
+
type: json
|
|
66
|
+
isNullable: true
|
|
67
|
+
- name: is_active
|
|
68
|
+
type: boolean
|
|
69
|
+
default: true
|
|
68
70
|
- type: created_at
|
|
69
71
|
- type: updated_at
|
|
70
|
-
indices:
|
|
71
|
-
- columns: [slug]
|
|
72
|
-
isUnique: true
|
|
73
|
-
- columns: [
|
|
74
|
-
- columns: [brand_id, status]
|
|
75
|
-
- columns: [primary_content_id]
|
|
76
|
-
- columns: [is_active]
|
|
72
|
+
indices:
|
|
73
|
+
- columns: [slug]
|
|
74
|
+
isUnique: true
|
|
75
|
+
- columns: [catalog_category_id, status]
|
|
76
|
+
- columns: [brand_id, status]
|
|
77
|
+
- columns: [primary_content_id]
|
|
78
|
+
- columns: [is_active]
|
|
@@ -1,39 +1,50 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: product_id
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: product_id
|
|
4
4
|
type: fk
|
|
5
5
|
references:
|
|
6
6
|
table: catalog_product
|
|
7
7
|
column: id
|
|
8
8
|
onDelete: CASCADE
|
|
9
|
-
- name: attribute_id
|
|
10
|
-
type: fk
|
|
11
|
-
references:
|
|
12
|
-
table: catalog_attribute
|
|
13
|
-
column: id
|
|
14
|
-
onDelete: CASCADE
|
|
15
|
-
- name:
|
|
16
|
-
type:
|
|
17
|
-
isNullable: true
|
|
9
|
+
- name: attribute_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: catalog_attribute
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: attribute_option_id
|
|
16
|
+
type: fk
|
|
17
|
+
isNullable: true
|
|
18
|
+
references:
|
|
19
|
+
table: catalog_attribute_option
|
|
20
|
+
column: id
|
|
21
|
+
onDelete: SET NULL
|
|
22
|
+
- name: value_text
|
|
23
|
+
type: text
|
|
24
|
+
isNullable: true
|
|
18
25
|
- name: value_number
|
|
19
26
|
type: decimal
|
|
20
27
|
precision: 14
|
|
21
28
|
scale: 4
|
|
22
29
|
isNullable: true
|
|
23
|
-
- name: value_boolean
|
|
24
|
-
type: boolean
|
|
25
|
-
isNullable: true
|
|
26
|
-
- name:
|
|
27
|
-
type:
|
|
28
|
-
isNullable: true
|
|
29
|
-
- name: value_unit
|
|
30
|
-
type: varchar
|
|
31
|
-
length: 63
|
|
32
|
-
isNullable: true
|
|
33
|
-
- name:
|
|
34
|
-
type: varchar
|
|
35
|
-
length: 255
|
|
36
|
-
isNullable: true
|
|
30
|
+
- name: value_boolean
|
|
31
|
+
type: boolean
|
|
32
|
+
isNullable: true
|
|
33
|
+
- name: raw_value
|
|
34
|
+
type: text
|
|
35
|
+
isNullable: true
|
|
36
|
+
- name: value_unit
|
|
37
|
+
type: varchar
|
|
38
|
+
length: 63
|
|
39
|
+
isNullable: true
|
|
40
|
+
- name: normalized_value
|
|
41
|
+
type: varchar
|
|
42
|
+
length: 255
|
|
43
|
+
isNullable: true
|
|
44
|
+
- name: normalized_text
|
|
45
|
+
type: varchar
|
|
46
|
+
length: 255
|
|
47
|
+
isNullable: true
|
|
37
48
|
- name: normalized_number
|
|
38
49
|
type: decimal
|
|
39
50
|
precision: 14
|
|
@@ -53,8 +64,10 @@ columns:
|
|
|
53
64
|
default: false
|
|
54
65
|
- type: created_at
|
|
55
66
|
- type: updated_at
|
|
56
|
-
indices:
|
|
57
|
-
- columns: [product_id, attribute_id]
|
|
58
|
-
isUnique: true
|
|
59
|
-
- columns: [attribute_id,
|
|
60
|
-
- columns: [attribute_id,
|
|
67
|
+
indices:
|
|
68
|
+
- columns: [product_id, attribute_id]
|
|
69
|
+
isUnique: true
|
|
70
|
+
- columns: [attribute_id, attribute_option_id]
|
|
71
|
+
- columns: [attribute_id, normalized_value]
|
|
72
|
+
- columns: [attribute_id, normalized_number]
|
|
73
|
+
- columns: [attribute_id, normalized_text]
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: product_id
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: product_id
|
|
4
4
|
type: fk
|
|
5
5
|
references:
|
|
6
6
|
table: catalog_product
|
|
7
7
|
column: id
|
|
8
8
|
onDelete: CASCADE
|
|
9
|
-
- name:
|
|
10
|
-
type: fk
|
|
11
|
-
references:
|
|
12
|
-
table:
|
|
13
|
-
column: id
|
|
14
|
-
onDelete: CASCADE
|
|
9
|
+
- name: catalog_category_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: catalog_category
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
15
|
- name: is_primary
|
|
16
16
|
type: boolean
|
|
17
17
|
default: false
|
|
@@ -20,7 +20,7 @@ columns:
|
|
|
20
20
|
default: 0
|
|
21
21
|
- type: created_at
|
|
22
22
|
- type: updated_at
|
|
23
|
-
indices:
|
|
24
|
-
- columns: [product_id,
|
|
25
|
-
isUnique: true
|
|
26
|
-
- columns: [product_id, is_primary]
|
|
23
|
+
indices:
|
|
24
|
+
- columns: [product_id, catalog_category_id]
|
|
25
|
+
isUnique: true
|
|
26
|
+
- columns: [product_id, is_primary]
|
|
@@ -1,37 +1,54 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name:
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table:
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: CASCADE
|
|
9
|
-
- name:
|
|
10
|
-
type:
|
|
11
|
-
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: catalog_category_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_category
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: attribute_id
|
|
10
|
+
type: fk
|
|
11
|
+
isNullable: true
|
|
12
|
+
references:
|
|
13
|
+
table: catalog_attribute
|
|
14
|
+
column: id
|
|
15
|
+
onDelete: SET NULL
|
|
16
|
+
- name: target_option_id
|
|
17
|
+
type: fk
|
|
18
|
+
isNullable: true
|
|
19
|
+
references:
|
|
20
|
+
table: catalog_attribute_option
|
|
21
|
+
column: id
|
|
22
|
+
onDelete: SET NULL
|
|
23
|
+
- name: slug
|
|
24
|
+
type: varchar
|
|
25
|
+
length: 255
|
|
12
26
|
- name: name
|
|
13
27
|
type: varchar
|
|
14
28
|
length: 255
|
|
15
29
|
- name: weight
|
|
16
30
|
type: int
|
|
17
31
|
default: 1
|
|
18
|
-
- name: score_type
|
|
19
|
-
type: enum
|
|
20
|
-
values: [manual,
|
|
21
|
-
default: manual
|
|
22
|
-
- name:
|
|
23
|
-
type:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
- name: score_type
|
|
33
|
+
type: enum
|
|
34
|
+
values: [manual, attribute_value, option_match]
|
|
35
|
+
default: manual
|
|
36
|
+
- name: max_score
|
|
37
|
+
type: decimal
|
|
38
|
+
precision: 5
|
|
39
|
+
scale: 2
|
|
40
|
+
default: 10
|
|
41
|
+
- name: display_order
|
|
42
|
+
type: int
|
|
43
|
+
default: 0
|
|
28
44
|
- name: status
|
|
29
45
|
type: enum
|
|
30
46
|
values: [active, inactive]
|
|
31
47
|
default: active
|
|
32
48
|
- type: created_at
|
|
33
49
|
- type: updated_at
|
|
34
|
-
indices:
|
|
35
|
-
- columns: [
|
|
36
|
-
isUnique: true
|
|
37
|
-
- columns: [
|
|
50
|
+
indices:
|
|
51
|
+
- columns: [catalog_category_id, slug]
|
|
52
|
+
isUnique: true
|
|
53
|
+
- columns: [catalog_category_id, status]
|
|
54
|
+
- columns: [attribute_id, status]
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: site_id
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: site_id
|
|
4
4
|
type: fk
|
|
5
5
|
references:
|
|
6
6
|
table: catalog_site
|
|
7
7
|
column: id
|
|
8
8
|
onDelete: CASCADE
|
|
9
|
-
- name:
|
|
10
|
-
type: fk
|
|
11
|
-
isNullable: true
|
|
12
|
-
references:
|
|
13
|
-
table:
|
|
14
|
-
column: id
|
|
15
|
-
onDelete: SET NULL
|
|
9
|
+
- name: catalog_category_id
|
|
10
|
+
type: fk
|
|
11
|
+
isNullable: true
|
|
12
|
+
references:
|
|
13
|
+
table: catalog_category
|
|
14
|
+
column: id
|
|
15
|
+
onDelete: SET NULL
|
|
16
16
|
- name: page_type
|
|
17
17
|
type: enum
|
|
18
18
|
values: [comparison, best_of, cost_benefit, attribute, price_range, brand, use_case]
|