const {
  PrismaClient
} = require('@prisma/client');
const prisma = new PrismaClient();

async function main() {
  const user = await prisma.user.create({
    data: {
      id: 'u1',
      name: 'John Doe',
      email: 'john.doe@example.com',
      emailVerified: new Date(),
      image: 'http://example.com/image.jpg'
    },
  });

  const account = await prisma.account.create({
    data: {
      id: 'a1',
      userId: 'u1',
      type: 'providerType',
      provider: 'google',
      providerAccountId: 'providerAccountId',
      refresh_token: 'refreshToken',
      access_token: 'accessToken',
      expires_at: 1625120000,
      token_type: 'Bearer',
      scope: 'email',
      id_token: 'idToken',
      session_state: 'sessionState'
    },
  });

  const session = await prisma.session.create({
    data: {
      id: 's1',
      sessionToken: 'sessionToken123',
      userId: 'u1',
      expires: new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 7) // 一周後過期
    },
  });
}

main()
  .catch(e => {
    throw e;
  })
  .finally(async () => {
    await prisma.$disconnect();
  });
