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

🚀 Feature: Implement Seeders to create an admin user in your db #4

Open
shivani-pothirajan opened this issue Oct 19, 2023 · 0 comments
Assignees
Labels
good first issue Good for newcomers hacktoberfest Issues participating in hacktoberfest

Comments

@shivani-pothirajan
Copy link
Contributor

🔖 Feature description

Implement a seeder in such a way that it will check if you have an admin user present in your local db then insert it if its not present and ignore if an admin user is already present.

We have setup seeders in our saleswiz - /~https://github.com/apiwizlabs/saleswiz repository
so please take a look at it helps you.

here is a sample document on how the admin user doc should look like in ur database after insertion:

  "_id": { "$oid": "64114ad83d4089dedf268d44" },
  "name": "Admin",
  "email": "admin@email.com",
  "password": "$2a$10$WSieBcoa3TI6JaAjPSVHjvj0pGJoANe/gJkK2yJXyqaQeoq", //hashed password 10 salt rounds
  "type": "ADMIN USER",
  "lastLogin": {
    "$date": "2023-07-11T09:51:59.075Z"
  },
  "cts": {
    "$date": "2023-03-15T04:34:32.566Z"
  },
  "mts": {
    "$date": "2023-07-11T09:51:59.075Z"
  },
  "__v": 0,
  "isLocked": false,
  "assignedOrganisations": [  ],
  "isDeleted": false
}```




### 🎤 Pitch

It makes codebase setup more streamlined and easier. implementing seeders is considered a good practice as it does not allow for much human error.

### 👀 Have you spent some time to check if this issue has been raised before?

- [X] I checked and didn't find similar issue

### 👀 Have you read the Code of Conduct?

- [X] I have read the [Code of Conduct](/~https://github.com/apiwizlabs/saleswiz/blob/main/CODE_OF_CONDUCT.md)
@shivani-pothirajan shivani-pothirajan added good first issue Good for newcomers hacktoberfest Issues participating in hacktoberfest labels Oct 19, 2023
@shivani-pothirajan shivani-pothirajan self-assigned this Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest Issues participating in hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant