database-connector 2.1.0 → 2.1.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 +2 -2
- package/models/Order.js +15 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Changelog - Database Connector Models Refactoring
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Database Indexes Optimization
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
|
|
@@ -181,7 +181,7 @@ After comprehensive analysis of model usage across all microservices (AuthServic
|
|
|
181
181
|
|
|
182
182
|
---
|
|
183
183
|
|
|
184
|
-
##
|
|
184
|
+
## Initial Refactoring
|
|
185
185
|
|
|
186
186
|
### Added
|
|
187
187
|
|
package/models/Order.js
CHANGED
|
@@ -67,7 +67,9 @@ const { policySchema } = require('./Policy');
|
|
|
67
67
|
* properties:
|
|
68
68
|
* totalAmount:
|
|
69
69
|
* type: number
|
|
70
|
-
*
|
|
70
|
+
* paymentMethodId:
|
|
71
|
+
* type: number
|
|
72
|
+
* paymentIntentId:
|
|
71
73
|
* type: number
|
|
72
74
|
* pickUp:
|
|
73
75
|
* type: boolean
|
|
@@ -80,7 +82,7 @@ const { policySchema } = require('./Policy');
|
|
|
80
82
|
* description: Whether order is canceled
|
|
81
83
|
* status:
|
|
82
84
|
* type: string
|
|
83
|
-
* enum: [Pending, InPreparation, LoadingDelivery, OnTheWay, Delivered, AwaitingRecovery, Recovered, Reserved, WaitingForReturn, Returned, UnderRefund, Refunded, succeeded]
|
|
85
|
+
* enum: [Pending, Payed, InPreparation, LoadingDelivery, OnTheWay, Delivered, AwaitingRecovery, Recovered, Reserved, WaitingForReturn, Returned, UnderRefund, Refunded, succeeded]
|
|
84
86
|
* default: Pending
|
|
85
87
|
* description: Order status
|
|
86
88
|
* createdAt:
|
|
@@ -250,18 +252,17 @@ const orderSchema = new mongoose.Schema(
|
|
|
250
252
|
|
|
251
253
|
paymentInfos: {
|
|
252
254
|
totalAmount: { type: Number, required: true },
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
expdate: { type: String, default: null },
|
|
258
|
-
name: { type: String, required: true },
|
|
259
|
-
phone: { type: String, required: true },
|
|
260
|
-
postalCode: { type: String, required: true },
|
|
261
|
-
address_city: { type: String, required: true },
|
|
262
|
-
address_line1: { type: String, required: true },
|
|
263
|
-
address_line2: { type: String, default: "" },
|
|
255
|
+
paymentMethodId: {
|
|
256
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
257
|
+
required: true,
|
|
258
|
+
ref: 'PaymentType',
|
|
264
259
|
},
|
|
260
|
+
paymentIntentId: {
|
|
261
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
262
|
+
required: false,
|
|
263
|
+
ref: 'Payment',
|
|
264
|
+
default: null
|
|
265
|
+
}
|
|
265
266
|
},
|
|
266
267
|
pickUp: { type: Boolean, required: true, default: null },
|
|
267
268
|
delivery: { type: Boolean, required: true, default: null },
|
|
@@ -278,6 +279,7 @@ const orderSchema = new mongoose.Schema(
|
|
|
278
279
|
status: {
|
|
279
280
|
type: String, required: true, enum: [
|
|
280
281
|
'Pending',
|
|
282
|
+
'Payed',
|
|
281
283
|
'InPreparation',
|
|
282
284
|
'LoadingDelivery',
|
|
283
285
|
'OnTheWay',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "database-connector",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.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": {
|