38 lines
939 B
Go
38 lines
939 B
Go
package aggregate
|
|
|
|
import (
|
|
"tm/internal/customer/domain/entity"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Customer struct {
|
|
ID uuid.UUID `json:"_id"`
|
|
FirstName string `json:"first_name"`
|
|
LastName string `json:"last_name"`
|
|
Mobile string `json:"mobile"`
|
|
Email string `json:"email"`
|
|
IsActive bool `json:"is_active"`
|
|
IsVerified bool `json:"is_verified"`
|
|
}
|
|
|
|
func NewCustomer(c entity.Customer) Customer {
|
|
return Customer{
|
|
ID: c.ID,
|
|
FirstName: c.FirstName,
|
|
LastName: c.LastName,
|
|
Mobile: c.Mobile,
|
|
Email: c.Email,
|
|
IsActive: c.IsActive,
|
|
IsVerified: c.IsVerified,
|
|
}
|
|
}
|
|
|
|
// AuthResponse defines authentication response (kept for backward compatibility)
|
|
type AuthorizationResponse struct {
|
|
Customer Customer `json:"customer"`
|
|
AccessToken string `json:"access_token"`
|
|
RefreshToken string `json:"refresh_token"`
|
|
ExpiresIn int64 `json:"expires_in"`
|
|
}
|