export type RatingStars = 1 | 2 | 3 | 4 | 5;

export interface RatingDistributionEntry {
  stars: RatingStars;
  count: number;
  share: number;
}

export interface RatingSummary {
  average: number;
  totalReviews: number;
  distribution: RatingDistributionEntry[];
}

export interface Review {
  id: string;
  rating: number;
  title: string;
  text: string;
  author: string;
  anonymous: boolean;
  verifiedPurchase: boolean;
  createdAt: string;
  likes: number;
  dislikes: number;
  photos: string[];
}

export interface Answer {
  id: string;
  text: string;
  author: string;
  createdAt: string;
  isOfficialSeller: boolean;
  isAccepted: boolean;
  likes: number;
  dislikes: number;
}

export interface Question {
  id: string;
  text: string;
  author: string;
  createdAt: string;
  likes: number;
  dislikes: number;
  answers: Answer[];
}

export interface EngagementListQuery {
  page?: number;
  pageSize?: number;
}

export interface EngagementListResult<T> {
  items: T[];
  total: number;
  page: number;
  pageSize: number;
}

export interface SubmitReviewInput {
  rating: number;
  title: string;
  text: string;
  anonymous: boolean;
}

export interface SubmitQuestionInput {
  text: string;
  anonymous: boolean;
}
