feat(ADM-018): completed feature
This commit is contained in:
40
project/src/modules/reviews/domain/review.ts
Normal file
40
project/src/modules/reviews/domain/review.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
export type ReviewStatus = 'pending' | 'published' | 'rejected';
|
||||
|
||||
export interface Review {
|
||||
id: string;
|
||||
userId: string;
|
||||
productId: string;
|
||||
orderId: string;
|
||||
orderItemId: string;
|
||||
rating: number;
|
||||
title: string;
|
||||
body: string;
|
||||
status: ReviewStatus;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface SubmitReviewCommand {
|
||||
userId: string;
|
||||
productId: string;
|
||||
orderItemId: string;
|
||||
rating: number;
|
||||
title: string;
|
||||
body: string;
|
||||
}
|
||||
|
||||
export interface ProductReviewAggregate {
|
||||
productId: string;
|
||||
averageRating: number;
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface PublishedReview {
|
||||
id: string;
|
||||
productId: string;
|
||||
userId: string;
|
||||
rating: number;
|
||||
title: string;
|
||||
body: string;
|
||||
createdAt: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user