chore: add service review add and get in service page and also approve and reject for admin

This commit is contained in:
mahyargdz
2025-02-17 15:08:22 +03:30
parent 763b6b49d9
commit b7cfaf95b2
12 changed files with 186 additions and 47 deletions
@@ -0,0 +1,27 @@
import { Column, Entity, ManyToOne } from "typeorm";
import { DanakService } from "./danak-service.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { User } from "../../users/entities/user.entity";
import { ReviewStatus } from "../enums/review-status.enum";
@Entity()
export class DanakServiceReview extends BaseEntity {
@Column({ type: "text", nullable: false })
comment: string;
@Column({ type: "int", nullable: false })
rating: number;
@Column({ type: "varchar", length: 150, nullable: false })
title: string;
@Column({ type: "enum", enum: ReviewStatus, default: ReviewStatus.PENDING })
status: ReviewStatus;
@ManyToOne(() => User, (user) => user.reviews, { onDelete: "SET NULL" })
user: User;
@ManyToOne(() => DanakService, (service) => service.reviews, { onDelete: "CASCADE" })
service: DanakService;
}