import { mergePartially, NestedPartial } from 'merge-partially';
import { faker } from '@faker-js/faker';

interface IUser {
  id: string;
  firstName: string;
  lastName: string;
  email: string;
}

export default function makeFakeUser(overrides?: NestedPartial<IUser>): IUser {
  return mergePartially.deep(
    {
      id: faker.string.uuid(),
      email: faker.internet.email(),
      firstName: faker.person.firstName(),
      lastName: faker.person.lastName(),
    },
    overrides
  );
}
