import { type ReviewEntity } from '../entities/review.entity';
import { type ReviewItemData, type ReviewStatsData } from './review-read.dto';

export const REVIEW_REPOSITORY = Symbol('REVIEW_REPOSITORY');

export interface PaginatedResult<T> {
  data: T[];
  total: number;
  page: number;
  limit: number;
  totalPages: number;
}

export interface IReviewRepository {
  findById(id: string): Promise<ReviewEntity | null>;
  findByUserAndTarget(userId: string, targetType: string, targetId: string): Promise<ReviewEntity | null>;
  save(review: ReviewEntity): Promise<void>;
  delete(id: string): Promise<void>;
  findByTarget(targetType: string, targetId: string, page: number, limit: number): Promise<PaginatedResult<ReviewItemData>>;
  findByUserId(userId: string, page: number, limit: number): Promise<PaginatedResult<ReviewItemData>>;
  getStats(targetType: string, targetId: string): Promise<ReviewStatsData>;
}
