database-connector 2.3.10 → 2.3.11
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/Rayon.js +20 -0
- package/package.json +1 -1
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
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "database-connector",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.11",
|
|
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": {
|