database-connector 2.3.10 → 2.3.12

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 CHANGED
@@ -5,6 +5,7 @@
5
5
  ### Added
6
6
  - **Rayon Model**: Created new independent `Rayon` model for product and store organization
7
7
  - Schema includes `name` field and `subRayons` array for hierarchical organization
8
+ - Added `confirmed` boolean on rayon and sub-rayons (default: false)
8
9
  - Added Swagger documentation for API endpoints
9
10
  - Indexed `name` field for performance optimization
10
11
  - Exported Rayon model in `models/index.js`
package/models/Rayon.js CHANGED
@@ -15,6 +15,10 @@ const mongoose = require('mongoose');
15
15
  * name:
16
16
  * type: string
17
17
  * description: Rayon name
18
+ * confirmed:
19
+ * type: boolean
20
+ * default: false
21
+ * description: Whether the rayon is confirmed
18
22
  * subRayons:
19
23
  * type: array
20
24
  * items:
@@ -23,6 +27,10 @@ const mongoose = require('mongoose');
23
27
  * name:
24
28
  * type: string
25
29
  * description: Sub-rayon name
30
+ * confirmed:
31
+ * type: boolean
32
+ * default: false
33
+ * description: Whether the sub-rayon is confirmed
26
34
  * description: List of sub-rayons within this rayon
27
35
  * createdAt:
28
36
  * type: string
@@ -33,10 +41,14 @@ const mongoose = require('mongoose');
33
41
  * example:
34
42
  * id: "507f1f77bcf86cd799439011"
35
43
  * name: "Electronics"
44
+ * confirmed: false
36
45
  * subRayons:
37
46
  * - name: "Mobile Phones"
47
+ * confirmed: false
38
48
  * - name: "Laptops"
49
+ * confirmed: false
39
50
  * - name: "Accessories"
51
+ * confirmed: false
40
52
  * createdAt: "2025-11-01T10:30:00.000Z"
41
53
  * updatedAt: "2025-12-01T15:45:00.000Z"
42
54
  */
@@ -46,12 +58,20 @@ const rayonSchema = new mongoose.Schema(
46
58
  type: String,
47
59
  required: true,
48
60
  },
61
+ confirmed: {
62
+ type: Boolean,
63
+ default: false,
64
+ },
49
65
  subRayons: [
50
66
  {
51
67
  name: {
52
68
  type: String,
53
69
  required: true,
54
70
  },
71
+ confirmed: {
72
+ type: Boolean,
73
+ default: false,
74
+ },
55
75
  },
56
76
  ],
57
77
  },
@@ -19,6 +19,10 @@ const mongoose = require('mongoose');
19
19
  * type: boolean
20
20
  * default: false
21
21
  * description: Whether the category is confirmed
22
+ * rayonId:
23
+ * type: string
24
+ * nullable: true
25
+ * description: Reference to rayon or sub-rayon (ObjectId)
22
26
  * createdAt:
23
27
  * type: string
24
28
  * format: date-time
@@ -38,7 +42,11 @@ const storeCategorySchema = new mongoose.Schema(
38
42
  type: String,
39
43
  required: true
40
44
  },
41
- confirmed: { type: Boolean, default: false }
45
+ confirmed: { type: Boolean, default: false },
46
+ rayonId: {
47
+ type: mongoose.Schema.Types.ObjectId,
48
+ default: null,
49
+ },
42
50
  },
43
51
  { timestamps: true, toJSON: { virtuals: true } }
44
52
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "database-connector",
3
- "version": "2.3.10",
3
+ "version": "2.3.12",
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": {