diff --git a/models/organization.js b/models/organization.js new file mode 100644 index 0000000..d70cfa8 --- /dev/null +++ b/models/organization.js @@ -0,0 +1,14 @@ +import connector from "./databaseUtil"; + +const organizationSchema = { + parent: { type: connector.Schema.Types.ObjectId, ref: "Organization", required: "true" }, + orgID: { type: String, required: true }, + orgName: { type: String, required: true }, + orgAddress: { type: String, required: true }, + orgInfra: [{ type: connector.Schema.Types.ObjectId, ref: "Infrastructure", required: "true" }], + accreditation: { type: connector.Schema.Types.ObjectId, ref: "Accrediation", required: "true" }, + department: [{ type: connector.Schema.Types.ObjectId, ref: "Department", required: "true" }], + employees: [{ type: connector.Schema.Types.ObjectId, ref: "Faculty", required: "true" }], + +}; +const Organization = new connector.model("Organization", organizationSchema);