Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] : Add seeders to handle fake users and game history #4

Open
prisca-c opened this issue Oct 20, 2024 · 0 comments
Open

[FEAT] : Add seeders to handle fake users and game history #4

prisca-c opened this issue Oct 20, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@prisca-c
Copy link
Owner

[FEAT] : Add seeders to handle fake users and game history

We wan't to generate fake data's of game histories.

Description

When we need to populate a user's games history, we have to open 2 browser and play a game with 2 different user which is a little bit annoying.

What we want is to create seeders to generate fake datas in the table GameHistories which require :

  • 2 new User at least
  • 1 new word (There's already a seeder for words)

Possible Solution

Use current ORM Lucid to handle seeder, there's an example in the file word_seeder.ts or you can also take a look at the doc Lucid's doc.

What would be good is to generate game_histories using at least our default user when we bypass login to have access to these data easily without changing manually database's datas.

Here's the default user :

await this.userRepository.findOrCreate('[email protected]', {
  username: 'RandomUser',
  avatarUrl: null,
  providerId: 1,
});

For the seeder, try to generate different stories :

  • Game with a guessed state at false
  • Game with a guessed state at true
  • Game with max words used in the words_list
  • Game with few words used in the words_list

To help you, here's the type of a words_list (each player have max 5 words):

export interface WordList {
  hintGiver: string[]
  guesser: string[]
}
@prisca-c prisca-c added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers hacktoberfest labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant