// generateFakeData.ts
import { faker } from '@faker-js/faker';

interface ProjectData {
  id: number;
  projectCode: string;
  projectName: string;
  team: string;
  teamLeader: string;
  startDate: string;
  startDateFrom: string;
  startDateTo: string;
  targetEndDate: string;
  client: string;
  subsidiary: string;
  nextstage: string;
  nextstageenddate: string;
}

export const generateFakeData = (numEntries: number): ProjectData[] => {
  const data: ProjectData[] = [];
  for (let i = 0; i < numEntries; i++) {
    data.push({
      id: i + 1,
      projectCode: faker.datatype.uuid(),
      projectName: faker.commerce.productName(),
      team: faker.commerce.department(),
      teamLeader: faker.name.fullName(),  // Corrected from findName to fullName
      startDate: faker.date.recent(90).toISOString().split('T')[0],
      startDateFrom: faker.date.past(1).toISOString().split('T')[0],
      startDateTo: faker.date.future(1).toISOString().split('T')[0],
      targetEndDate: faker.date.future(1).toISOString().split('T')[0],
      client: faker.company.name(),  // Corrected from companyName to name
      subsidiary: faker.company.name(),  // Corrected from companyName to name
      nextstage: "Design",
      nextstageenddate: faker.date.future(2).toISOString().split('T')[0],
    });
  }
  return data;
};
