@hed-hog/catalog 0.0.292 → 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 +163 -129
- package/hedhog/data/role.yaml +7 -7
- package/hedhog/data/route.yaml +75 -11
- 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_affiliate_program.yaml +41 -41
- package/hedhog/table/catalog_attribute.yaml +23 -8
- package/hedhog/table/catalog_attribute_group.yaml +18 -18
- package/hedhog/table/catalog_attribute_option.yaml +40 -0
- package/hedhog/table/catalog_brand.yaml +34 -34
- package/hedhog/table/catalog_category.yaml +40 -0
- package/hedhog/table/catalog_category_attribute.yaml +18 -12
- package/hedhog/table/catalog_click_event.yaml +50 -50
- package/hedhog/table/catalog_comparison.yaml +46 -49
- package/hedhog/table/catalog_comparison_highlight.yaml +39 -39
- package/hedhog/table/catalog_comparison_item.yaml +30 -30
- package/hedhog/table/catalog_content_relation.yaml +42 -42
- package/hedhog/table/catalog_import_run.yaml +33 -33
- package/hedhog/table/catalog_import_source.yaml +24 -24
- package/hedhog/table/catalog_merchant.yaml +29 -29
- package/hedhog/table/catalog_offer.yaml +83 -83
- package/hedhog/table/catalog_price_history.yaml +34 -34
- package/hedhog/table/catalog_product.yaml +53 -51
- package/hedhog/table/catalog_product_attribute_value.yaml +43 -30
- package/hedhog/table/catalog_product_category.yaml +16 -16
- package/hedhog/table/catalog_product_image.yaml +34 -34
- package/hedhog/table/catalog_product_score.yaml +38 -38
- package/hedhog/table/catalog_product_site.yaml +47 -47
- package/hedhog/table/catalog_product_tag.yaml +19 -19
- package/hedhog/table/catalog_score_criterion.yaml +37 -20
- package/hedhog/table/catalog_seo_page_rule.yaml +43 -43
- package/hedhog/table/catalog_similarity_rule.yaml +27 -14
- package/hedhog/table/catalog_site.yaml +35 -27
- package/hedhog/table/catalog_site_category.yaml +17 -17
- package/package.json +6 -6
- package/src/catalog-resource.config.ts +132 -105
- package/src/catalog.controller.ts +112 -45
- package/src/catalog.module.ts +5 -1
- package/src/catalog.service.ts +1569 -56
- package/src/index.ts +1 -1
- package/src/language/en.json +4 -4
- package/src/language/pt.json +4 -4
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: comparison_id
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table: catalog_comparison
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: CASCADE
|
|
9
|
-
- name: product_id
|
|
10
|
-
type: fk
|
|
11
|
-
references:
|
|
12
|
-
table: catalog_product
|
|
13
|
-
column: id
|
|
14
|
-
onDelete: CASCADE
|
|
15
|
-
- name: sort_order
|
|
16
|
-
type: int
|
|
17
|
-
default: 0
|
|
18
|
-
- name: is_winner
|
|
19
|
-
type: boolean
|
|
20
|
-
default: false
|
|
21
|
-
- name: badge_label
|
|
22
|
-
type: varchar
|
|
23
|
-
length: 255
|
|
24
|
-
isNullable: true
|
|
25
|
-
- type: created_at
|
|
26
|
-
- type: updated_at
|
|
27
|
-
indices:
|
|
28
|
-
- columns: [comparison_id, product_id]
|
|
29
|
-
isUnique: true
|
|
30
|
-
- columns: [product_id]
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: comparison_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_comparison
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: product_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: catalog_product
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: sort_order
|
|
16
|
+
type: int
|
|
17
|
+
default: 0
|
|
18
|
+
- name: is_winner
|
|
19
|
+
type: boolean
|
|
20
|
+
default: false
|
|
21
|
+
- name: badge_label
|
|
22
|
+
type: varchar
|
|
23
|
+
length: 255
|
|
24
|
+
isNullable: true
|
|
25
|
+
- type: created_at
|
|
26
|
+
- type: updated_at
|
|
27
|
+
indices:
|
|
28
|
+
- columns: [comparison_id, product_id]
|
|
29
|
+
isUnique: true
|
|
30
|
+
- columns: [product_id]
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: site_id
|
|
4
|
-
type: fk
|
|
5
|
-
isNullable: true
|
|
6
|
-
references:
|
|
7
|
-
table: catalog_site
|
|
8
|
-
column: id
|
|
9
|
-
onDelete: SET NULL
|
|
10
|
-
- name: content_id
|
|
11
|
-
type: fk
|
|
12
|
-
references:
|
|
13
|
-
table: content
|
|
14
|
-
column: id
|
|
15
|
-
onDelete: CASCADE
|
|
16
|
-
- name: product_id
|
|
17
|
-
type: fk
|
|
18
|
-
isNullable: true
|
|
19
|
-
references:
|
|
20
|
-
table: catalog_product
|
|
21
|
-
column: id
|
|
22
|
-
onDelete: SET NULL
|
|
23
|
-
- name: comparison_id
|
|
24
|
-
type: fk
|
|
25
|
-
isNullable: true
|
|
26
|
-
references:
|
|
27
|
-
table: catalog_comparison
|
|
28
|
-
column: id
|
|
29
|
-
onDelete: SET NULL
|
|
30
|
-
- name: relation_type
|
|
31
|
-
type: enum
|
|
32
|
-
values: [primary, related, review, guide, faq]
|
|
33
|
-
default: related
|
|
34
|
-
- name: sort_order
|
|
35
|
-
type: int
|
|
36
|
-
default: 0
|
|
37
|
-
- type: created_at
|
|
38
|
-
- type: updated_at
|
|
39
|
-
indices:
|
|
40
|
-
- columns: [product_id, relation_type]
|
|
41
|
-
- columns: [comparison_id, relation_type]
|
|
42
|
-
- columns: [site_id, content_id]
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: site_id
|
|
4
|
+
type: fk
|
|
5
|
+
isNullable: true
|
|
6
|
+
references:
|
|
7
|
+
table: catalog_site
|
|
8
|
+
column: id
|
|
9
|
+
onDelete: SET NULL
|
|
10
|
+
- name: content_id
|
|
11
|
+
type: fk
|
|
12
|
+
references:
|
|
13
|
+
table: content
|
|
14
|
+
column: id
|
|
15
|
+
onDelete: CASCADE
|
|
16
|
+
- name: product_id
|
|
17
|
+
type: fk
|
|
18
|
+
isNullable: true
|
|
19
|
+
references:
|
|
20
|
+
table: catalog_product
|
|
21
|
+
column: id
|
|
22
|
+
onDelete: SET NULL
|
|
23
|
+
- name: comparison_id
|
|
24
|
+
type: fk
|
|
25
|
+
isNullable: true
|
|
26
|
+
references:
|
|
27
|
+
table: catalog_comparison
|
|
28
|
+
column: id
|
|
29
|
+
onDelete: SET NULL
|
|
30
|
+
- name: relation_type
|
|
31
|
+
type: enum
|
|
32
|
+
values: [primary, related, review, guide, faq]
|
|
33
|
+
default: related
|
|
34
|
+
- name: sort_order
|
|
35
|
+
type: int
|
|
36
|
+
default: 0
|
|
37
|
+
- type: created_at
|
|
38
|
+
- type: updated_at
|
|
39
|
+
indices:
|
|
40
|
+
- columns: [product_id, relation_type]
|
|
41
|
+
- columns: [comparison_id, relation_type]
|
|
42
|
+
- columns: [site_id, content_id]
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: source_id
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table: catalog_import_source
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: CASCADE
|
|
9
|
-
- name: started_at
|
|
10
|
-
type: datetime
|
|
11
|
-
- name: finished_at
|
|
12
|
-
type: datetime
|
|
13
|
-
isNullable: true
|
|
14
|
-
- name: status
|
|
15
|
-
type: enum
|
|
16
|
-
values: [pending, running, completed, failed]
|
|
17
|
-
default: pending
|
|
18
|
-
- name: stats_json
|
|
19
|
-
type: json
|
|
20
|
-
isNullable: true
|
|
21
|
-
- name: error_log
|
|
22
|
-
type: text
|
|
23
|
-
isNullable: true
|
|
24
|
-
- name: idempotency_key
|
|
25
|
-
type: varchar
|
|
26
|
-
length: 255
|
|
27
|
-
isNullable: true
|
|
28
|
-
- type: created_at
|
|
29
|
-
- type: updated_at
|
|
30
|
-
indices:
|
|
31
|
-
- columns: [source_id, started_at]
|
|
32
|
-
- columns: [source_id, idempotency_key]
|
|
33
|
-
isUnique: true
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: source_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_import_source
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: started_at
|
|
10
|
+
type: datetime
|
|
11
|
+
- name: finished_at
|
|
12
|
+
type: datetime
|
|
13
|
+
isNullable: true
|
|
14
|
+
- name: status
|
|
15
|
+
type: enum
|
|
16
|
+
values: [pending, running, completed, failed]
|
|
17
|
+
default: pending
|
|
18
|
+
- name: stats_json
|
|
19
|
+
type: json
|
|
20
|
+
isNullable: true
|
|
21
|
+
- name: error_log
|
|
22
|
+
type: text
|
|
23
|
+
isNullable: true
|
|
24
|
+
- name: idempotency_key
|
|
25
|
+
type: varchar
|
|
26
|
+
length: 255
|
|
27
|
+
isNullable: true
|
|
28
|
+
- type: created_at
|
|
29
|
+
- type: updated_at
|
|
30
|
+
indices:
|
|
31
|
+
- columns: [source_id, started_at]
|
|
32
|
+
- columns: [source_id, idempotency_key]
|
|
33
|
+
isUnique: true
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: slug
|
|
4
|
-
type: varchar
|
|
5
|
-
length: 255
|
|
6
|
-
- name: name
|
|
7
|
-
type: varchar
|
|
8
|
-
length: 255
|
|
9
|
-
- name: source_type
|
|
10
|
-
type: enum
|
|
11
|
-
values: [api, feed, file, crawler]
|
|
12
|
-
default: api
|
|
13
|
-
- name: config_json
|
|
14
|
-
type: json
|
|
15
|
-
isNullable: true
|
|
16
|
-
- name: status
|
|
17
|
-
type: enum
|
|
18
|
-
values: [active, inactive]
|
|
19
|
-
default: active
|
|
20
|
-
- type: created_at
|
|
21
|
-
- type: updated_at
|
|
22
|
-
indices:
|
|
23
|
-
- columns: [slug]
|
|
24
|
-
isUnique: true
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: slug
|
|
4
|
+
type: varchar
|
|
5
|
+
length: 255
|
|
6
|
+
- name: name
|
|
7
|
+
type: varchar
|
|
8
|
+
length: 255
|
|
9
|
+
- name: source_type
|
|
10
|
+
type: enum
|
|
11
|
+
values: [api, feed, file, crawler]
|
|
12
|
+
default: api
|
|
13
|
+
- name: config_json
|
|
14
|
+
type: json
|
|
15
|
+
isNullable: true
|
|
16
|
+
- name: status
|
|
17
|
+
type: enum
|
|
18
|
+
values: [active, inactive]
|
|
19
|
+
default: active
|
|
20
|
+
- type: created_at
|
|
21
|
+
- type: updated_at
|
|
22
|
+
indices:
|
|
23
|
+
- columns: [slug]
|
|
24
|
+
isUnique: true
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: slug
|
|
4
|
-
type: varchar
|
|
5
|
-
length: 255
|
|
6
|
-
- name: name
|
|
7
|
-
type: varchar
|
|
8
|
-
length: 255
|
|
9
|
-
- name: status
|
|
10
|
-
type: enum
|
|
11
|
-
values: [active, inactive]
|
|
12
|
-
default: active
|
|
13
|
-
- name: merchant_type
|
|
14
|
-
type: enum
|
|
15
|
-
values: [retailer, marketplace, saas, direct]
|
|
16
|
-
default: retailer
|
|
17
|
-
- name: logo_file_id
|
|
18
|
-
type: fk
|
|
19
|
-
isNullable: true
|
|
20
|
-
references:
|
|
21
|
-
table: file
|
|
22
|
-
column: id
|
|
23
|
-
onDelete: SET NULL
|
|
24
|
-
- type: created_at
|
|
25
|
-
- type: updated_at
|
|
26
|
-
indices:
|
|
27
|
-
- columns: [slug]
|
|
28
|
-
isUnique: true
|
|
29
|
-
- columns: [status]
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: slug
|
|
4
|
+
type: varchar
|
|
5
|
+
length: 255
|
|
6
|
+
- name: name
|
|
7
|
+
type: varchar
|
|
8
|
+
length: 255
|
|
9
|
+
- name: status
|
|
10
|
+
type: enum
|
|
11
|
+
values: [active, inactive]
|
|
12
|
+
default: active
|
|
13
|
+
- name: merchant_type
|
|
14
|
+
type: enum
|
|
15
|
+
values: [retailer, marketplace, saas, direct]
|
|
16
|
+
default: retailer
|
|
17
|
+
- name: logo_file_id
|
|
18
|
+
type: fk
|
|
19
|
+
isNullable: true
|
|
20
|
+
references:
|
|
21
|
+
table: file
|
|
22
|
+
column: id
|
|
23
|
+
onDelete: SET NULL
|
|
24
|
+
- type: created_at
|
|
25
|
+
- type: updated_at
|
|
26
|
+
indices:
|
|
27
|
+
- columns: [slug]
|
|
28
|
+
isUnique: true
|
|
29
|
+
- columns: [status]
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: product_id
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table: catalog_product
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: CASCADE
|
|
9
|
-
- name: merchant_id
|
|
10
|
-
type: fk
|
|
11
|
-
references:
|
|
12
|
-
table: catalog_merchant
|
|
13
|
-
column: id
|
|
14
|
-
onDelete: CASCADE
|
|
15
|
-
- name: affiliate_program_id
|
|
16
|
-
type: fk
|
|
17
|
-
isNullable: true
|
|
18
|
-
references:
|
|
19
|
-
table: catalog_affiliate_program
|
|
20
|
-
column: id
|
|
21
|
-
onDelete: SET NULL
|
|
22
|
-
- name: site_id
|
|
23
|
-
type: fk
|
|
24
|
-
isNullable: true
|
|
25
|
-
references:
|
|
26
|
-
table: catalog_site
|
|
27
|
-
column: id
|
|
28
|
-
onDelete: SET NULL
|
|
29
|
-
- name: external_offer_id
|
|
30
|
-
type: varchar
|
|
31
|
-
length: 255
|
|
32
|
-
- name: title
|
|
33
|
-
type: varchar
|
|
34
|
-
length: 255
|
|
35
|
-
- name: price_amount
|
|
36
|
-
type: decimal
|
|
37
|
-
precision: 14
|
|
38
|
-
scale: 2
|
|
39
|
-
- name: price_currency
|
|
40
|
-
type: varchar
|
|
41
|
-
length: 3
|
|
42
|
-
- name: original_price_amount
|
|
43
|
-
type: decimal
|
|
44
|
-
precision: 14
|
|
45
|
-
scale: 2
|
|
46
|
-
isNullable: true
|
|
47
|
-
- name: installment_json
|
|
48
|
-
type: json
|
|
49
|
-
isNullable: true
|
|
50
|
-
- name: availability_status
|
|
51
|
-
type: enum
|
|
52
|
-
values: [in_stock, out_of_stock, pre_order, unknown]
|
|
53
|
-
default: unknown
|
|
54
|
-
- name: affiliate_url
|
|
55
|
-
type: varchar
|
|
56
|
-
length: 500
|
|
57
|
-
isNullable: true
|
|
58
|
-
- name: deep_link_url
|
|
59
|
-
type: varchar
|
|
60
|
-
length: 500
|
|
61
|
-
isNullable: true
|
|
62
|
-
- name: priority_score
|
|
63
|
-
type: int
|
|
64
|
-
default: 0
|
|
65
|
-
- name: is_featured
|
|
66
|
-
type: boolean
|
|
67
|
-
default: false
|
|
68
|
-
- name: valid_from
|
|
69
|
-
type: datetime
|
|
70
|
-
isNullable: true
|
|
71
|
-
- name: valid_until
|
|
72
|
-
type: datetime
|
|
73
|
-
isNullable: true
|
|
74
|
-
- name: last_seen_at
|
|
75
|
-
type: datetime
|
|
76
|
-
isNullable: true
|
|
77
|
-
- type: created_at
|
|
78
|
-
- type: updated_at
|
|
79
|
-
indices:
|
|
80
|
-
- columns: [product_id, merchant_id, external_offer_id]
|
|
81
|
-
isUnique: true
|
|
82
|
-
- columns: [product_id, availability_status, price_amount]
|
|
83
|
-
- columns: [site_id, is_featured]
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: product_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_product
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: merchant_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: catalog_merchant
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: affiliate_program_id
|
|
16
|
+
type: fk
|
|
17
|
+
isNullable: true
|
|
18
|
+
references:
|
|
19
|
+
table: catalog_affiliate_program
|
|
20
|
+
column: id
|
|
21
|
+
onDelete: SET NULL
|
|
22
|
+
- name: site_id
|
|
23
|
+
type: fk
|
|
24
|
+
isNullable: true
|
|
25
|
+
references:
|
|
26
|
+
table: catalog_site
|
|
27
|
+
column: id
|
|
28
|
+
onDelete: SET NULL
|
|
29
|
+
- name: external_offer_id
|
|
30
|
+
type: varchar
|
|
31
|
+
length: 255
|
|
32
|
+
- name: title
|
|
33
|
+
type: varchar
|
|
34
|
+
length: 255
|
|
35
|
+
- name: price_amount
|
|
36
|
+
type: decimal
|
|
37
|
+
precision: 14
|
|
38
|
+
scale: 2
|
|
39
|
+
- name: price_currency
|
|
40
|
+
type: varchar
|
|
41
|
+
length: 3
|
|
42
|
+
- name: original_price_amount
|
|
43
|
+
type: decimal
|
|
44
|
+
precision: 14
|
|
45
|
+
scale: 2
|
|
46
|
+
isNullable: true
|
|
47
|
+
- name: installment_json
|
|
48
|
+
type: json
|
|
49
|
+
isNullable: true
|
|
50
|
+
- name: availability_status
|
|
51
|
+
type: enum
|
|
52
|
+
values: [in_stock, out_of_stock, pre_order, unknown]
|
|
53
|
+
default: unknown
|
|
54
|
+
- name: affiliate_url
|
|
55
|
+
type: varchar
|
|
56
|
+
length: 500
|
|
57
|
+
isNullable: true
|
|
58
|
+
- name: deep_link_url
|
|
59
|
+
type: varchar
|
|
60
|
+
length: 500
|
|
61
|
+
isNullable: true
|
|
62
|
+
- name: priority_score
|
|
63
|
+
type: int
|
|
64
|
+
default: 0
|
|
65
|
+
- name: is_featured
|
|
66
|
+
type: boolean
|
|
67
|
+
default: false
|
|
68
|
+
- name: valid_from
|
|
69
|
+
type: datetime
|
|
70
|
+
isNullable: true
|
|
71
|
+
- name: valid_until
|
|
72
|
+
type: datetime
|
|
73
|
+
isNullable: true
|
|
74
|
+
- name: last_seen_at
|
|
75
|
+
type: datetime
|
|
76
|
+
isNullable: true
|
|
77
|
+
- type: created_at
|
|
78
|
+
- type: updated_at
|
|
79
|
+
indices:
|
|
80
|
+
- columns: [product_id, merchant_id, external_offer_id]
|
|
81
|
+
isUnique: true
|
|
82
|
+
- columns: [product_id, availability_status, price_amount]
|
|
83
|
+
- columns: [site_id, is_featured]
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: offer_id
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table: catalog_offer
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: CASCADE
|
|
9
|
-
- name: product_id
|
|
10
|
-
type: fk
|
|
11
|
-
references:
|
|
12
|
-
table: catalog_product
|
|
13
|
-
column: id
|
|
14
|
-
onDelete: CASCADE
|
|
15
|
-
- name: captured_at
|
|
16
|
-
type: datetime
|
|
17
|
-
- name: price_amount
|
|
18
|
-
type: decimal
|
|
19
|
-
precision: 14
|
|
20
|
-
scale: 2
|
|
21
|
-
- name: original_price_amount
|
|
22
|
-
type: decimal
|
|
23
|
-
precision: 14
|
|
24
|
-
scale: 2
|
|
25
|
-
isNullable: true
|
|
26
|
-
- name: availability_status
|
|
27
|
-
type: enum
|
|
28
|
-
values: [in_stock, out_of_stock, pre_order, unknown]
|
|
29
|
-
default: unknown
|
|
30
|
-
- type: created_at
|
|
31
|
-
- type: updated_at
|
|
32
|
-
indices:
|
|
33
|
-
- columns: [product_id, captured_at]
|
|
34
|
-
- columns: [offer_id, captured_at]
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: offer_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_offer
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: product_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: catalog_product
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: captured_at
|
|
16
|
+
type: datetime
|
|
17
|
+
- name: price_amount
|
|
18
|
+
type: decimal
|
|
19
|
+
precision: 14
|
|
20
|
+
scale: 2
|
|
21
|
+
- name: original_price_amount
|
|
22
|
+
type: decimal
|
|
23
|
+
precision: 14
|
|
24
|
+
scale: 2
|
|
25
|
+
isNullable: true
|
|
26
|
+
- name: availability_status
|
|
27
|
+
type: enum
|
|
28
|
+
values: [in_stock, out_of_stock, pre_order, unknown]
|
|
29
|
+
default: unknown
|
|
30
|
+
- type: created_at
|
|
31
|
+
- type: updated_at
|
|
32
|
+
indices:
|
|
33
|
+
- columns: [product_id, captured_at]
|
|
34
|
+
- columns: [offer_id, captured_at]
|
|
@@ -1,76 +1,78 @@
|
|
|
1
1
|
columns:
|
|
2
2
|
- type: pk
|
|
3
3
|
- name: brand_id
|
|
4
|
-
type: fk
|
|
5
|
-
isNullable: true
|
|
6
|
-
references:
|
|
7
|
-
table: catalog_brand
|
|
8
|
-
column: id
|
|
9
|
-
onDelete: SET NULL
|
|
10
|
-
- name:
|
|
4
|
+
type: fk
|
|
5
|
+
isNullable: true
|
|
6
|
+
references:
|
|
7
|
+
table: catalog_brand
|
|
8
|
+
column: id
|
|
9
|
+
onDelete: SET NULL
|
|
10
|
+
- name: catalog_category_id
|
|
11
11
|
type: fk
|
|
12
12
|
references:
|
|
13
|
-
table:
|
|
13
|
+
table: catalog_category
|
|
14
14
|
column: id
|
|
15
15
|
onDelete: RESTRICT
|
|
16
|
-
- name: primary_content_id
|
|
17
|
-
type: fk
|
|
18
|
-
isNullable: true
|
|
19
|
-
references:
|
|
20
|
-
table: content
|
|
21
|
-
column: id
|
|
22
|
-
onDelete: SET NULL
|
|
23
|
-
- name: slug
|
|
24
|
-
type: varchar
|
|
25
|
-
length: 255
|
|
26
|
-
- name: name
|
|
27
|
-
type: varchar
|
|
28
|
-
length: 255
|
|
29
|
-
- name: short_description
|
|
30
|
-
type: varchar
|
|
31
|
-
length: 500
|
|
32
|
-
isNullable: true
|
|
33
|
-
- name: description
|
|
34
|
-
type: text
|
|
35
|
-
isNullable: true
|
|
36
|
-
- name: model_name
|
|
37
|
-
type: varchar
|
|
38
|
-
length: 255
|
|
39
|
-
isNullable: true
|
|
40
|
-
- name: sku
|
|
41
|
-
type: varchar
|
|
42
|
-
length: 120
|
|
43
|
-
isNullable: true
|
|
44
|
-
- name: gtin
|
|
45
|
-
type: varchar
|
|
46
|
-
length: 120
|
|
47
|
-
isNullable: true
|
|
48
|
-
- name: status
|
|
49
|
-
type: enum
|
|
50
|
-
values: [draft, published, archived]
|
|
51
|
-
default: draft
|
|
52
|
-
- name: comparison_status
|
|
53
|
-
type: enum
|
|
54
|
-
values: [draft, ready, disabled]
|
|
55
|
-
default: draft
|
|
16
|
+
- name: primary_content_id
|
|
17
|
+
type: fk
|
|
18
|
+
isNullable: true
|
|
19
|
+
references:
|
|
20
|
+
table: content
|
|
21
|
+
column: id
|
|
22
|
+
onDelete: SET NULL
|
|
23
|
+
- name: slug
|
|
24
|
+
type: varchar
|
|
25
|
+
length: 255
|
|
26
|
+
- name: name
|
|
27
|
+
type: varchar
|
|
28
|
+
length: 255
|
|
29
|
+
- name: short_description
|
|
30
|
+
type: varchar
|
|
31
|
+
length: 500
|
|
32
|
+
isNullable: true
|
|
33
|
+
- name: description
|
|
34
|
+
type: text
|
|
35
|
+
isNullable: true
|
|
36
|
+
- name: model_name
|
|
37
|
+
type: varchar
|
|
38
|
+
length: 255
|
|
39
|
+
isNullable: true
|
|
40
|
+
- name: sku
|
|
41
|
+
type: varchar
|
|
42
|
+
length: 120
|
|
43
|
+
isNullable: true
|
|
44
|
+
- name: gtin
|
|
45
|
+
type: varchar
|
|
46
|
+
length: 120
|
|
47
|
+
isNullable: true
|
|
48
|
+
- name: status
|
|
49
|
+
type: enum
|
|
50
|
+
values: [draft, published, archived]
|
|
51
|
+
default: draft
|
|
52
|
+
- name: comparison_status
|
|
53
|
+
type: enum
|
|
54
|
+
values: [draft, ready, disabled]
|
|
55
|
+
default: draft
|
|
56
56
|
- name: release_date
|
|
57
57
|
type: datetime
|
|
58
58
|
isNullable: true
|
|
59
|
+
# Secondary cache/snapshot used for denormalized reads and legacy payload compatibility.
|
|
59
60
|
- name: spec_snapshot_json
|
|
60
61
|
type: json
|
|
61
62
|
isNullable: true
|
|
63
|
+
# Secondary cache/snapshot used for denormalized comparison payloads.
|
|
62
64
|
- name: comparison_snapshot_json
|
|
63
65
|
type: json
|
|
64
66
|
isNullable: true
|
|
65
67
|
- name: is_active
|
|
66
68
|
type: boolean
|
|
67
69
|
default: true
|
|
68
|
-
- type: created_at
|
|
69
|
-
- type: updated_at
|
|
70
|
+
- type: created_at
|
|
71
|
+
- type: updated_at
|
|
70
72
|
indices:
|
|
71
73
|
- columns: [slug]
|
|
72
74
|
isUnique: true
|
|
73
|
-
- columns: [
|
|
75
|
+
- columns: [catalog_category_id, status]
|
|
74
76
|
- columns: [brand_id, status]
|
|
75
77
|
- columns: [primary_content_id]
|
|
76
78
|
- columns: [is_active]
|