feat(purga): Monday eliminado completamente del sistema
14 servicios eliminados, 7 controllers local-only, crons locales, config sin MONDAY_*, frontend sin banners/avisos Monday. 552 tests API + 7 apps construidas.
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
import { API_URL, conAuth, manejar401, type UsuarioSesion } from './auth'
|
||||
|
||||
export interface UsuarioMonday {
|
||||
id: number
|
||||
nombre: string
|
||||
email: string
|
||||
}
|
||||
|
||||
/** GET /auth/me — perfil del usuario autenticado (incluye mondayUserId y modulos) */
|
||||
/** GET /auth/me — perfil del usuario autenticado (incluye modulos y acciones) */
|
||||
export async function getMe(): Promise<UsuarioSesion> {
|
||||
const resp = await fetch(`${API_URL}/auth/me`, conAuth())
|
||||
manejar401(resp)
|
||||
@@ -23,7 +17,7 @@ export interface Contacto {
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
/** GET /contactos — contactos del tablero Contactos de Monday (máx 100) */
|
||||
/** GET /contactos — contactos locales (máx 100) */
|
||||
export async function getContactos(): Promise<Contacto[]> {
|
||||
const resp = await fetch(`${API_URL}/contactos`, conAuth())
|
||||
manejar401(resp)
|
||||
@@ -31,36 +25,13 @@ export async function getContactos(): Promise<Contacto[]> {
|
||||
return (await resp.json()) as Contacto[]
|
||||
}
|
||||
|
||||
/** GET /monday/usuarios — usuarios activos del workspace para el dropdown */
|
||||
export async function getUsuariosMonday(): Promise<UsuarioMonday[]> {
|
||||
const resp = await fetch(`${API_URL}/monday/usuarios`, conAuth())
|
||||
manejar401(resp)
|
||||
if (!resp.ok) throw new Error(`HTTP ${resp.status}`)
|
||||
return (await resp.json()) as UsuarioMonday[]
|
||||
}
|
||||
|
||||
/** PATCH /usuarios/me/monday — vincula (number) o desvincula (null) la cuenta Monday */
|
||||
export async function guardarVinculoMonday(mondayUserId: number | null): Promise<UsuarioSesion> {
|
||||
const resp = await fetch(
|
||||
`${API_URL}/usuarios/me/monday`,
|
||||
conAuth({
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ mondayUserId }),
|
||||
}),
|
||||
)
|
||||
manejar401(resp)
|
||||
if (!resp.ok) throw new Error(`HTTP ${resp.status}`)
|
||||
return (await resp.json()) as UsuarioSesion
|
||||
}
|
||||
|
||||
// ---------- Detalle de contacto (modal del módulo Contactos) ----------
|
||||
|
||||
export interface RelacionCrm {
|
||||
id: string
|
||||
nombre: string
|
||||
estado: string
|
||||
/** Quién lo atiende ahora (columna people del tablero); null si sin asignar */
|
||||
/** Quién lo atiende ahora; null si sin asignar */
|
||||
atendidoPor: string | null
|
||||
detalle: string
|
||||
}
|
||||
@@ -88,7 +59,7 @@ export interface DatosContacto {
|
||||
}
|
||||
|
||||
export interface DetalleContacto {
|
||||
/** Campos nombrados del modelo local (antes: títulos de columna de Monday) */
|
||||
/** Campos nombrados del modelo local */
|
||||
contacto: DatosContacto
|
||||
propiedad: {
|
||||
id: string
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { API_URL, conAuth, getToken } from './auth'
|
||||
|
||||
export interface EstadoSistema {
|
||||
mondayOk: boolean
|
||||
pendientesSync: number
|
||||
}
|
||||
|
||||
export async function fetchEstadoSistema(): Promise<EstadoSistema | null> {
|
||||
if (!getToken()) return null
|
||||
try {
|
||||
const res = await fetch(`${API_URL}/sistema/estado`, conAuth())
|
||||
if (!res.ok) return null
|
||||
return (await res.json()) as EstadoSistema
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user