database-connector 2.0.0 → 2.0.2
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 +0 -5
- package/models/Policy.js +5 -3
- package/models/index.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -32,11 +32,6 @@
|
|
|
32
32
|
- Property types and descriptions with nested object structures
|
|
33
33
|
- Enum values for restricted fields and default values
|
|
34
34
|
- Format specifications (date-time, etc.) and example data for each model
|
|
35
|
-
|
|
36
|
-
- **Policy Model Export**: Converted `Policy.js` from schema-only export to a full standalone model
|
|
37
|
-
- Now exports both `policySchema` (for embedding) and `Policy` model (for standalone use)
|
|
38
|
-
- Maintains backward compatibility with existing code using `policySchema`
|
|
39
|
-
- Added `model` import from mongoose
|
|
40
35
|
|
|
41
36
|
### Changed
|
|
42
37
|
|
package/models/Policy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { Schema
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @swagger
|
|
@@ -126,7 +126,7 @@ const { Schema, model } = require('mongoose');
|
|
|
126
126
|
* ringing:
|
|
127
127
|
* type: boolean
|
|
128
128
|
*/
|
|
129
|
-
|
|
129
|
+
const policySchema = new Schema(
|
|
130
130
|
{
|
|
131
131
|
workingTime: {
|
|
132
132
|
type: {
|
|
@@ -211,4 +211,6 @@ exports.policySchema = new Schema(
|
|
|
211
211
|
{}
|
|
212
212
|
);
|
|
213
213
|
|
|
214
|
-
module.exports =
|
|
214
|
+
module.exports = {
|
|
215
|
+
policySchema
|
|
216
|
+
};
|
package/models/index.js
CHANGED
|
@@ -32,7 +32,7 @@ const SubscriptionOffer = require('./SubscriptionOffer');
|
|
|
32
32
|
const FlashDeal = require('./FlashDeal');
|
|
33
33
|
const Notification = require('./Notification');
|
|
34
34
|
const PaymentType = require('./PaymentType');
|
|
35
|
-
const
|
|
35
|
+
const { policySchema } = require('./policy');
|
|
36
36
|
const ReductionOffer = require('./ReductionOffer');
|
|
37
37
|
const Sale = require('./Sale');
|
|
38
38
|
const StoreCategory = require('./StoreCategory');
|
|
@@ -44,7 +44,7 @@ module.exports = {
|
|
|
44
44
|
configure: config.configure,
|
|
45
45
|
getConfig: config.getConfig,
|
|
46
46
|
PaymentType,
|
|
47
|
-
|
|
47
|
+
policySchema,
|
|
48
48
|
ReductionOffer,
|
|
49
49
|
Sale,
|
|
50
50
|
StoreCategory,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "database-connector",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
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": {
|