import type {
  ProductReviewAggregate,
  PublishedReview,
  Review,
  SubmitReviewCommand,
} from './review.js';

export interface ReviewsRepository {
  insert(review: SubmitReviewCommand): Promise<Review | undefined>;
  setStatus(id: string, status: 'published' | 'rejected'): Promise<Review | undefined>;
  listPublishedByProduct(productId: string): Promise<PublishedReview[]>;
  listAll(params?: {
    status?: string;
    limit?: number;
    offset?: number;
  }): Promise<{ items: Review[]; total: number }>;
  aggregate(productId: string): Promise<ProductReviewAggregate>;
  findByOrderItemId(orderItemId: string): Promise<Review | undefined>;
}

export interface OrderItemVerifier {
  isDeliveredForUser(userId: string, orderItemId: string): Promise<boolean>;
}
