@pintahub/database-schemas 4.4.8 → 4.6.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.
Files changed (73) hide show
  1. package/.claude/settings.local.json +8 -0
  2. package/CLAUDE.md +16 -66
  3. package/package.json +1 -1
  4. package/schemas/Account.js +11 -1
  5. package/schemas/AnnouncementBar.js +12 -1
  6. package/schemas/Artwork.js +12 -1
  7. package/schemas/BlockedLocation.js +6 -0
  8. package/schemas/Collection.js +24 -0
  9. package/schemas/CreatorReport.js +33 -0
  10. package/schemas/CustomField.js +9 -0
  11. package/schemas/Customize.js +13 -0
  12. package/schemas/DimensionObject.js +3 -0
  13. package/schemas/ExportJob.js +19 -1
  14. package/schemas/FavoriteItem.js +8 -1
  15. package/schemas/FieldSetting.js +3 -0
  16. package/schemas/Fulfillment.js +13 -1
  17. package/schemas/Group.js +21 -1
  18. package/schemas/GroupArtwork.js +7 -1
  19. package/schemas/GroupItem.js +9 -1
  20. package/schemas/Image.js +8 -0
  21. package/schemas/ImageObject.js +6 -0
  22. package/schemas/LatestEvent.js +14 -0
  23. package/schemas/LogURL.js +7 -0
  24. package/schemas/MarketingCost.js +13 -0
  25. package/schemas/Media.js +11 -0
  26. package/schemas/MediaUpload.js +16 -1
  27. package/schemas/Menu.js +9 -0
  28. package/schemas/MenuItem.js +14 -0
  29. package/schemas/MoneyObject.js +3 -0
  30. package/schemas/Order.js +38 -1
  31. package/schemas/OrderItem.js +17 -1
  32. package/schemas/Payout.js +10 -1
  33. package/schemas/Post.js +19 -1
  34. package/schemas/PriceRange.js +6 -0
  35. package/schemas/Product.js +67 -5
  36. package/schemas/ProductFeature.js +26 -0
  37. package/schemas/ProductImage.js +15 -0
  38. package/schemas/ProductImport.js +26 -0
  39. package/schemas/ProductRaw.js +22 -0
  40. package/schemas/ProductReport.js +104 -0
  41. package/schemas/ProductTag.js +8 -1
  42. package/schemas/ProductType.js +9 -1
  43. package/schemas/Publication.js +7 -0
  44. package/schemas/RecentView.js +5 -1
  45. package/schemas/Review.js +18 -1
  46. package/schemas/SearchTerm.js +4 -0
  47. package/schemas/Shop.js +10 -0
  48. package/schemas/ShopifyAPI.js +11 -1
  49. package/schemas/ShopifyObject.js +14 -1
  50. package/schemas/ShortDomain.js +10 -1
  51. package/schemas/ShortLog.js +10 -0
  52. package/schemas/ShortUrl.js +14 -0
  53. package/schemas/Store.js +19 -1
  54. package/schemas/StoreEvent.js +13 -1
  55. package/schemas/StoreSetting.js +25 -1
  56. package/schemas/TrackPage.js +9 -1
  57. package/schemas/TransferJob.js +22 -0
  58. package/schemas/User.js +6 -0
  59. package/schemas/WebhookEvent.js +7 -1
  60. package/schemas/products/MediaObject.js +8 -0
  61. package/schemas/products/SeoObject.js +3 -0
  62. package/schemas/products/VideoObject.js +6 -0
  63. package/schemas/types/BrandSettings.js +3 -0
  64. package/schemas/types/DMCASetting.js +3 -0
  65. package/schemas/types/FacebookObject.js +3 -0
  66. package/schemas/types/FooterSetting.js +2 -0
  67. package/schemas/types/FreeShippingSetting.js +3 -0
  68. package/schemas/types/GoogleAnalytics.js +2 -0
  69. package/schemas/types/KlaviyoObject.js +9 -0
  70. package/schemas/types/MerchizeSettings.js +3 -0
  71. package/schemas/types/SocialsObject.js +8 -0
  72. package/schemas/types/TopBarSettings.js +2 -0
  73. package/schemas/types/TrustpilotObject.js +4 -0
@@ -2,44 +2,53 @@ const {Schema} = require('mongoose')
2
2
  const FieldSetting= require('./FieldSetting')
3
3
 
4
4
 
5
+ /** Dynamic field definition for product customization */
5
6
  const CustomField = new Schema({
7
+ /** @ref Customize — parent customization config */
6
8
  customize: {
7
9
  type: Schema.Types.ObjectId,
8
10
  index: true,
9
11
  required: true,
10
12
  },
11
13
 
14
+ /** Field type, e.g. 'text', 'select', 'image' */
12
15
  type: {
13
16
  type: String,
14
17
  trim: true,
15
18
  required: true,
16
19
  },
17
20
 
21
+ /** Field display label */
18
22
  label: {
19
23
  type: String,
20
24
  trim: true,
21
25
  required: true,
22
26
  },
23
27
 
28
+ /** Description */
24
29
  description: {
25
30
  type: String,
26
31
  trim: true,
27
32
  },
28
33
 
34
+ /** Whether this field is required for the customer to fill */
29
35
  required: {
30
36
  type: Boolean,
31
37
  default: true,
32
38
  },
33
39
 
40
+ /** Field configuration (placeholder, max_length, etc.) */
34
41
  settings: {
35
42
  type: FieldSetting,
36
43
  },
37
44
 
45
+ /** Last update timestamp */
38
46
  updated_at: {
39
47
  type: Date,
40
48
  default: Date.now
41
49
  },
42
50
 
51
+ /** Record creation timestamp */
43
52
  created_at: {
44
53
  type: Date,
45
54
  default: Date.now
@@ -1,19 +1,23 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Product customization configuration */
4
5
  const Customize = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** @ref Product */
11
14
  product: {
12
15
  type: Schema.Types.ObjectId,
13
16
  index: true,
14
17
  required: true,
15
18
  },
16
19
 
20
+ /** Unique customization identifier */
17
21
  code: {
18
22
  type: String,
19
23
  required: true,
@@ -21,6 +25,11 @@ const Customize = new Schema({
21
25
  index: true,
22
26
  },
23
27
 
28
+ /**
29
+ * Customization status:
30
+ * - draft: not yet active
31
+ * - active: live on storefront
32
+ */
24
33
  status: {
25
34
  type: String,
26
35
  trim: true,
@@ -29,21 +38,25 @@ const Customize = new Schema({
29
38
  index: true,
30
39
  },
31
40
 
41
+ /** Description */
32
42
  description: {
33
43
  type: String,
34
44
  trim: true,
35
45
  },
36
46
 
47
+ /** Customization version, e.g. 'basic', 'advanced' */
37
48
  version: {
38
49
  type: String,
39
50
  default: 'basic'
40
51
  },
41
52
 
53
+ /** Last update timestamp */
42
54
  updated_at: {
43
55
  type: Date,
44
56
  default: Date.now
45
57
  },
46
58
 
59
+ /** Record creation timestamp */
47
60
  created_at: {
48
61
  type: Date,
49
62
  default: Date.now
@@ -1,13 +1,16 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded sub-document for width/height dimensions */
4
5
  const DimensionObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Width in pixels */
7
9
  width: {
8
10
  type: Number,
9
11
  },
10
12
 
13
+ /** Height in pixels */
11
14
  height: {
12
15
  type: Number,
13
16
  }
@@ -1,34 +1,46 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Data export job for bulk data extraction */
4
5
  const ExportJob = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  required: true,
8
10
  index: true
9
11
  },
10
12
 
13
+ /** Export type, e.g. 'products', 'orders' */
11
14
  zone: {
12
15
  type: String,
13
16
  trim: true,
14
17
  required: true,
15
18
  },
16
19
 
20
+ /** Export template name */
17
21
  template: {
18
22
  type: String,
19
23
  trim: true,
20
24
  },
21
25
 
26
+ /** Query filter criteria */
22
27
  filter: {
23
28
  type: Schema.Types.Mixed,
24
29
  default: {}
25
30
  },
26
31
 
32
+ /** MongoDB query object */
27
33
  query: {
28
34
  type: Schema.Types.Mixed,
29
35
  default: {}
30
36
  },
31
37
 
38
+ /**
39
+ * Export job status:
40
+ * - pending: queued for processing
41
+ * - completed: export finished successfully
42
+ * - failed: export encountered an error
43
+ */
32
44
  status: {
33
45
  type: String,
34
46
  trim: true,
@@ -36,34 +48,41 @@ const ExportJob = new Schema({
36
48
  enum: ['pending', 'completed', 'failed']
37
49
  },
38
50
 
51
+ /** Number of rows processed so far */
39
52
  processing_rows: {
40
53
  type: Number,
41
54
  default: 0,
42
55
  },
43
56
 
57
+ /** Total number of rows to export */
44
58
  rows_count: {
45
59
  type: Number,
46
60
  },
47
61
 
62
+ /** Output file path */
48
63
  path_file: {
49
64
  type: String,
50
65
  trim: true
51
66
  },
52
67
 
68
+ /** Error message if failed */
53
69
  error_message: {
54
70
  type: String,
55
71
  trim: true
56
72
  },
57
73
 
74
+ /** @ref Account — who initiated the export */
58
75
  created_by: {
59
76
  type: Schema.Types.ObjectId,
60
77
  },
61
78
 
79
+ /** Last update timestamp */
62
80
  updated_at: {
63
81
  type: Date,
64
82
  default: Date.now
65
83
  },
66
84
 
85
+ /** Record creation timestamp */
67
86
  created_at: {
68
87
  type: Date,
69
88
  default: Date.now,
@@ -72,4 +91,3 @@ const ExportJob = new Schema({
72
91
  })
73
92
 
74
93
  module.exports = ExportJob
75
-
@@ -1,13 +1,16 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Favorited products per visitor session */
4
5
  const FavoriteItem = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** Visitor session identifier */
11
14
  session_id: {
12
15
  type: String,
13
16
  trim: true,
@@ -15,23 +18,27 @@ const FavoriteItem = new Schema({
15
18
  required: true,
16
19
  },
17
20
 
21
+ /** @ref Product */
18
22
  product: {
19
23
  type: Schema.Types.ObjectId,
20
24
  required: true,
21
25
  },
22
26
 
27
+ /** Product type */
23
28
  product_type: {
24
29
  type: String,
25
30
  trim: true,
26
31
  index: true,
27
32
  },
28
33
 
34
+ /** ISO country code (uppercase) */
29
35
  country: {
30
36
  type: String,
31
37
  trim: true,
32
38
  uppercase: true
33
39
  },
34
40
 
41
+ /** Record creation timestamp */
35
42
  created_at: {
36
43
  type: Date,
37
44
  default: Date.now,
@@ -39,6 +46,7 @@ const FavoriteItem = new Schema({
39
46
  }
40
47
  })
41
48
 
49
+ /** Compound index: one favorite per product per session per store */
42
50
  FavoriteItem.index({
43
51
  store: 1,
44
52
  session_id: 1,
@@ -46,4 +54,3 @@ FavoriteItem.index({
46
54
  })
47
55
 
48
56
  module.exports = FavoriteItem
49
-
@@ -1,14 +1,17 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded settings for CustomField configuration */
4
5
  const FieldSetting = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Input placeholder text */
7
9
  placeholder: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** Maximum character length for input */
12
15
  max_length: {
13
16
  type: Number,
14
17
  },
@@ -1,30 +1,36 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Shipment tracking for orders */
4
5
  const Fulfillment = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** @ref Order */
11
14
  order: {
12
15
  type: Schema.Types.ObjectId,
13
16
  index: true,
14
17
  required: true,
15
18
  },
16
19
 
20
+ /** Shopify fulfillment ID */
17
21
  id: {
18
22
  type: String,
19
23
  trim: true,
20
24
  index: true,
21
25
  },
22
26
 
27
+ /** Display name */
23
28
  name: {
24
29
  type: String,
25
30
  trim: true,
26
31
  },
27
32
 
33
+ /** Shipment status, e.g. 'in_transit', 'delivered' */
28
34
  shipment_status: {
29
35
  type: String,
30
36
  trim: true,
@@ -32,36 +38,43 @@ const Fulfillment = new Schema({
32
38
  index: true,
33
39
  },
34
40
 
41
+ /** Shipment tracking number */
35
42
  tracking_number: {
36
43
  type: String,
37
44
  trim: true,
38
45
  },
39
46
 
47
+ /** Tracking URL for the shipment */
40
48
  tracking_url: {
41
49
  type: String,
42
50
  trim: true,
43
51
  },
44
52
 
53
+ /** Shipping carrier name */
45
54
  tracking_company: {
46
55
  type: String,
47
56
  trim: true,
48
57
  },
49
58
 
59
+ /** Whether to send tracking notification to customer */
50
60
  notify_customer: {
51
61
  type: Boolean,
52
62
  default: false,
53
63
  index: true,
54
64
  },
55
65
 
66
+ /** When the customer was notified */
56
67
  notified_at: {
57
68
  type: Date,
58
69
  },
59
70
 
71
+ /** Last update timestamp */
60
72
  updated_at: {
61
73
  type: Date,
62
74
  default: Date.now
63
75
  },
64
76
 
77
+ /** Record creation timestamp */
65
78
  created_at: {
66
79
  type: Date,
67
80
  default: Date.now,
@@ -70,4 +83,3 @@ const Fulfillment = new Schema({
70
83
  })
71
84
 
72
85
  module.exports = Fulfillment
73
-
package/schemas/Group.js CHANGED
@@ -1,13 +1,16 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Product grouping/bundles */
4
5
  const Group = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** Unique group identifier */
11
14
  code: {
12
15
  required: true,
13
16
  type: String,
@@ -15,50 +18,59 @@ const Group = new Schema({
15
18
  index: true
16
19
  },
17
20
 
21
+ /** External system ID (e.g. from import) */
18
22
  external_id: {
19
23
  type: String,
20
24
  trim: true,
21
25
  index: true
22
26
  },
23
27
 
28
+ /** Display title */
24
29
  title: {
25
30
  type: String,
26
31
  trim: true,
27
32
  },
28
33
 
34
+ /** Description */
29
35
  description: {
30
36
  type: String,
31
37
  trim: true,
32
38
  },
33
39
 
40
+ /** Display label on storefront */
34
41
  label: {
35
42
  type: String,
36
43
  trim: true,
37
44
  },
38
45
 
46
+ /** Number of products in this group */
39
47
  items_count: {
40
48
  type: Number,
41
49
  default: 0,
42
50
  index: true
43
51
  },
44
52
 
53
+ /** Display style, e.g. 'popup', 'inline' */
45
54
  style: {
46
55
  type: String,
47
56
  trim: true,
48
57
  default: 'popup'
49
58
  },
50
59
 
60
+ /** Group color for UI display */
51
61
  color: {
52
62
  type: String,
53
63
  trim: true,
54
64
  },
55
65
 
66
+ /** Tags */
56
67
  tags: {
57
68
  type: [String],
58
69
  default: [],
59
70
  index: true
60
71
  },
61
72
 
73
+ /** Group status, e.g. 'active', 'inactive' */
62
74
  status: {
63
75
  type: String,
64
76
  default: 'active',
@@ -66,6 +78,7 @@ const Group = new Schema({
66
78
  index: true
67
79
  },
68
80
 
81
+ /** Visibility on storefront: 'visible' or 'hidden' */
69
82
  visibility: {
70
83
  type: String,
71
84
  trim: true,
@@ -73,43 +86,51 @@ const Group = new Schema({
73
86
  default: 'visible',
74
87
  },
75
88
 
89
+ /** Extra metadata */
76
90
  meta: {
77
91
  type: Schema.Types.Mixed,
78
92
  default: {}
79
93
  },
80
94
 
95
+ /** @ref Product — representative product for this group */
81
96
  featured_product: {
82
97
  type: Schema.Types.ObjectId,
83
98
  index: true,
84
99
  },
85
100
 
101
+ /** Trello card ID for project tracking */
86
102
  trello_id: {
87
103
  type: String,
88
104
  trim: true,
89
105
  },
90
106
 
107
+ /** Design idea or concept notes */
91
108
  user_idea: {
92
109
  type: String,
93
110
  trim: true,
94
111
  },
95
112
 
113
+ /** Total sales count */
96
114
  sales_count: {
97
115
  type: Number,
98
116
  default: 0,
99
117
  index: true,
100
118
  },
101
119
 
120
+ /** Total page views */
102
121
  views_count: {
103
122
  type: Number,
104
123
  default: 0,
105
124
  index: true,
106
125
  },
107
126
 
127
+ /** Last update timestamp */
108
128
  updated_at: {
109
129
  type: Date,
110
130
  default: Date.now
111
131
  },
112
132
 
133
+ /** Record creation timestamp */
113
134
  created_at: {
114
135
  type: Date,
115
136
  default: Date.now,
@@ -118,4 +139,3 @@ const Group = new Schema({
118
139
  })
119
140
 
120
141
  module.exports = Group
121
-
@@ -1,35 +1,42 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Artwork assigned to a product group */
4
5
  const GroupArtwork = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** @ref Group */
11
14
  group: {
12
15
  type: Schema.Types.ObjectId,
13
16
  index: true,
14
17
  required: true,
15
18
  },
16
19
 
20
+ /** @ref Artwork */
17
21
  artwork: {
18
22
  type: Schema.Types.ObjectId,
19
23
  required: true,
20
24
  },
21
25
 
26
+ /** Print placement, e.g. 'front', 'back' */
22
27
  location: {
23
28
  type: String,
24
29
  trim: true,
25
30
  default: 'front'
26
31
  },
27
32
 
33
+ /** Last update timestamp */
28
34
  updated_at: {
29
35
  type: Date,
30
36
  default: Date.now
31
37
  },
32
38
 
39
+ /** Record creation timestamp */
33
40
  created_at: {
34
41
  type: Date,
35
42
  default: Date.now
@@ -37,4 +44,3 @@ const GroupArtwork = new Schema({
37
44
  })
38
45
 
39
46
  module.exports = GroupArtwork
40
-
@@ -1,46 +1,55 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
+ /** Item within a product group */
3
4
  const GroupItem = new Schema({
5
+ /** @ref Store */
4
6
  store: {
5
7
  type: Schema.Types.ObjectId,
6
8
  index: true,
7
9
  required: true,
8
10
  },
9
11
 
12
+ /** @ref Group */
10
13
  group: {
11
14
  type: Schema.Types.ObjectId,
12
15
  index: true,
13
16
  required: true,
14
17
  },
15
18
 
19
+ /** @ref Product */
16
20
  product: {
17
21
  type: Schema.Types.ObjectId,
18
22
  index: true,
19
23
  required: true,
20
24
  },
21
25
 
26
+ /** Product type */
22
27
  product_type: {
23
28
  type: String,
24
29
  trim: true,
25
30
  index: true,
26
31
  },
27
32
 
33
+ /** Display label for this item in the group */
28
34
  label: {
29
35
  type: String,
30
36
  trim: true,
31
37
  },
32
38
 
39
+ /** Sort order within the group */
33
40
  index: {
34
41
  type: Number,
35
42
  default: 0,
36
43
  index: true,
37
44
  },
38
45
 
46
+ /** Last update timestamp */
39
47
  updated_at: {
40
48
  type: Date,
41
49
  default: Date.now
42
50
  },
43
51
 
52
+ /** Record creation timestamp */
44
53
  created_at: {
45
54
  type: Date,
46
55
  default: Date.now
@@ -48,4 +57,3 @@ const GroupItem = new Schema({
48
57
  })
49
58
 
50
59
  module.exports = GroupItem
51
-
package/schemas/Image.js CHANGED
@@ -2,36 +2,44 @@ const {Schema} = require('mongoose')
2
2
  const DimensionObject = require('./DimensionObject')
3
3
 
4
4
 
5
+ /** Stored image file */
5
6
  const Image = new Schema({
7
+ /** @ref Store */
6
8
  store: {
7
9
  type: Schema.Types.ObjectId,
8
10
  index: true,
9
11
  required: true,
10
12
  },
11
13
 
14
+ /** Storage file path */
12
15
  path: {
13
16
  type: String,
14
17
  trim: true
15
18
  },
16
19
 
20
+ /** Image width/height */
17
21
  dimension: {
18
22
  type: DimensionObject
19
23
  },
20
24
 
25
+ /** MIME type, e.g. image/png */
21
26
  mimetype: {
22
27
  type: String,
23
28
  trim: true,
24
29
  },
25
30
 
31
+ /** File size in bytes */
26
32
  size: {
27
33
  type: Number,
28
34
  },
29
35
 
36
+ /** Last update timestamp */
30
37
  updated_at: {
31
38
  type: Date,
32
39
  default: Date.now
33
40
  },
34
41
 
42
+ /** Record creation timestamp */
35
43
  created_at: {
36
44
  type: Date,
37
45
  default: Date.now