func (p *postgres) GetUserByID(id int) (models.User, error) {
	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
	defer cancel()

	query := `SELECT id, first_name, last_name, email, password, access_level, created_at, updated_at
			  FROM users WHERE id = $1`
	row := p.DB.QueryRowContext(ctx, query, id)

	var u models.User
	err := row.Scan(
		&u.ID,
		&u.FirstName,
		&u.LastName,
		&u.Email,
		&u.Password,
		&u.AccessLevel,
		&u.CreatedAt,
		&u.UpdatedAt,
	)
	if err != nil {
		return u, err
	}

	return u, nil
}
// GetUserByID returns a user by id
GetUserByID returns a user by id
// GetUserByID returns a user by id
func (p *postgres) GetUserByID(id int) (models.User, error) {
	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
	defer cancel()
	query := `SELECT id, first_name, last_name, email, password, access_level, created_at, updated_at
			  FROM users WHERE id = $1`
	row := p.DB.QueryRowContext(ctx, query, id)
	var u models.User
	err := row.Scan(
		&u.ID,
		&u.FirstName,
		&u.LastName,
		&u.Email,
		&u.Password,
		&u.AccessLevel,
		&u.CreatedAt,
		&u.UpdatedAt,
	)
	if err != nil {
		return u, err
	}
	return u, nil
}
func ( p * postgres ) GetUserByID ( id int ) ( models . User , error ) { ctx , cancel := context . WithTimeout ( context . Background ( ) , 3 * time . Second ) defer cancel ( ) query := `SELECT id, first_name, last_name, email, password, access_level, created_at, updated_at
			  FROM users WHERE id = $1` row := p . DB . QueryRowContext ( ctx , query , id ) var u models . User err := row . Scan ( & u . ID , & u . FirstName , & u . LastName , & u . Email , & u . Password , & u . AccessLevel , & u . CreatedAt , & u . UpdatedAt , ) if err != nil { return u , err } return u , nil }
GetUserByID returns a user by id
GetUserByID returns a user by id