mirror of
https://github.com/IT4Change/gradido.git
synced 2026-01-15 09:24:38 +00:00
factory for login user backup
This commit is contained in:
parent
a518ed5096
commit
8f066595fc
18
database/src/factories/login-user-backup.factory.ts
Normal file
18
database/src/factories/login-user-backup.factory.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import Faker from 'faker'
|
||||
import { define } from 'typeorm-seeding'
|
||||
import { LoginUserBackup } from '../../entity/LoginUserBackup'
|
||||
|
||||
interface LoginUserBackupContext {
|
||||
passphrase?: string
|
||||
mnemonicType?: number
|
||||
}
|
||||
|
||||
define(LoginUserBackup, (faker: typeof Faker, context?: LoginUserBackupContext) => {
|
||||
if (!context) context = {}
|
||||
|
||||
const userBackup = new LoginUserBackup()
|
||||
userBackup.passphrase = context.passphrase ? context.passphrase : faker.random.words(24)
|
||||
userBackup.mnemonicType = context.mnemonicType ? context.mnemonicType : 2
|
||||
|
||||
return userBackup
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user