Skip to content

Create User model & create an Administrator entry #1

@lothemar

Description

@lothemar

Assume all fields are required for now.

Fields:

  • String username
  • String password
  • String firstName
  • String lastName
  • String homeAddress
  • Number countryCode
  • String phone
  • String email
  • String passport
  • Boolean isAdmin

Add validators for email, phone, and country code relevant: docs

Note for the future: will need to override save method in User model to save a hash of the inputted password along with other passwords. Also might just end up using passport-local-mongoose

After you're done, just create an entry for administrator using these values:

{
  username: 'boatymcboatfaced',
  password: 'youshallnothash',
  firstName: "Boaty",
  lastName: "McBoatface",
  homeAddress: "2 McBoatfacing Street, River Thames",
  countryCode: 20,
  phone: '1006043322',
  passport: '',
  isAdmin: true,
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions