Skip to content

Commit

Permalink
finished
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanychen committed Mar 17, 2024
1 parent 85fdaad commit da14ead
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/backend/src/reviews/review.entity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
import { Application } from '../applications/application.entity';
import { Rating } from './types';
import { Rating, Stage } from './types';

@Entity()
export class Review {
Expand All @@ -21,6 +21,9 @@ export class Review {
@Column({ nullable: false })
reviewerId: number;

@Column({ type: 'varchar', nullable: false })
stage: Stage;

@Column({ type: 'varchar', nullable: false })
rating: Rating;

Expand Down
1 change: 1 addition & 0 deletions apps/backend/src/reviews/reviews.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class ReviewsController {
return this.reviewsService.createReview(
req.user,
createReviewDTO.applicantId,
createReviewDTO.stage,
createReviewDTO.rating,
createReviewDTO.content,
);
Expand Down
4 changes: 3 additions & 1 deletion apps/backend/src/reviews/reviews.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { MongoRepository } from 'typeorm';
import { Review } from './review.entity';
import { Rating } from './types';
import { Rating, Stage } from './types';
import { ApplicationsService } from '../applications/applications.service';
import { User } from '../users/user.entity';

Expand All @@ -20,6 +20,7 @@ export class ReviewsService {
async createReview(
currentUser: User,
applicantId: number,
stage: Stage,
rating: Rating,
content: string,
): Promise<Review> {
Expand All @@ -30,6 +31,7 @@ export class ReviewsService {
createdAt: new Date(),
updatedAt: new Date(),
application,
stage,
rating,
content,
});
Expand Down

0 comments on commit da14ead

Please sign in to comment.