Created
January 2, 2020 18:44
-
-
Save thanhtungdp/63e3a07f481d1402ee8f2eeb6484e4c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoose from "mongoose"; | |
var { Schema } = mongoose; | |
var PaymentOrderSchema = new Schema({ | |
debitAccount: String,// driver id | |
creditAccountId: String, // guess id | |
balanceType: Number, | |
tripId: { | |
type: String, | |
unique: true, | |
required: true, | |
}, | |
status: { | |
type: Number, | |
default: 1, // 1: PENDING, 2 : DRAFT , 3: APPROVE | |
}, | |
amount: { | |
type: Number, | |
default: 0, | |
}, | |
detailPayment: { | |
type: String, | |
}, | |
appMode: String, // production or development | |
historyRollBack: [ | |
{ | |
createdTime: { type: Number }, | |
statusUpdated: { type: Number }, | |
} | |
], | |
currency: { | |
type: Number, | |
default: 1, // VNG | |
}, | |
createdTime: Number, | |
updatedTime: Number, | |
}); | |
PaymentOrderSchema.virtual('id').get(function () { | |
return this._id; | |
}); | |
PaymentOrderSchema.set('toJSON', { virtuals: true }); | |
export default mongoose.model('payment_orders', PaymentOrderSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment