Private
Public Access
85 lines
3.0 KiB
Go
85 lines
3.0 KiB
Go
package dto
|
|
|
|
import "time"
|
|
|
|
type EmpresaResumen struct {
|
|
ID uint `json:"id"`
|
|
Nombre string `json:"nombre"`
|
|
Slug string `json:"slug"`
|
|
Activa bool `json:"activa"`
|
|
Rol string `json:"rol,omitempty"`
|
|
}
|
|
|
|
type UsuarioResumen struct {
|
|
ID uint `json:"id"`
|
|
Email string `json:"email"`
|
|
Name string `json:"name"`
|
|
Activo bool `json:"activo"`
|
|
DebeCambiarPassword bool `json:"debe_cambiar_password"`
|
|
}
|
|
|
|
type AuthResponse struct {
|
|
AccessToken string `json:"access_token"`
|
|
RefreshToken string `json:"refresh_token"`
|
|
TokenType string `json:"token_type"`
|
|
ExpiresIn int `json:"expires_in"`
|
|
Permissions []uint `json:"permissions"`
|
|
Empresa *EmpresaResumen `json:"empresa,omitempty"`
|
|
Empresas []EmpresaResumen `json:"empresas"`
|
|
EmpresaRol string `json:"empresa_rol"`
|
|
Usuario UsuarioResumen `json:"usuario"`
|
|
DebeCambiarPassword bool `json:"debe_cambiar_password"`
|
|
}
|
|
|
|
// TokenResponse se mantiene por compatibilidad con clientes anteriores.
|
|
type TokenResponse struct {
|
|
AccessToken string `json:"access_token"`
|
|
RefreshToken string `json:"refresh_token"`
|
|
TokenType string `json:"token_type"`
|
|
ExpiresIn int `json:"expires_in"`
|
|
Permissions []uint `json:"permissions"`
|
|
}
|
|
|
|
type RegisterResponse struct {
|
|
ID uint `json:"id"`
|
|
Email string `json:"email"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type MeResponse struct {
|
|
ID uint `json:"id"`
|
|
Email string `json:"email"`
|
|
Name string `json:"name"`
|
|
Permissions []uint `json:"permissions"`
|
|
Empresa *EmpresaResumen `json:"empresa,omitempty"`
|
|
Empresas []EmpresaResumen `json:"empresas"`
|
|
EmpresaRol string `json:"empresa_rol"`
|
|
Activo bool `json:"activo"`
|
|
DebeCambiarPassword bool `json:"debe_cambiar_password"`
|
|
}
|
|
|
|
type InvitacionInfo struct {
|
|
Email string `json:"email"`
|
|
Empresa string `json:"empresa"`
|
|
EmpresaID uint `json:"empresa_id"`
|
|
Rol string `json:"rol"`
|
|
ExpiraEn time.Time `json:"expira_en"`
|
|
Valida bool `json:"valida"`
|
|
Usada bool `json:"usada"`
|
|
Expirada bool `json:"expirada"`
|
|
UsuarioExistente bool `json:"usuario_existente"`
|
|
}
|
|
|
|
type MiembroResponse struct {
|
|
ID uint `json:"id"`
|
|
Email string `json:"email"`
|
|
Name string `json:"name"`
|
|
Activo bool `json:"activo"`
|
|
DebeCambiarPassword bool `json:"debe_cambiar_password"`
|
|
Rol string `json:"rol"`
|
|
MembresiaActiva bool `json:"membresia_activa"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt *time.Time `json:"deleted_at"`
|
|
}
|