UNPKG

graojs

Version:

graoJS - A full stack MVC NodeJS framework

54 lines (49 loc) 1.07 kB
var CustomersituationSchema = function(di) { var validate = di.validate; var validator = di.validators.customersituation; this.graoui = { bundle: "customer", label: "Customer Situation", description: "All customers situations", refLabel: 'name' }; this.json = { id : di.mongoose.Schema.ObjectId, name : { type : String, required : true, trim : true, unique: true, graoui: { label: "Name", type: 'input', isList: true, isFilter: true } }, code : { type : String, required : true, trim : true, unique: true, lowercase: true, graoui: { label: "Code", type: 'input', isList: true, isFilter: true } }, description : { type : String, graoui: { label: "Description", type: 'textarea', isList: true, isFilter: true } } }; this.mongoose = new di.mongoose.Schema(this.json); }; module.exports = exports = CustomersituationSchema;