diff --git a/database/src/factories/login-user.factory.ts b/database/src/factories/login-user.factory.ts index a5a28943e..b3c0312f3 100644 --- a/database/src/factories/login-user.factory.ts +++ b/database/src/factories/login-user.factory.ts @@ -19,7 +19,7 @@ define(LoginUser, (faker: typeof Faker, context?: LoginUserContext) => { user.privKey = context.privKey ? context.privKey : randomBytes(80) user.emailHash = context.emailHash ? context.emailHash : randomBytes(32) user.createdAt = context.createdAt ? context.createdAt : faker.date.recent() - user.emailChecked = context.emailChecked ? context.emailChecked : true + user.emailChecked = context.emailChecked === undefined ? false : context.emailChecked user.passphraseShown = context.passphraseShown ? context.passphraseShown : false user.language = context.language ? context.language : 'en' user.disabled = context.disabled ? context.disabled : false diff --git a/database/src/index.ts b/database/src/index.ts index 488d098d3..033a36d8b 100644 --- a/database/src/index.ts +++ b/database/src/index.ts @@ -6,6 +6,7 @@ import { CreatePeterLustigSeed } from './seeds/users/peter-lustig.admin.seed' import { CreateBibiBloxbergSeed } from './seeds/users/bibi-bloxberg.seed' import { CreateRaeuberHotzenplotzSeed } from './seeds/users/raeuber-hotzenplotz.seed' import { CreateBobBaumeisterSeed } from './seeds/users/bob-baumeister.seed' +import { CreateGarrickOllivanderSeed } from './seeds/users/garrick-ollivander.seed' import { DecayStartBlockSeed } from './seeds/decay-start-block.seed' import { resetDB, pool, migration } from './helpers' @@ -44,6 +45,7 @@ const run = async (command: string) => { await runSeeder(CreateBibiBloxbergSeed) await runSeeder(CreateRaeuberHotzenplotzSeed) await runSeeder(CreateBobBaumeisterSeed) + await runSeeder(CreateGarrickOllivanderSeed) break default: throw new Error(`Unsupported command ${command}`) diff --git a/database/src/interface/UserContext.ts b/database/src/interface/UserContext.ts index 4e188904c..eb4323aee 100644 --- a/database/src/interface/UserContext.ts +++ b/database/src/interface/UserContext.ts @@ -23,7 +23,7 @@ export interface LoginUserContext { language?: string disabled?: boolean groupId?: number - publisherId?: number | null + publisherId?: number } export interface LoginUserBackupContext { diff --git a/database/src/interface/UserInterface.ts b/database/src/interface/UserInterface.ts index 70be6cff4..63804af6b 100644 --- a/database/src/interface/UserInterface.ts +++ b/database/src/interface/UserInterface.ts @@ -15,7 +15,7 @@ export interface UserInterface { language?: string disabled?: boolean groupId?: number - publisherId?: number | null + publisherId?: number // from login user backup passphrase?: string mnemonicType?: number diff --git a/database/src/seeds/users/bibi-bloxberg.ts b/database/src/seeds/users/bibi-bloxberg.ts index 30ad4eb4c..221349cb7 100644 --- a/database/src/seeds/users/bibi-bloxberg.ts +++ b/database/src/seeds/users/bibi-bloxberg.ts @@ -17,7 +17,6 @@ export const bibiBloxberg = { language: 'de', disabled: false, groupId: 1, - publisherId: null, passphrase: 'knife normal level all hurdle crucial color avoid warrior stadium road bachelor affair topple hawk pottery right afford immune two ceiling budget glance hour ', mnemonicType: 2, diff --git a/database/src/seeds/users/bob-baumeister.ts b/database/src/seeds/users/bob-baumeister.ts index a6933d7c1..013636079 100644 --- a/database/src/seeds/users/bob-baumeister.ts +++ b/database/src/seeds/users/bob-baumeister.ts @@ -17,7 +17,6 @@ export const bobBaumeister = { language: 'de', disabled: false, groupId: 1, - publisherId: null, passphrase: 'detail master source effort unable waste tilt flush domain orchard art truck hint barrel response gate impose peanut secret merry three uncle wink resource ', mnemonicType: 2, diff --git a/database/src/seeds/users/garrick-ollivander.seed.ts b/database/src/seeds/users/garrick-ollivander.seed.ts new file mode 100644 index 000000000..54adc3475 --- /dev/null +++ b/database/src/seeds/users/garrick-ollivander.seed.ts @@ -0,0 +1,9 @@ +import { Factory, Seeder } from 'typeorm-seeding' +import { garrickOllivander } from './garrick-ollivander' +import { userSeeder } from '../helpers/user-helpers' + +export class CreateGarrickOllivanderSeed implements Seeder { + public async run(factory: Factory): Promise { + await userSeeder(factory, garrickOllivander) + } +} diff --git a/database/src/seeds/users/garrick-ollivander.ts b/database/src/seeds/users/garrick-ollivander.ts new file mode 100644 index 000000000..1c7bbb9fc --- /dev/null +++ b/database/src/seeds/users/garrick-ollivander.ts @@ -0,0 +1,21 @@ +export const garrickOllivander = { + email: 'garrick@ollivander.com', + firstName: 'Garrick', + lastName: 'Ollivander', + username: 'garrick', + description: `Curious ... curious ... +Renowned wandmaker Mr Ollivander owns the wand shop Ollivanders: Makers of Fine Wands Since 382 BC in Diagon Alley. His shop is widely considered the best place to purchase a wand.`, + password: BigInt('0'), + emailHash: Buffer.from('91e358000e908146342789979d62a7255b2b88a71dad0c6a10e32af44be57886', 'hex'), + createdAt: new Date('2022-01-10T10:23:17'), + emailChecked: false, + passphraseShown: false, + language: 'en', + disabled: false, + groupId: 1, + passphrase: + 'human glide theory clump wish history other duty door fringe neck industry ostrich equal plate diesel tornado neck people antenna door category moon hen ', + mnemonicType: 2, + isAdmin: false, + addBalance: false, +} diff --git a/database/src/seeds/users/peter-lustig.ts b/database/src/seeds/users/peter-lustig.ts index 63caf55f6..c96b28a65 100644 --- a/database/src/seeds/users/peter-lustig.ts +++ b/database/src/seeds/users/peter-lustig.ts @@ -17,7 +17,6 @@ export const peterLustig = { language: 'de', disabled: false, groupId: 1, - publisherId: null, passphrase: 'okay property choice naive calm present weird increase stuff royal vibrant frame attend wood one else tribe pull hedgehog woman kitchen hawk snack smart ', mnemonicType: 2, diff --git a/database/src/seeds/users/raeuber-hotzenplotz.ts b/database/src/seeds/users/raeuber-hotzenplotz.ts index eb2118af5..c1f31b490 100644 --- a/database/src/seeds/users/raeuber-hotzenplotz.ts +++ b/database/src/seeds/users/raeuber-hotzenplotz.ts @@ -17,7 +17,6 @@ export const raeuberHotzenplotz = { language: 'de', disabled: false, groupId: 1, - publisherId: null, passphrase: 'gospel trip tenant mouse spider skill auto curious man video chief response same little over expire drum display fancy clinic keen throw urge basket ', mnemonicType: 2,