Files
DiceCloud/app/imports/api/properties/subSchemas/ItemConsumedSchema.js
2020-04-26 10:28:40 +02:00

23 lines
410 B
JavaScript

import SimpleSchema from 'simpl-schema';
import { Random } from 'meteor/random';
const ItemConsumedSchema = new SimpleSchema({
_id: {
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue(){
if (!this.isSet) return Random.id();
}
},
tag: {
type: String,
optional: true,
},
quantity: {
type: Number,
defaultValue: 1,
},
});
export default ItemConsumedSchema;