Private
Public Access
primeros cambios hechos para tener el multitenant
This commit is contained in:
1 parent
34ad4424f9
commit
4e082e8767
132 files changed
+6202
-762
No files matched your search
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type LogTablaBuilder struct {
|
||||
logs []logs.Log
|
||||
logs []logs.Log
|
||||
}
|
||||
|
||||
func NewLogTablaBuilder() *LogTablaBuilder {
|
||||
@@ -14,20 +14,19 @@ func NewLogTablaBuilder() *LogTablaBuilder {
|
||||
}
|
||||
|
||||
func (b *LogTablaBuilder) ConLogs(logs []logs.Log) *LogTablaBuilder {
|
||||
b.logs =logs;
|
||||
b.logs = logs
|
||||
return b
|
||||
}
|
||||
|
||||
|
||||
func (b *LogTablaBuilder) Build() []dto.LogTablaDto {
|
||||
var dtos []dto.LogTablaDto
|
||||
|
||||
for i := 0; i < len(b.logs); i++ {
|
||||
var d = &dto.LogTablaDto{
|
||||
ID: b.logs[i].ID,
|
||||
ID: b.logs[i].ID,
|
||||
UsuarioID: b.logs[i].UsuarioID,
|
||||
Accion: b.logs[i].Accion,
|
||||
Detalles: b.logs[i].Detalles,
|
||||
Accion: b.logs[i].Accion,
|
||||
Detalles: b.logs[i].Detalles,
|
||||
CreatedAt: b.logs[i].CreatedAt,
|
||||
}
|
||||
dtos = append(dtos, *d)
|
||||
|
||||
+67
-4
@@ -1,5 +1,38 @@
|
||||
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"`
|
||||
EsPlataformaAdmin bool `json:"es_plataforma_admin"`
|
||||
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"`
|
||||
@@ -15,8 +48,38 @@ type RegisterResponse struct {
|
||||
}
|
||||
|
||||
type MeResponse struct {
|
||||
ID uint `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
Permissions []uint `json:"permissions"`
|
||||
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"`
|
||||
EsPlataformaAdmin bool `json:"es_plataforma_admin"`
|
||||
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"`
|
||||
}
|
||||
Reference in new issue
Block a user