Created
January 2, 2020 18:20
-
-
Save thanhtungdp/fef631dfe6d90f66f34944c8d8e69829 to your computer and use it in GitHub Desktop.
billingLog.js
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 BillingLogSchema = new Schema({ | |
sourceId: String, | |
destId: String, | |
debitMoney: { | |
type: Number, | |
default: 0 | |
}, | |
creditMoney: { | |
type: Number, | |
default: 0 | |
}, | |
paymentOrderId: { | |
type: Schema.Types.ObjectId, | |
ref: 'PaymentOrder' | |
}, | |
note: { | |
type: String | |
}, | |
amount: { | |
type: Number, | |
default: 0 // xem lai | |
}, | |
status: { | |
default: 1, | |
type: Number | |
}, | |
balanceType: Number, // 1: TIEN MAT , 2: TIEN THUONG, 3: KHUYEN MAI | |
billingInfo: {}, | |
infoParams: {}, | |
appMode: String, | |
platform: String, | |
createdTime: Number, | |
updatedTime: Number, | |
}); | |
BillingLogSchema.virtual('id').get(function () { | |
return this._id; | |
}); | |
BillingLogSchema.set('toJSON', { virtuals: true }); | |
export default mongoose.model('billing_logs', BillingLogSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment