Skip to content

Commit

Permalink
Update seed file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sital999 committed Nov 13, 2024
1 parent 4970257 commit ed5fcfa
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 15 deletions.
2 changes: 1 addition & 1 deletion integration_test/tests/auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createAuth } from '@helpers/auth';

const organizerAuthFile = '.auth/organizer.json';
const delegateAuthFile = '.auth/delegate.json';
const alternateAuthFile = '.auth/organizer.json';
const alternateAuthFile = '.auth/alternate.json';

setup.beforeEach(async () => {
await setAllureEpic('Setup');
Expand Down
77 changes: 63 additions & 14 deletions prisma/seed.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { prisma } from '@/db';
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

const workshopLocations = [
{ name: 'Dubai' },
{ name: 'Singapore' },
{ name: 'Convention Organizer' },
{ name: 'Buenos Aires' },
];

const users = [
Expand All @@ -12,30 +15,30 @@ const users = [
is_delegate: false,
is_alternate: false,
workshop_id: BigInt(3),
name: 'Billy Bob',
name: 'Billy Bob Organizer',
email: '[email protected]',
wallet_address:
'stake_test3hjbd6o28bup465uqw3ziahm7satj4507tyterkkw91bz7hdwjfro',
'stake_test1uzmx7hxevy7r63an2v968x4kw5cxdkjw0zwgxe0ph74ad3s7zmcxx',
},
{
is_convention_organizer: false,
is_delegate: true,
is_alternate: false,
workshop_id: BigInt(1),
name: 'James Jones',
name: 'James Jones delegate',
email: '[email protected]',
wallet_address:
'stake_test4ilce7p39cvq576vrx4ajbin8ubuk5618uzvftllx02ca8iexksg',
'stake_test1ur582xvym2mv8qj7xfny5vsm5gn8yxam7er43xu779vh0cq4tpyxh',
},
{
is_convention_organizer: false,
is_delegate: false,
is_alternate: true,
workshop_id: BigInt(2),
name: 'Sally Sue',
name: 'Sally Sue alternate',
email: '[email protected]',
wallet_address:
'stake_test5jkdf8p40dxr687wsx5bkcoj9vcvl6729vawguomm13db9jfylhtp',
'stake_test1uqgf7pecctde8ygq25w48k8qrzzr6ap9d5nfwp8436a9g8sdmnp2k',
},
{
is_convention_organizer: false,
Expand All @@ -45,24 +48,70 @@ const users = [
name: 'John Doe',
email: '[email protected]',
wallet_address:
'stake_test5jkdf8p40dxr687wsx5bkcoj9vcvl6729vawguomm13db9jfueijd',
'stake_test1uzryp0nzykrdmnxuu8nsu9q2vz2a22l9upq4ckn4p5uqhjgvkdd6g',
},
{
is_convention_organizer: false,
is_delegate: false,
is_alternate: true,
workshop_id: BigInt(1),
name: 'Roy James',
email: '[email protected]',
wallet_address:
'stake_test1uq2c7pdk3nr0mtsl9z47redcc38pvchz5czryeh643ecvpgu5v0gr',
},
{
is_convention_organizer: true,
is_delegate: false,
is_alternate: false,
workshop_id: BigInt(3),
name: 'Test organizer',
email: '[email protected]',
wallet_address:
'stake_test1urrfysygca8m9x0qypxrutl5j2n9c252mev4qmwdtzwqr6g6dj7kn',
},
{
is_convention_organizer: false,
is_delegate: false,
is_alternate: true,
workshop_id: BigInt(4),
name: 'Test alternate',
email: '[email protected]',
wallet_address:
'stake_test1up646zdqul0wud00ss0vszpf9g22uqc0r4k4tv7gtv8edqs5nrfs7',
},
{
is_convention_organizer: false,
is_delegate: true,
is_alternate: false,
workshop_id: BigInt(4),
name: 'Test delegate',
email: '[email protected]',
wallet_address:
'stake_test1upzv3vmy37a0zk743vjfaexrxvnnv7fyhrdg5ncla6dknksjfxrpy',
},
];

const workshopInfo = [
{
name: 'Dubai',
delegate_id: BigInt(1),
alternate_id: BigInt(2),
active_vote_id: BigInt(1),
delegate_id: BigInt(2),
alternate_id: BigInt(5),
active_vote_id: BigInt(2),
},
{
name: 'Singapore',
delegate_id: BigInt(3),
alternate_id: BigInt(4),
active_vote_id: BigInt(4),
delegate_id: BigInt(4),
alternate_id: BigInt(3),
active_vote_id: BigInt(3),
},
{ name: 'Convention Organizer' },
{
name: 'Buenos Aires',
delegate_id: BigInt(8),
alternate_id: BigInt(7),
active_vote_id: BigInt(8),
},
];

const seedDB = async (): Promise<void> => {
Expand Down

0 comments on commit ed5fcfa

Please sign in to comment.