class ProfileRepository {
  constructor(prisma) { this.prisma = prisma; }
  findByUserId(userId) { return this.prisma.profile.findUnique({ where: { userId } }); }
  upsert(userId, data) {
    return this.prisma.profile.upsert({
      where: { userId },
      update: data,
      create: { userId, ...data },
    });
  }
}

export default ProfileRepository;
