41 lines
726 B
TypeScript
41 lines
726 B
TypeScript
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;
|
|
}
|