@pintahub/database-schemas 4.3.8 → 4.4.0

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/CLAUDE.md CHANGED
@@ -82,7 +82,6 @@ index.js # Exports path to schemas/ directory
82
82
  - **ProductRaw** — Raw synced product data from source platforms
83
83
  - **ProductType** — Product type classification
84
84
  - **ProductTag** — Tag with aggregated counts
85
- - **ProductProfile** — Per-product-type settings (features_html, ship_from)
86
85
  - **ProductImport** — Import job tracking (url, platform, status)
87
86
  - **Customize** — Product customization config
88
87
  - **CustomField** — Dynamic fields for customization
@@ -100,7 +99,6 @@ index.js # Exports path to schemas/ directory
100
99
  - **Payout** — Payment payouts (net amount, status, type)
101
100
 
102
101
  ### Content & Pages
103
- - **Page** — Static pages (handle, title, body_html)
104
102
  - **Post** — Blog posts (title, body_html, excerpt, author, tags, SEO)
105
103
  - **Menu** / **MenuItem** — Navigation menus (hierarchical via parent ref)
106
104
  - **AnnouncementBar** — Store banner announcements
@@ -137,6 +135,9 @@ index.js # Exports path to schemas/ directory
137
135
  - **Publication** — Product publication channels
138
136
  - **ShopifyObject** — Synced Shopify data
139
137
 
138
+ ### Reports
139
+ - **CreatorReport** — Monthly creator performance report per store (account ref, period "YYYY-MM", orders_count, items_sold, revenue, ads_spent, profit, status: active|completed|deleted, last_aggregated_at)
140
+
140
141
  ### Reviews
141
142
  - **Review** — Product reviews (vote_value, content, country_code, source)
142
143
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pintahub/database-schemas",
3
- "version": "4.3.8",
3
+ "version": "4.4.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,77 @@
1
+ const {Schema} = require('mongoose')
2
+ const MoneyObject = require('./MoneyObject')
3
+
4
+
5
+ const CreatorReport = new Schema({
6
+ store: {
7
+ type: Schema.Types.ObjectId,
8
+ index: true,
9
+ required: true,
10
+ },
11
+
12
+ account: {
13
+ type: Schema.Types.ObjectId,
14
+ index: true,
15
+ required: true,
16
+ },
17
+
18
+ period: {
19
+ type: String,
20
+ trim: true,
21
+ required: true,
22
+ index: true,
23
+ },
24
+
25
+ orders_count: {
26
+ type: Number,
27
+ default: 0,
28
+ },
29
+
30
+ items_sold: {
31
+ type: Number,
32
+ default: 0,
33
+ },
34
+
35
+ revenue: {
36
+ type: MoneyObject,
37
+ },
38
+
39
+ ads_spent: {
40
+ type: MoneyObject,
41
+ },
42
+
43
+ profit: {
44
+ type: MoneyObject,
45
+ },
46
+
47
+ status: {
48
+ type: String,
49
+ trim: true,
50
+ default: 'active',
51
+ enum: ['active', 'completed', 'deleted'],
52
+ index: true,
53
+ },
54
+
55
+ note: {
56
+ type: String,
57
+ trim: true,
58
+ },
59
+
60
+ last_aggregated_at: {
61
+ type: Date,
62
+ },
63
+
64
+ updated_at: {
65
+ type: Date,
66
+ default: Date.now,
67
+ },
68
+
69
+ created_at: {
70
+ type: Date,
71
+ default: Date.now,
72
+ index: true,
73
+ },
74
+ })
75
+
76
+
77
+ module.exports = CreatorReport
@@ -21,6 +21,12 @@ const OrderItem = new Schema({
21
21
  index: true,
22
22
  },
23
23
 
24
+ cancel_status: {
25
+ type: String,
26
+ trim: true,
27
+ index: true,
28
+ },
29
+
24
30
  product: {
25
31
  type: Schema.Types.ObjectId,
26
32
  index: true,
package/schemas/Page.js DELETED
@@ -1,50 +0,0 @@
1
- const {Schema} = require('mongoose')
2
-
3
-
4
- const Page = new Schema({
5
- store: {
6
- type: Schema.Types.ObjectId,
7
- index: true,
8
- required: true,
9
- },
10
-
11
- id: {
12
- type: String,
13
- index: true,
14
- required: true,
15
- },
16
-
17
- handle: {
18
- type: String,
19
- trim: true,
20
- index: true,
21
- },
22
-
23
- status: {
24
- type: String,
25
- index: true,
26
- },
27
-
28
- title: {
29
- type: String,
30
- trim: true,
31
- },
32
-
33
- body_html: {
34
- type: String,
35
- trim: true,
36
- },
37
-
38
- updated_at: {
39
- type: Date,
40
- default: Date.now
41
- },
42
-
43
- created_at: {
44
- type: Date,
45
- default: Date.now
46
- }
47
- })
48
-
49
- module.exports = Page
50
-
@@ -1,52 +0,0 @@
1
- const {Schema} = require('mongoose')
2
-
3
-
4
- const ProductProfile = new Schema({
5
- store: {
6
- type: Schema.Types.ObjectId,
7
- index: true,
8
- required: true,
9
- },
10
-
11
- product_type: {
12
- type: String,
13
- trim: true,
14
- required: true,
15
- index: true,
16
- },
17
-
18
- features_html: {
19
- type: String,
20
- trim: true,
21
- },
22
-
23
- size_chart_image: {
24
- type: Schema.Types.ObjectId,
25
- ref: 'Image',
26
- },
27
-
28
- ship_from: {
29
- type: String,
30
- trim: true,
31
- },
32
-
33
- status: {
34
- type: String,
35
- enum: ['active', 'inactive'],
36
- default: 'inactive',
37
- index: true,
38
- },
39
-
40
- updated_at: {
41
- type: Date,
42
- default: Date.now,
43
- },
44
-
45
- created_at: {
46
- type: Date,
47
- default: Date.now,
48
- index: true,
49
- }
50
- })
51
-
52
- module.exports = ProductProfile