import { DanakSuggestService } from "@/app/home/types/HomeTypes";
import { ApiResponse } from "@/shared/types/SharedTypes";

export interface ReviewItem {
  id: string;
  createdAt: string;
  title: string;
  comment: string;
  rating: number;
  status: string;
  user: {
    id: string;
    firstName: string;
    lastName: string;
    profilePic: string;
  };
}

export type ServiceResponse = ApiResponse<{
  services: DanakSuggestService[];
  nextPage: boolean;
}>;

export type CategoryResponse = ApiResponse<{
  categories: ServiceCategoryType[];
}>;

export type ServiceCategoryType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  title: string;
  icon: string;
  isActive: boolean;
  order: number;
  parentId: string | null;
  deletedAt: string | null;
};

export type DanakServiceSuggestedResponse = ApiResponse<{
  danakServices: DanakSuggestService[];
}>;

export interface DanakService {
  id: string;
  createdAt: string;
  updatedAt: string;
  name: string;
  title: string;
  isDanakSuggest: boolean;
  description: string;
  author: string;
  createDate: string;
  userCount: number;
  serviceLanguage: string;
  softwareLanguage: string;
  metaDescription: string;
  isActive: boolean;
  link: string;
  icon: string;
  category: {
    id: string;
    title: string;
  };
  images: {
    id: string;
    createdAt: string;
    updatedAt: string;
    imageUrl: string;
  }[];
  subscriptionPlans: {
    id: string;
    createdAt: string;
    updatedAt: string;
    name: string;
    duration: number;
    price: number;
    isActive: boolean;
  }[];
  reviews: ReviewItem[];
  // reviews: any[]; // replace with Review[] if review structure is defined
  deletedAt: string | null;
}

export type ServiceDetailResponse = ApiResponse<{
  danakService: DanakService;
  reviews: [];
  deletedAt: string | null;
  averageRating: number;
}>;

export type SliderProductResponse = ApiResponse<{
  danakServices: DanakService[];
}>;
