Is the database design alright? And I’m quite lost with the admin entity here

database-designerd

A quick description of my system would be: there are 2 users: users and admin.

User registers on the website. Upon registration, the system will generate a QR code for the user. The user then goes to be vaccinated, and upon vaccination, someone will be able to scan his/ her QR code and the status of the user will be updated as vaccinated with the 1st dose of the vaccine. Additional information will also include, the date for the 2nd dose of vaccination, the doctor who was responsible for the vaccination, date and time of the vaccination. The user can also give his feedback for the side effects per dosage.

On the admin's side:

  • able to log in
  • they will have a report in the graph for each of the vaccines and the percentage of how many
    were vaccinated with these types of vaccines.
  • graph of side effects per dosage of each of the vaccines
  • add, edit, and delete a doctor
  • add, edit, delete a vaccine
  • it will also include Analytics for the frequency of the users
  • list of those users

This is the database design I have come up so far and I'm needing help if this is correct and I'm a little lost with the admin entity here.

enter image description here

Best Answer

Authentication and authorization for the administration logic should be handled by the application, so it is natural that the Admin entity will feel disconnected to your domain. You could expand into other entities, such as Permission and Group, so you can have fine-grained control over what exact permissions an administrator, or group of administrators, can have. Enforcing those, however, will be on the application side.

The rest of your design looks pretty coherent. Keep it up!