database-connector 2.3.8 → 2.3.9
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/CHANGELOG.md +1 -0
- package/models/Product.js +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
- **Product Model**: Updated `rayonId` field to reference the new `Rayon` model
|
|
14
14
|
- Changed from untyped ObjectId to proper `ref: 'Rayon'` reference
|
|
15
15
|
- Updated Swagger documentation to reflect model reference
|
|
16
|
+
- Added `subRayonId` field (ObjectId, nullable) to reference sub-rayons within Rayon model
|
|
16
17
|
- **Store Model**: Refactored `storeRayons` field from embedded objects to ObjectId references
|
|
17
18
|
- Changed from array of embedded objects with `name` field to array of ObjectId references
|
|
18
19
|
- Now references the `Rayon` model for better data normalization
|
package/models/Product.js
CHANGED
|
@@ -42,6 +42,9 @@ const { policySchema } = require('database-connector/models/Policy');
|
|
|
42
42
|
* rayonId:
|
|
43
43
|
* type: string
|
|
44
44
|
* description: Reference to Rayon model
|
|
45
|
+
* subRayonId:
|
|
46
|
+
* type: string
|
|
47
|
+
* description: Reference to sub-rayon within Rayon model
|
|
45
48
|
* images:
|
|
46
49
|
* type: array
|
|
47
50
|
* items:
|
|
@@ -123,6 +126,10 @@ const productSchema = new mongoose.Schema(
|
|
|
123
126
|
ref: 'Rayon',
|
|
124
127
|
// required: true,
|
|
125
128
|
},
|
|
129
|
+
subRayonId: {
|
|
130
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
131
|
+
default: null
|
|
132
|
+
},
|
|
126
133
|
//customCategory: { type: String, required: true },
|
|
127
134
|
//customCategoryId: { type: String, required: true },
|
|
128
135
|
images: [{ type: String, required: true }],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "database-connector",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.9",
|
|
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": {
|