Skip to content

Commit

Permalink
#fix: thuanvv convert field customer review
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvanthuan committed Feb 4, 2025
1 parent 33d9acd commit c143792
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ model activity_class {
model customer_reviews {
id Int @id @default(autoincrement()) @db.UnsignedInt
review String? @db.VarChar(500)
rating Int?
score String? @db.VarChar(25)
media_url String @db.VarChar(500)
order Int?
status Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function map(customerReview: CustomerReviewEntity): CustomerReviewDTO {
return {
id: customerReview.id ?? null,
review: customerReview.review ?? null,
rating: customerReview.rating ?? null,
score: customerReview.score ?? null,
media_url: customerReview.media_url,
order: customerReview.order ?? null,
status: customerReview.status,
Expand Down
2 changes: 1 addition & 1 deletion src/domain/dtos/customer-review.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface CustomerReviewDTO {
id: number | null;
review: string | null;
rating: number | null;
score: number | null;
media_url: string;
order: number | null;
status: number;
Expand Down
6 changes: 3 additions & 3 deletions src/domain/entities/customer-review.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export class CustomerReviewEntity {
public id?: number;
public review?: string | null;
public rating?: number | null;
public score?: number | null;
public media_url: string;
public order?: number | null;
public status: number;
Expand All @@ -13,7 +13,7 @@ export class CustomerReviewEntity {
constructor(customerReviewEntity: {
id?: number;
review?: string;
rating?: number;
score?: number;
media_url: string;
order?: number;
status: number;
Expand All @@ -24,7 +24,7 @@ export class CustomerReviewEntity {
}) {
this.id = customerReviewEntity.id;
this.review = customerReviewEntity.review;
this.rating = customerReviewEntity.rating;
this.score = customerReviewEntity.score;
this.media_url = customerReviewEntity.media_url;
this.order = customerReviewEntity.order;
this.status = customerReviewEntity.status;
Expand Down
2 changes: 1 addition & 1 deletion src/web/routes/customer-review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function customerReviewRoutes(fastify: FastifyRouteInstance
properties: {
id: { type: 'integer', nullable: true },
review: { type: 'string', nullable: true },
rating: { type: 'integer', nullable: true },
score: { type: 'integer', nullable: true },
media_url: { type: 'string' },
order: { type: 'integer', nullable: true },
status: { type: 'integer' },
Expand Down

0 comments on commit c143792

Please sign in to comment.