feat: finalizar Tablero CDC con multipais, Fulgencio y tarifario

This commit is contained in:
Isaac_Aracena
2026-06-16 14:23:30 -04:00
parent 8c3d18814d
commit 1fe2ffba80
17 changed files with 3903 additions and 638 deletions
+25 -2
View File
@@ -12,7 +12,16 @@ import { supabase } from "@/lib/supabase";
const ALLOWED_DOMAIN = "gomezleemarketing.com";
const GERARDO_EMAIL = "gmarrero@gomezleemarketing.com";
const DELETE_ALLOWED_EMAILS = [GERARDO_EMAIL, "areyes@gomezleemarketing.com"];
const INTERNAL_PRICING_ALLOWED_EMAILS = [
GERARDO_EMAIL,
"areyes@gomezleemarketing.com",
"iaracena@gomezleemarketing.com",
];
const DELETE_ALLOWED_EMAILS = [
GERARDO_EMAIL,
"areyes@gomezleemarketing.com",
"iaracena@gomezleemarketing.com",
];
function isAllowedEmail(email: string | null | undefined): boolean {
if (!email) return false;
@@ -61,6 +70,7 @@ interface AuthContextValue {
error: string | null;
isGerardo: boolean;
canDeleteProjects: boolean;
canManageInternalPricing: boolean;
loginWithGoogle: () => Promise<void>;
logout: () => Promise<void>;
}
@@ -162,6 +172,10 @@ export function AuthProvider({ children }: { children: ReactNode }) {
const normalizedEmail = user?.email?.toLowerCase() || "";
const isGerardo = useMemo(() => normalizedEmail === GERARDO_EMAIL, [normalizedEmail]);
const canManageInternalPricing = useMemo(
() => INTERNAL_PRICING_ALLOWED_EMAILS.includes(normalizedEmail),
[normalizedEmail],
);
const canDeleteProjects = useMemo(
() => DELETE_ALLOWED_EMAILS.includes(normalizedEmail),
[normalizedEmail],
@@ -169,7 +183,16 @@ export function AuthProvider({ children }: { children: ReactNode }) {
return (
<AuthContext.Provider
value={{ user, loading, error, isGerardo, canDeleteProjects, loginWithGoogle, logout }}
value={{
user,
loading,
error,
isGerardo,
canDeleteProjects,
canManageInternalPricing,
loginWithGoogle,
logout,
}}
>
{children}
</AuthContext.Provider>