@hed-hog/catalog 0.0.276
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/dist/catalog-resource.config.d.ts +12 -0
- package/dist/catalog-resource.config.d.ts.map +1 -0
- package/dist/catalog-resource.config.js +209 -0
- package/dist/catalog-resource.config.js.map +1 -0
- package/dist/catalog.controller.d.ts +29 -0
- package/dist/catalog.controller.d.ts.map +1 -0
- package/dist/catalog.controller.js +117 -0
- package/dist/catalog.controller.js.map +1 -0
- package/dist/catalog.module.d.ts +3 -0
- package/dist/catalog.module.d.ts.map +1 -0
- package/dist/catalog.module.js +25 -0
- package/dist/catalog.module.js.map +1 -0
- package/dist/catalog.service.d.ts +36 -0
- package/dist/catalog.service.d.ts.map +1 -0
- package/dist/catalog.service.js +142 -0
- package/dist/catalog.service.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/hedhog/data/menu.yaml +233 -0
- package/hedhog/data/role.yaml +7 -0
- package/hedhog/data/route.yaml +56 -0
- package/hedhog/frontend/app/[resource]/page.tsx.ejs +684 -0
- package/hedhog/frontend/app/_components/catalog-nav.tsx.ejs +85 -0
- package/hedhog/frontend/app/_lib/catalog-resources.tsx.ejs +569 -0
- package/hedhog/frontend/app/dashboard/page.tsx.ejs +566 -0
- package/hedhog/frontend/app/page.tsx.ejs +5 -0
- package/hedhog/frontend/messages/en.json +293 -0
- package/hedhog/frontend/messages/pt.json +293 -0
- package/hedhog/table/catalog_affiliate_program.yaml +41 -0
- package/hedhog/table/catalog_attribute.yaml +53 -0
- package/hedhog/table/catalog_attribute_group.yaml +18 -0
- package/hedhog/table/catalog_brand.yaml +34 -0
- package/hedhog/table/catalog_category_attribute.yaml +36 -0
- package/hedhog/table/catalog_click_event.yaml +50 -0
- package/hedhog/table/catalog_comparison.yaml +65 -0
- package/hedhog/table/catalog_comparison_highlight.yaml +39 -0
- package/hedhog/table/catalog_comparison_item.yaml +30 -0
- package/hedhog/table/catalog_content_relation.yaml +42 -0
- package/hedhog/table/catalog_import_run.yaml +33 -0
- package/hedhog/table/catalog_import_source.yaml +24 -0
- package/hedhog/table/catalog_merchant.yaml +29 -0
- package/hedhog/table/catalog_offer.yaml +83 -0
- package/hedhog/table/catalog_price_history.yaml +34 -0
- package/hedhog/table/catalog_product.yaml +76 -0
- package/hedhog/table/catalog_product_attribute_value.yaml +60 -0
- package/hedhog/table/catalog_product_category.yaml +26 -0
- package/hedhog/table/catalog_product_image.yaml +34 -0
- package/hedhog/table/catalog_product_score.yaml +38 -0
- package/hedhog/table/catalog_product_site.yaml +47 -0
- package/hedhog/table/catalog_product_tag.yaml +19 -0
- package/hedhog/table/catalog_score_criterion.yaml +37 -0
- package/hedhog/table/catalog_seo_page_rule.yaml +51 -0
- package/hedhog/table/catalog_similarity_rule.yaml +28 -0
- package/hedhog/table/catalog_site.yaml +40 -0
- package/hedhog/table/catalog_site_category.yaml +26 -0
- package/package.json +40 -0
- package/src/catalog-resource.config.ts +218 -0
- package/src/catalog.controller.ts +82 -0
- package/src/catalog.module.ts +12 -0
- package/src/catalog.service.ts +167 -0
- package/src/index.ts +1 -0
- package/src/language/en.json +4 -0
- package/src/language/pt.json +4 -0
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
- type: created_at
|
|
14
|
+
- type: updated_at
|
|
15
|
+
indices:
|
|
16
|
+
- columns: [slug]
|
|
17
|
+
isUnique: true
|
|
18
|
+
- columns: [status]
|
|
@@ -0,0 +1,34 @@
|
|
|
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: normalized_name
|
|
10
|
+
type: varchar
|
|
11
|
+
length: 255
|
|
12
|
+
- name: logo_file_id
|
|
13
|
+
type: fk
|
|
14
|
+
isNullable: true
|
|
15
|
+
references:
|
|
16
|
+
table: file
|
|
17
|
+
column: id
|
|
18
|
+
onDelete: SET NULL
|
|
19
|
+
- name: status
|
|
20
|
+
type: enum
|
|
21
|
+
values: [active, inactive]
|
|
22
|
+
default: active
|
|
23
|
+
- name: website_url
|
|
24
|
+
type: varchar
|
|
25
|
+
length: 500
|
|
26
|
+
isNullable: true
|
|
27
|
+
- type: created_at
|
|
28
|
+
- type: updated_at
|
|
29
|
+
indices:
|
|
30
|
+
- columns: [slug]
|
|
31
|
+
isUnique: true
|
|
32
|
+
- columns: [normalized_name]
|
|
33
|
+
- columns: [logo_file_id]
|
|
34
|
+
- columns: [status]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: category_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: category
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: attribute_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: catalog_attribute
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: is_required
|
|
16
|
+
type: boolean
|
|
17
|
+
default: false
|
|
18
|
+
- name: is_highlighted
|
|
19
|
+
type: boolean
|
|
20
|
+
default: false
|
|
21
|
+
- name: display_order
|
|
22
|
+
type: int
|
|
23
|
+
default: 0
|
|
24
|
+
- name: weight
|
|
25
|
+
type: int
|
|
26
|
+
default: 1
|
|
27
|
+
- name: facet_mode
|
|
28
|
+
type: enum
|
|
29
|
+
values: [default, range, exact, hidden]
|
|
30
|
+
default: default
|
|
31
|
+
- type: created_at
|
|
32
|
+
- type: updated_at
|
|
33
|
+
indices:
|
|
34
|
+
- columns: [category_id, attribute_id]
|
|
35
|
+
isUnique: true
|
|
36
|
+
- columns: [category_id, display_order]
|
|
@@ -0,0 +1,50 @@
|
|
|
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: site_id
|
|
16
|
+
type: fk
|
|
17
|
+
references:
|
|
18
|
+
table: catalog_site
|
|
19
|
+
column: id
|
|
20
|
+
onDelete: CASCADE
|
|
21
|
+
- name: comparison_id
|
|
22
|
+
type: fk
|
|
23
|
+
isNullable: true
|
|
24
|
+
references:
|
|
25
|
+
table: catalog_comparison
|
|
26
|
+
column: id
|
|
27
|
+
onDelete: SET NULL
|
|
28
|
+
- name: clicked_at
|
|
29
|
+
type: datetime
|
|
30
|
+
- name: placement
|
|
31
|
+
type: varchar
|
|
32
|
+
length: 120
|
|
33
|
+
isNullable: true
|
|
34
|
+
- name: utm_json
|
|
35
|
+
type: json
|
|
36
|
+
isNullable: true
|
|
37
|
+
- name: session_hash
|
|
38
|
+
type: varchar
|
|
39
|
+
length: 255
|
|
40
|
+
isNullable: true
|
|
41
|
+
- name: referrer_host
|
|
42
|
+
type: varchar
|
|
43
|
+
length: 255
|
|
44
|
+
isNullable: true
|
|
45
|
+
- type: created_at
|
|
46
|
+
- type: updated_at
|
|
47
|
+
indices:
|
|
48
|
+
- columns: [offer_id, clicked_at]
|
|
49
|
+
- columns: [site_id, clicked_at]
|
|
50
|
+
- columns: [comparison_id, clicked_at]
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: category_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: category
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: RESTRICT
|
|
9
|
+
- name: site_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: catalog_site
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: primary_content_id
|
|
16
|
+
type: fk
|
|
17
|
+
isNullable: true
|
|
18
|
+
references:
|
|
19
|
+
table: content
|
|
20
|
+
column: id
|
|
21
|
+
onDelete: SET NULL
|
|
22
|
+
- name: slug
|
|
23
|
+
type: varchar
|
|
24
|
+
length: 255
|
|
25
|
+
- name: comparison_type
|
|
26
|
+
type: enum
|
|
27
|
+
values: [manual, automatic, similarity, compatibility]
|
|
28
|
+
default: manual
|
|
29
|
+
- name: generation_mode
|
|
30
|
+
type: enum
|
|
31
|
+
values: [manual, automatic]
|
|
32
|
+
default: manual
|
|
33
|
+
- name: status
|
|
34
|
+
type: enum
|
|
35
|
+
values: [draft, published, archived]
|
|
36
|
+
default: draft
|
|
37
|
+
- name: title
|
|
38
|
+
type: varchar
|
|
39
|
+
length: 255
|
|
40
|
+
- name: summary
|
|
41
|
+
type: text
|
|
42
|
+
isNullable: true
|
|
43
|
+
- name: intro
|
|
44
|
+
type: text
|
|
45
|
+
isNullable: true
|
|
46
|
+
- name: verdict
|
|
47
|
+
type: text
|
|
48
|
+
isNullable: true
|
|
49
|
+
- name: spec_snapshot_json
|
|
50
|
+
type: json
|
|
51
|
+
isNullable: true
|
|
52
|
+
- name: eligibility_hash
|
|
53
|
+
type: varchar
|
|
54
|
+
length: 255
|
|
55
|
+
isNullable: true
|
|
56
|
+
- name: published_at
|
|
57
|
+
type: datetime
|
|
58
|
+
isNullable: true
|
|
59
|
+
- type: created_at
|
|
60
|
+
- type: updated_at
|
|
61
|
+
indices:
|
|
62
|
+
- columns: [site_id, slug]
|
|
63
|
+
isUnique: true
|
|
64
|
+
- columns: [category_id, status]
|
|
65
|
+
- columns: [generation_mode, status]
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
isNullable: true
|
|
12
|
+
references:
|
|
13
|
+
table: catalog_product
|
|
14
|
+
column: id
|
|
15
|
+
onDelete: SET NULL
|
|
16
|
+
- name: attribute_id
|
|
17
|
+
type: fk
|
|
18
|
+
isNullable: true
|
|
19
|
+
references:
|
|
20
|
+
table: catalog_attribute
|
|
21
|
+
column: id
|
|
22
|
+
onDelete: SET NULL
|
|
23
|
+
- name: highlight_type
|
|
24
|
+
type: enum
|
|
25
|
+
values: [pro, con, difference, summary, verdict]
|
|
26
|
+
default: summary
|
|
27
|
+
- name: title
|
|
28
|
+
type: varchar
|
|
29
|
+
length: 255
|
|
30
|
+
- name: body
|
|
31
|
+
type: text
|
|
32
|
+
isNullable: true
|
|
33
|
+
- name: sort_order
|
|
34
|
+
type: int
|
|
35
|
+
default: 0
|
|
36
|
+
- type: created_at
|
|
37
|
+
- type: updated_at
|
|
38
|
+
indices:
|
|
39
|
+
- columns: [comparison_id, highlight_type, sort_order]
|
|
@@ -0,0 +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]
|
|
@@ -0,0 +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]
|
|
@@ -0,0 +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
|
|
@@ -0,0 +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
|
|
@@ -0,0 +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]
|
|
@@ -0,0 +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]
|
|
@@ -0,0 +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]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
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: category_id
|
|
11
|
+
type: fk
|
|
12
|
+
references:
|
|
13
|
+
table: category
|
|
14
|
+
column: id
|
|
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
|
|
56
|
+
- name: release_date
|
|
57
|
+
type: datetime
|
|
58
|
+
isNullable: true
|
|
59
|
+
- name: spec_snapshot_json
|
|
60
|
+
type: json
|
|
61
|
+
isNullable: true
|
|
62
|
+
- name: comparison_snapshot_json
|
|
63
|
+
type: json
|
|
64
|
+
isNullable: true
|
|
65
|
+
- name: is_active
|
|
66
|
+
type: boolean
|
|
67
|
+
default: true
|
|
68
|
+
- type: created_at
|
|
69
|
+
- type: updated_at
|
|
70
|
+
indices:
|
|
71
|
+
- columns: [slug]
|
|
72
|
+
isUnique: true
|
|
73
|
+
- columns: [category_id, status]
|
|
74
|
+
- columns: [brand_id, status]
|
|
75
|
+
- columns: [primary_content_id]
|
|
76
|
+
- columns: [is_active]
|
|
@@ -0,0 +1,60 @@
|
|
|
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: attribute_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: catalog_attribute
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: value_text
|
|
16
|
+
type: text
|
|
17
|
+
isNullable: true
|
|
18
|
+
- name: value_number
|
|
19
|
+
type: decimal
|
|
20
|
+
precision: 14
|
|
21
|
+
scale: 4
|
|
22
|
+
isNullable: true
|
|
23
|
+
- name: value_boolean
|
|
24
|
+
type: boolean
|
|
25
|
+
isNullable: true
|
|
26
|
+
- name: value_json
|
|
27
|
+
type: json
|
|
28
|
+
isNullable: true
|
|
29
|
+
- name: value_unit
|
|
30
|
+
type: varchar
|
|
31
|
+
length: 63
|
|
32
|
+
isNullable: true
|
|
33
|
+
- name: normalized_text
|
|
34
|
+
type: varchar
|
|
35
|
+
length: 255
|
|
36
|
+
isNullable: true
|
|
37
|
+
- name: normalized_number
|
|
38
|
+
type: decimal
|
|
39
|
+
precision: 14
|
|
40
|
+
scale: 4
|
|
41
|
+
isNullable: true
|
|
42
|
+
- name: source_type
|
|
43
|
+
type: enum
|
|
44
|
+
values: [manual, import, computed]
|
|
45
|
+
default: manual
|
|
46
|
+
- name: confidence_score
|
|
47
|
+
type: decimal
|
|
48
|
+
precision: 5
|
|
49
|
+
scale: 2
|
|
50
|
+
isNullable: true
|
|
51
|
+
- name: is_verified
|
|
52
|
+
type: boolean
|
|
53
|
+
default: false
|
|
54
|
+
- type: created_at
|
|
55
|
+
- type: updated_at
|
|
56
|
+
indices:
|
|
57
|
+
- columns: [product_id, attribute_id]
|
|
58
|
+
isUnique: true
|
|
59
|
+
- columns: [attribute_id, normalized_number]
|
|
60
|
+
- columns: [attribute_id, normalized_text]
|
|
@@ -0,0 +1,26 @@
|
|
|
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: category_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: category
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: is_primary
|
|
16
|
+
type: boolean
|
|
17
|
+
default: false
|
|
18
|
+
- name: sort_order
|
|
19
|
+
type: int
|
|
20
|
+
default: 0
|
|
21
|
+
- type: created_at
|
|
22
|
+
- type: updated_at
|
|
23
|
+
indices:
|
|
24
|
+
- columns: [product_id, category_id]
|
|
25
|
+
isUnique: true
|
|
26
|
+
- columns: [product_id, is_primary]
|