Skip to content

Commit bec9974

Browse files
committed
add sprints model, fix ratings, remove tempdatas model
1 parent 9b0292e commit bec9974

File tree

3 files changed

+36
-85
lines changed

3 files changed

+36
-85
lines changed

src/models/ratings.ts

Lines changed: 5 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ const RatingSchema = new Schema(
88
required: true,
99
},
1010
sprint: {
11-
type: Number,
11+
type: Schema.Types.ObjectId,
12+
ref: 'Sprint',
1213
required: true,
1314
},
1415
phase: {
15-
type: String,
16+
type: Schema.Types.ObjectId,
17+
ref: 'Phase',
1618
required: true,
1719
},
1820
quantity: {
@@ -51,15 +53,6 @@ const RatingSchema = new Schema(
5153
ref: 'User',
5254
required: true,
5355
},
54-
cohort: {
55-
type: Schema.Types.ObjectId,
56-
ref: 'Cohort',
57-
required: true,
58-
},
59-
average: {
60-
type: String,
61-
required: false,
62-
},
6356
organization: {
6457
type: Schema.Types.ObjectId,
6558
ref: 'Organization',
@@ -71,76 +64,4 @@ const RatingSchema = new Schema(
7164

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

74-
const TempData = mongoose.model(
75-
'TempData',
76-
new Schema(
77-
{
78-
user: {
79-
type: Schema.Types.ObjectId,
80-
ref: 'User',
81-
required: true,
82-
},
83-
sprint: {
84-
type: Number,
85-
required: true,
86-
},
87-
quantity: {
88-
type: [String],
89-
default: [],
90-
},
91-
quality: {
92-
type: [String],
93-
default: [],
94-
},
95-
professional_Skills: {
96-
type: [String],
97-
default: [],
98-
},
99-
feedbacks: [
100-
{
101-
sender: {
102-
type: Schema.Types.ObjectId,
103-
ref: 'User',
104-
},
105-
content: {
106-
type: String,
107-
},
108-
createdAt: {
109-
type: Date,
110-
default: new Date(),
111-
},
112-
},
113-
],
114-
oldFeedback: {
115-
type: [String],
116-
default: [],
117-
},
118-
coordinator: {
119-
type: Schema.Types.ObjectId,
120-
ref: 'Cohort',
121-
required: true,
122-
},
123-
cohort: {
124-
type: Schema.Types.ObjectId,
125-
ref: 'Cohort',
126-
required: true,
127-
},
128-
approved: {
129-
type: Boolean,
130-
default: false,
131-
},
132-
average: {
133-
type: String,
134-
required: false,
135-
},
136-
organization: {
137-
type: Schema.Types.ObjectId,
138-
ref: 'Organization',
139-
required: true,
140-
},
141-
},
142-
{ timestamps: true }
143-
)
144-
)
145-
146-
export { Rating, TempData }
67+
export default Rating

src/models/sprint.model.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {Schema, Types, model} from "mongoose"
2+
3+
interface ISprint{
4+
phase: Types.ObjectId,
5+
sprintNbr: number,
6+
startDate: Date,
7+
endDate: Date
8+
}
9+
10+
const sprintSchema = new Schema<ISprint>({
11+
phase:{
12+
type: Schema.Types.ObjectId,
13+
required: true,
14+
},
15+
sprintNbr:{
16+
type: Number,
17+
required: true,
18+
},
19+
startDate:{
20+
type: Date,
21+
default: new Date(),
22+
required: true,
23+
},
24+
endDate:{
25+
type: Date,
26+
required: true,
27+
}
28+
})
29+
30+
const Sprint = model<ISprint>('sprint', sprintSchema)
31+
export default Sprint

src/resolvers/userResolver.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { IOrganization, ORG_STATUS, Organization } from '../models/organization.
2222
import Phase from '../models/phase.model'
2323
import { Profile } from '../models/profile.model'
2424
import Program from '../models/program.model'
25-
import { Rating } from '../models/ratings'
2625
import Team from '../models/team.model'
2726
import { RoleOfUser, User, USER_STATUS_ENUM, UserInterface, UserRole } from '../models/user'
2827
import { pushNotification } from '../utils/notification/pushNotification'

0 commit comments

Comments
 (0)