Role nd token Based Routing completed for Project,trash,home which is in Controller. Token, Auth Purpose,Rolebased middlewares created. Auth API,Project token Based API, Home Token Based API, Trash Token Based API In v1 AuthRoutes
This commit is contained in:
52
src/shared/V1Models/Project/share-model.ts
Normal file
52
src/shared/V1Models/Project/share-model.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
|
||||
export interface IShare extends Document {
|
||||
Createdby: {
|
||||
userId: mongoose.Types.ObjectId;
|
||||
Email: string;
|
||||
};
|
||||
isActive: boolean;
|
||||
Share_People: [
|
||||
{
|
||||
userId: mongoose.Types.ObjectId;
|
||||
Email: string;
|
||||
AccessPoint: string;
|
||||
}
|
||||
];
|
||||
Description: string;
|
||||
createdAt: number;
|
||||
projectId: mongoose.Types.ObjectId;
|
||||
}
|
||||
|
||||
const shareSchema: Schema = new Schema({
|
||||
CreatedBy: {
|
||||
userId: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: "User",
|
||||
required: true,
|
||||
},
|
||||
Email: { type: String, ref: "User", required: true },
|
||||
},
|
||||
isActive: { type: Boolean, default: false },
|
||||
Share_People: [
|
||||
{
|
||||
userId: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
|
||||
Email: { type: String, ref: "User", required: true },
|
||||
AccessPoint: {
|
||||
type: String,
|
||||
default: "Can view",
|
||||
enum: ["Can view", "Can edit", "Can comment"],
|
||||
},
|
||||
},
|
||||
],
|
||||
createdAt: {
|
||||
type: Number,
|
||||
default: Date.now(),
|
||||
},
|
||||
projectId: { type: mongoose.Schema.Types.ObjectId, ref: "Scene" },
|
||||
});
|
||||
const shareModel = (db: any) => {
|
||||
return MainModel(db, "Shared", shareSchema, "Shared");
|
||||
};
|
||||
export default shareModel;
|
||||
Reference in New Issue
Block a user