Vulcan/packages/vulcan-payments/lib/modules/charges/schema.js

66 lines
877 B
JavaScript
Raw Normal View History

2017-05-31 10:25:13 +09:00
const schema = {
// default properties
_id: {
type: String,
optional: true,
viewableBy: ['guests'],
},
createdAt: {
type: Date,
optional: true,
viewableBy: ['guests'],
onInsert: (document, currentUser) => {
return new Date();
}
},
userId: {
type: String,
optional: true,
viewableBy: ['guests'],
resolveAs: 'user: User', // resolve as "user" on the client
},
// custom properties
tokenId: {
type: String,
optional: false,
},
productKey: {
type: String,
optional: true,
},
type: {
type: String,
optional: false,
},
test: {
type: Boolean,
optional: true,
},
data: {
type: Object,
blackbox: true,
},
properties: {
type: Object,
blackbox: true,
},
ip: {
type: String,
optional: true,
},
};
export default schema;