mirror of
https://github.com/teamhanko/hanko.git
synced 2025-10-29 23:59:46 +08:00
29 lines
687 B
Go
29 lines
687 B
Go
package admin
|
|
|
|
import (
|
|
"github.com/gofrs/uuid"
|
|
"github.com/teamhanko/hanko/backend/persistence/models"
|
|
"time"
|
|
)
|
|
|
|
type Email struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Address string `json:"address"`
|
|
IsVerified bool `json:"is_verified"`
|
|
IsPrimary bool `json:"is_primary"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// FromEmailModel Converts the DB model to a DTO object
|
|
func FromEmailModel(email *models.Email) *Email {
|
|
return &Email{
|
|
ID: email.ID,
|
|
Address: email.Address,
|
|
IsVerified: email.Verified,
|
|
IsPrimary: email.IsPrimary(),
|
|
CreatedAt: email.CreatedAt,
|
|
UpdatedAt: email.UpdatedAt,
|
|
}
|
|
}
|