feat: actualizar proyecto completo

This commit is contained in:
2026-09-01 14:26:30 -04:00
parent d8d45f142c
commit ca6b111bd0
12 changed files with 1434 additions and 40 deletions
@@ -0,0 +1,44 @@
-- ============================================================================
-- TABLERO CDC — ETAPA 2 — HORAS DEL EQUIPO
-- Script aditivo y seguro.
--
-- Reutiliza la vista public.tablero_cdc_time_combined creada en la Etapa 1.
-- Solo agrega un RPC de lectura mínima para que el módulo pueda mostrar también
-- personas activas que todavía no han registrado horas en el periodo seleccionado.
-- NO modifica proyectos, horas, histórico, métricas, tarifarios ni listas.
-- ============================================================================
begin;
create or replace function public.tablero_cdc_get_team_hours_roster()
returns table (
email text,
full_name text
)
language plpgsql
stable
security definer
set search_path = public
as $$
begin
if not public.tablero_cdc_current_user_is_allowed() then
raise exception 'No autorizado';
end if;
return query
select
lower(trim(u.email)) as email,
coalesce(nullif(trim(u.full_name), ''), lower(trim(u.email))) as full_name
from public.tablero_cdc_allowed_users u
where u.is_active = true
order by coalesce(nullif(trim(u.full_name), ''), lower(trim(u.email)));
end;
$$;
revoke all on function public.tablero_cdc_get_team_hours_roster() from public;
grant execute on function public.tablero_cdc_get_team_hours_roster() to authenticated;
commit;
-- Verificación opcional desde una sesión autenticada de la app:
-- select * from public.tablero_cdc_get_team_hours_roster();