yousef132 / School-Managament-System

24 stars 8 forks source link

reinforce the user database schema #26

Open sfwnisme opened 2 weeks ago

sfwnisme commented 2 weeks ago

you can refine the schema using important columns form the following example

{
  "User": {
    "id": "UUID",  // Unique identifier for the user
    "username": "string",  // Username for login
    "email": "string",  // Email address for communication
    "passwordHash": "string",  // Password hash for authentication
    "firstName": "string",  // First name of the user
    "lastName": "string",  // Last name of the user
    "role": "string",  // Role of the user (e.g., "student", "teacher", "admin", "parent")
    "dateOfBirth": "date",  // Optional: Date of birth for students
    "gender": "string",  // Optional: Gender of the user
    "phoneNumber": "string",  // Optional: Contact phone number
    "address": {
      "street": "string",  // Street address
      "city": "string",  // City
      "state": "string",  // State/Province
      "zipCode": "string",  // Postal/Zip code
      "country": "string"  // Country
    },
    "profilePicture": "string",  // URL to profile picture
    "createdAt": "date",  // Timestamp of when the user was created
    "updatedAt": "date"  // Timestamp of the last update
  }
}
yousef132 commented 2 weeks ago

I've updated the user database schema and made the necessary changes to the Get Users , Get User by ID, Add User, and Edit User endpoints. The updates are now pushed to the feature/reinforce-user-schema branch.

sfwnisme commented 1 week ago

I think there is some columns we do not need it in the user schema you can see the difference bellow

I suggest to make this change for the user, create user, update user schemas.

{
  id: number;
  email: string;
  fullName: string;
  firstname: string;
  lastname: string;
  username: string;
  createdAt: string;
  lastUpdate: string;
  gender: string;
  phoneNumber: string;
  roles: string[];
  image: string;
}