You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package http
|
|
|
|
import (
|
|
"time"
|
|
|
|
domain "knowfoolery/backend/services/user-service/internal/domain/user"
|
|
)
|
|
|
|
// UserResponse is API response payload for user data.
|
|
type UserResponse struct {
|
|
ID string `json:"id"`
|
|
Email string `json:"email"`
|
|
EmailVerified bool `json:"email_verified"`
|
|
DisplayName string `json:"display_name"`
|
|
ConsentVersion string `json:"consent_version"`
|
|
ConsentGivenAt time.Time `json:"consent_given_at"`
|
|
ConsentSource string `json:"consent_source"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt *time.Time `json:"deleted_at,omitempty"`
|
|
}
|
|
|
|
func toUserResponse(u *domain.User) UserResponse {
|
|
return UserResponse{
|
|
ID: u.ID,
|
|
Email: u.Email,
|
|
EmailVerified: u.EmailVerified,
|
|
DisplayName: u.DisplayName,
|
|
ConsentVersion: u.ConsentVersion,
|
|
ConsentGivenAt: u.ConsentGivenAt,
|
|
ConsentSource: u.ConsentSource,
|
|
CreatedAt: u.CreatedAt,
|
|
UpdatedAt: u.UpdatedAt,
|
|
DeletedAt: u.DeletedAt,
|
|
}
|
|
}
|