Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 7 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"bcryptjs": "^2.4.3",
"cloudinary": "^1.30.1",
"cors": "^2.8.5",
"date-fns": "^2.29.2",
"date-fns": "^4.1.0",
"dotenv": "^16.0.1",
"ejs": "^3.1.8",
"express": "^4.18.1",
Expand Down
4 changes: 4 additions & 0 deletions src/models/cohort.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const cohortSchema = new Schema(
ref: 'Organization',
required: true,
},
isDeleted: {
type: Boolean,
default: false
}
},
{
statics: {
Expand Down
4 changes: 4 additions & 0 deletions src/models/program.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const programSchema = new Schema(
required: true,
default: true,
},
isDeleted: {
type: Boolean,
default: false
}
},
{
toObject: { virtuals: true },
Expand Down
89 changes: 5 additions & 84 deletions src/models/ratings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ const RatingSchema = new Schema(
required: true,
},
sprint: {
type: Number,
type: Schema.Types.ObjectId,
ref: 'Sprint',
required: true,
},
phase: {
type: String,
type: Schema.Types.ObjectId,
ref: 'Phase',
required: true,
},
quantity: {
Expand Down Expand Up @@ -46,20 +48,11 @@ const RatingSchema = new Schema(
type: Boolean,
default: true,
},
coordinator: {
type: Schema.Types.ObjectId,
ref: 'User',
required: true,
},
cohort: {
type: Schema.Types.ObjectId,
ref: 'Cohort',
required: true,
},
average: {
type: String,
required: false,
},
organization: {
type: Schema.Types.ObjectId,
ref: 'Organization',
Expand All @@ -71,76 +64,4 @@ const RatingSchema = new Schema(

const Rating = mongoose.model('Rating', RatingSchema)

const TempData = mongoose.model(
'TempData',
new Schema(
{
user: {
type: Schema.Types.ObjectId,
ref: 'User',
required: true,
},
sprint: {
type: Number,
required: true,
},
quantity: {
type: [String],
default: [],
},
quality: {
type: [String],
default: [],
},
professional_Skills: {
type: [String],
default: [],
},
feedbacks: [
{
sender: {
type: Schema.Types.ObjectId,
ref: 'User',
},
content: {
type: String,
},
createdAt: {
type: Date,
default: new Date(),
},
},
],
oldFeedback: {
type: [String],
default: [],
},
coordinator: {
type: Schema.Types.ObjectId,
ref: 'Cohort',
required: true,
},
cohort: {
type: Schema.Types.ObjectId,
ref: 'Cohort',
required: true,
},
approved: {
type: Boolean,
default: false,
},
average: {
type: String,
required: false,
},
organization: {
type: Schema.Types.ObjectId,
ref: 'Organization',
required: true,
},
},
{ timestamps: true }
)
)

export { Rating, TempData }
export default Rating
42 changes: 42 additions & 0 deletions src/models/sprint.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {Schema, Types, model} from "mongoose"

interface ISprint{
phase: Types.ObjectId,
sprintNbr: number,
organization: Types.ObjectId,
startDate: String,
endDate: String,
isDeleted: boolean,
}

const sprintSchema = new Schema<ISprint>({
phase:{
type: Schema.Types.ObjectId,
required: true,
},
sprintNbr:{
type: Number,
required: true,
},
organization:{
type: Schema.Types.ObjectId,
ref:'Organization',
required: true,
},
startDate:{
type: String,
required: true,
},
endDate:{
type: String,
required: true,
},
isDeleted: {
type: Boolean,
default: false,
required: true,
}
})

const Sprint = model<ISprint>('sprint', sprintSchema)
export default Sprint
4 changes: 4 additions & 0 deletions src/models/team.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ const teamSchema = new Schema(
default: true,
required: true,
},
isDeleted: {
type: Boolean,
default: false
}
},
{
statics: {
Expand Down
6 changes: 5 additions & 1 deletion src/models/user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import bcrypt from 'bcryptjs'
import mongoose, { model, Types, Schema, Model } from 'mongoose'
import { Profile } from './profile.model'
import { Rating } from './ratings';
import Rating from './ratings';

export enum USER_STATUS_ENUM{
ACTIVE="active",
Expand Down Expand Up @@ -163,6 +163,10 @@ const userSchema = new Schema<IUser, UserModel, IUserMethods>(
dateOfBirth: {
type: Date,
},
isDeleted: {
type: Boolean,
default: false
}
},

{
Expand Down
Loading
Loading