Documente Academic
Documente Profesional
Documente Cultură
// Restaurant Master
db.createCollection( "Restaurant Master", {
validator: { $jsonSchema: {
bsonType: "object",
required: [ "RestaurantName" , "RestaurantLogo", "RestaurantCode",
"ContactPersonName", "ContactPersonEmail", "Address", "Password", "AboutRestaurant"
, "IsActive", "CreatedBy", "CreatedOn" ],
properties: {
RestaurantName: {
bsonType: "string",
description: "must be a string and is required"
},
RestaurantLogo: {
bsonType : "string",
description: "must be a string and is required"
} ,
RestaurantCode: {
bsonType: "string",
description: "must be a string and is required"
},
ContactPersonName: {
bsonType : "string",
description: "must be a string and is required"
} ,
ContactPersonEmail: {
bsonType: "string",
pattern : "@mongodb\.com$",
description: "must be a string and match the regular expression
pattern"
},
Address: {
bsonType : "string",
description: "must be a string and is required"
} ,
Password: {
bsonType: "string",
description: "must be a string and is required"
},
AboutRestaurant: {
bsonType : "string",
description: "must be a string and is required"
} ,
IsActive: {
bsonType : "bool",
description: "must be a boolean value and is required"
} ,
CreatedBy: {
bsonType : "objectId",
description: "must be a string and is required"
} ,
CreatedOn: {
bsonType: "date",
description: "must be a Date"
},
ModifiedBy: {
bsonType : "objectId",
description: "must be a string"
} ,
ModifiedOn: {
bsonType : "date",
description: "must be a Date"
}
}
} }
} )
//Role Permission
db.createCollection( "Role Permission", {
validator: { $jsonSchema: {
bsonType: "object",
required: [ "RestaurantId" , "RoleId", "UserId", "PermissionId", "IsActive",
"CreatedBy", "CreatedOn" ],
properties: {
RestaurantId: {
bsonType: "objectId",
description: "must be a objectId and is required"
},
RoleId: {
bsonType : "objectId",
description: "must be a objectId and is required"
} ,
UserId: {
bsonType: "objectId",
description: "must be a objectId and is required"
},
PermissionId: {
bsonType : "objectId",
description: "must be a objectId and is required"
} ,
IsActive: {
bsonType : "bool",
description: "must be a boolean value and is required"
} ,
CreatedBy: {
bsonType : "objectId",
description: "must be a objectId and is required"
} ,
CreatedOn: {
bsonType: "date",
description: "must be a Date and is required"
},
ModifiedBy: {
bsonType : "objectId",
description: "must be a objectId"
} ,
ModifiedOn: {
bsonType : "date",
description: "must be a Date"
}
}
} }
} )
// Subscription Master
db.createCollection( "Subscription Master", {
validator: { $jsonSchema: {
bsonType: "object",
required: [ "SubscriptionName" , "SubscriptionDetail", "Price", "Duration",
"IsActive", "CreatedBy", "CreatedOn" ],
properties: {
SubscriptionName: {
bsonType: "string",
description: "must be a string and is required"
},
SubscriptionDetail: {
bsonType : "string",
description: "must be a string and is required"
} ,
Price: {
bsonType: "number",
description: "must be a number and is required"
},
Duration: {
bsonType : "string",
description: "must be a string and is required"
} ,
IsActive: {
bsonType : "bool",
description: "must be a boolean value and is required"
} ,
CreatedBy: {
bsonType : "objectId",
description: "must be a objectId and is required"
} ,
CreatedOn: {
bsonType: "date",
description: "must be a Date and is required"
},
ModifiedBy: {
bsonType : "objectId",
description: "must be a objectId"
} ,
ModifiedOn: {
bsonType : "date",
description: "must be a Date"
}
}
} }
} )
//Restaurant Subscription
//Roles
db.createCollection( "Roles", {
validator: { $jsonSchema: {
bsonType: "object",
required: [ "RestaurantId" , "RoleName", "IsActive", "CreatedBy",
"CreatedOn" ],
properties: {
RestaurantId: {
bsonType: "objectId",
description: "must be a objectId and is required"
},
RoleName: {
bsonType : "string",
description: "must be a string and is required"
},
IsActive: {
bsonType : "bool",
description: "must be a boolean value and is required"
} ,
CreatedBy: {
bsonType : "objectId",
description: "must be a objectId and is required"
} ,
CreatedOn: {
bsonType: "date",
description: "must be a Date and is required"
},
ModifiedBy: {
bsonType : "objectId",
description: "must be a objectId"
} ,
ModifiedOn: {
bsonType : "date",
description: "must be a Date"
}
}
} }
} )
// Restaurant Users
db.createCollection( "Restaurant Users", {
validator: { $jsonSchema: {
bsonType: "object",
required: [ "RestaurantId" , "RoleId", "FirstName" , "LastName", "UserName",
"Contact", "Address" , "Password" , "Image", "IsActive", "CreatedBy",
"CreatedOn" ],
properties: {
RestaurantId: {
bsonType: "objectId",
description: "must be a objectId and is required"
},
RoleId: {
bsonType: "objectId",
description: "must be a objectId and is required"
},
FirstName: {
bsonType : "string",
description: "must be a string and is required"
},
LastName: {
bsonType : "string",
description: "must be a string and is required"
},
UserName: {
bsonType : "string",
description: "must be a string and is required"
},
Contact: {
bsonType : "string",
description: "must be a string and is required"
},
Address: {
bsonType : "string",
description: "must be a string and is required"
},
Password: {
bsonType : "string",
description: "must be a string and is required"
},
Image: {
bsonType : "object",
description: "must be a string and is required"
},
IsActive: {
bsonType : "bool",
description: "must be a boolean value and is required"
} ,
CreatedBy: {
bsonType : "objectId",
description: "must be a objectId and is required"
} ,
CreatedOn: {
bsonType: "date",
description: "must be a Date and is required"
},
ModifiedBy: {
bsonType : "objectId",
description: "must be a objectId"
} ,
ModifiedOn: {
bsonType : "date",
description: "must be a Date"
}
}
} }
} )
// PremisesTypes
db.createCollection( "PremisesTypes", {
validator: { $jsonSchema: {
bsonType: "object",
required: [ "RestaurantId" , "PremisesType" , "IsActive", "CreatedBy",
"CreatedOn" ],
properties: {
RestaurantId: {
bsonType: "objectId",
description: "must be a objectId and is required"
},
PremisesType: {
bsonType : "string",
description: "must be a string and is required"
},
IsActive: {
bsonType : "bool",
description: "must be a boolean value and is required"
} ,
CreatedBy: {
bsonType : "objectId",
description: "must be a objectId and is required"
} ,
CreatedOn: {
bsonType: "date",
description: "must be a Date and is required"
},
ModifiedBy: {
bsonType : "objectId",
description: "must be a objectId"
} ,
ModifiedOn: {
bsonType : "date",
description: "must be a Date"
}
}
} }
} )
// Restaurant Premises