{"size": 764, "ext": "js", "max_stars_repo_path": "modules/loyalty/server/models/loyalty.server.model.js", "max_stars_repo_name": "anshaljoshi25/heleiwebapp", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "modules/loyalty/server/models/loyalty.server.model.js", "max_issues_repo_name": "anshaljoshi25/heleiwebapp", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "modules/loyalty/server/models/loyalty.server.model.js", "max_forks_repo_name": "anshaljoshi25/heleiwebapp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.3636363636, "max_line_length": 77, "alphanum_fraction": 0.5759162304}
/**
 * Created by anshal on 3/24/2016.
 */
var mongoose = require('mongoose'),
    Schema = mongoose.Schema,
    validator = require('validator');
/**
 * A Validation function for local strategy properties
 */
var validateLocalStrategyProperty = function (property) {
    return ((this.provider !== 'local' && !this.updated) || property.length);
};


/**
 * loyalty Schema
 */
var LoyaltySchema = new Schema({
    user: {
        type : Schema.ObjectId,
        ref:'User',
    },
    points : {
        type: Number,
        default : 0
    },
    updated: {
        type: Date
    },
    created: {
        type: Date,
        default: Date.now
    }
});


LoyaltySchema.pre('save', function (next) {

    next();
});


mongoose.model('Loyalty', LoyaltySchema);
