import type { IResponse } from "@/types/response.types";
import type { RowDataType } from "@/components/types/TableTypes";

export interface ReviewFood {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  restaurant: string;
  category: string;
  title: string;
  desc: string;
  content: string | null;
  price: number;
  points: number | null;
  order: number | null;
  prepareTime: number | null;
  sat: boolean;
  sun: boolean;
  mon: boolean;
  breakfast: boolean;
  noon: boolean;
  dinner: boolean;
  stock: number;
  stockDefault: number;
  isActive: boolean;
  images: string[];
  inPlaceServe: boolean;
  pickupServe: boolean;
  rate: number;
  discount: number;
  isSpecialOffer: boolean;
}

export interface ReviewUser {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  firstName: string;
  lastName: string;
  birthDate: string;
  marriageDate: string;
  referrer: string | null;
  isActive: boolean;
  gender: boolean;
  wallet: number;
  points: number;
  phone: string;
}

export interface ReviewOrder {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  user: string;
  restaurant: string;
  deliveryMethod: string;
  address: string;
  paymentMethod: string;
  orderNumber: number;
  couponDiscount: number;
  couponDetail: unknown | null;
  itemsDiscount: number;
  totalDiscount: number;
  subTotal: number;
  tax: number;
  deliveryFee: number;
  total: number;
  totalItems: number;
  description: string | null;
  tableNumber: string | null;
  status: string;
  paymentStatus: string;
}

export interface Review extends RowDataType {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  order: string;
  food: ReviewFood;
  user: ReviewUser;
  comment: string;
  rating: number;
  positivePoints: string[];
  negativePoints: string[];
  status: string;
}

export interface ReviewDetail {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  order: ReviewOrder;
  food: ReviewFood;
  user: ReviewUser;
  comment: string;
  rating: number;
  positivePoints: string[];
  negativePoints: string[];
  status: string;
}

export type GetReviewsResponse = IResponse<Review[]>;
export type GetReviewByIdResponse = IResponse<ReviewDetail>;
