database-connector 2.5.2 → 2.5.4

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/models/Order.js CHANGED
@@ -241,6 +241,10 @@ const { policySchema } = require('./Policy');
241
241
  * type: string
242
242
  * nullable: true
243
243
  * description: Link to the invoice document
244
+ * currency:
245
+ * type: string
246
+ * nullable: true
247
+ * description: Currency code for the order (e.g. USD, EUR, DZD)
244
248
  * status:
245
249
  * type: string
246
250
  * enum: [Pending, Payed, InPreparation, LoadingDelivery, OnTheWay, Delivered, AwaitingRecovery, Recovered, Reserved, WaitingForReturn, Returned, UnderRefund, Refunded, succeeded]
@@ -468,6 +472,10 @@ const orderSchema = new mongoose.Schema(
468
472
  type: String,
469
473
  default: null,
470
474
  },
475
+ currency: {
476
+ type: String,
477
+ default: null,
478
+ },
471
479
  status: {
472
480
  type: String, required: true, enum: [
473
481
  'Pending',
package/models/Product.js CHANGED
@@ -57,7 +57,7 @@ const { policySchema } = require('database-connector/models/Policy');
57
57
  * description: Product tags
58
58
  * sellerId:
59
59
  * type: string
60
- * description: Reference to seller
60
+ * description: Reference to seller (User model)
61
61
  * storeId:
62
62
  * type: string
63
63
  * description: Reference to store
@@ -162,7 +162,7 @@ const productSchema = new mongoose.Schema(
162
162
  ],
163
163
  sellerId: {
164
164
  type: mongoose.Schema.Types.ObjectId,
165
- ref: 'Seller',
165
+ ref: 'User',
166
166
  required: true,
167
167
  },
168
168
  storeId: {
package/models/Sale.js CHANGED
@@ -37,7 +37,7 @@ const mongoose = require('mongoose');
37
37
  * region: "North Region"
38
38
  */
39
39
  const Sale = new mongoose.Schema({
40
- sellerId: { type: mongoose.Schema.Types.ObjectId, ref: 'Seller' },
40
+ sellerId: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
41
41
  storeId: { type: mongoose.Schema.Types.ObjectId, ref: 'Store' },
42
42
  productId: { type: mongoose.Schema.Types.ObjectId, ref: 'Product' },
43
43
  date: { type: Date, required: true },
package/models/View.js CHANGED
@@ -41,7 +41,7 @@ const mongoose = require('mongoose');
41
41
  * region: "North Region"
42
42
  */
43
43
  const viewsSchema = new mongoose.Schema({
44
- sellerId: { type: mongoose.Schema.Types.ObjectId, ref: 'Seller' },
44
+ sellerId: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
45
45
  clientId: { type: mongoose.Schema.Types.ObjectId, ref: 'Client' },
46
46
  storeId: { type: mongoose.Schema.Types.ObjectId, ref: 'Store' },
47
47
  productId: { type: mongoose.Schema.Types.ObjectId, ref: 'Product' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "database-connector",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "MongoDB models package with Mongoose schemas for e-commerce applications. Includes User, Product, Store, Order and more with built-in validation and virtual properties.",
5
5
  "main": "models/index.js",
6
6
  "scripts": {