package models

// UserResponse represents a user response (without sensitive data)
type UserResponse struct {
	ID        int64  `json:"id"`
	Email     string `json:"email"`
	Username  string `json:"username"`
	FirstName string `json:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty"`
	AvatarURL string `json:"avatar_url,omitempty"`
	Role      string `json:"role,omitempty"`
	CreatedAt string `json:"created_at"`
}

// FromUser creates a UserResponse from a User model
func (ur *UserResponse) FromUser(user *User) {
	ur.ID = user.ID
	ur.Email = user.Email
	ur.Username = user.Username
	ur.FirstName = user.FirstName
	ur.LastName = user.LastName
	ur.CreatedAt = user.CreatedAt.Format("2006-01-02T15:04:05Z")
}

