fix: TypeScript build errors in frontend

- Fix CFDI type errors (ivaTraslado, tipoCambio, id types)
- Fix sidebar navigation type errors (Role vs literal tuples)
- Fix user invite type errors (UserInvite['role'])
- Fix login page PlatformRole type cast
This commit is contained in:
Horux Dev
2026-04-28 04:51:52 +00:00
parent 2896eea4f2
commit 2ac8e4d055
9 changed files with 33 additions and 31 deletions

View File

@@ -7,7 +7,7 @@ import Image from 'next/image';
import { Button, Input, Label, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@horux/shared-ui';
import { login } from '@/lib/api/auth';
import { useAuthStore } from '@/stores/auth-store';
import { isGlobalAdminRfc } from '@horux/shared';
import { isGlobalAdminRfc, type PlatformRole } from '@horux/shared';
export default function LoginPage() {
const router = useRouter();
@@ -32,7 +32,7 @@ export default function LoginPage() {
const userRole = response.user?.role;
// Admin global aterriza directo en `/clientes` — su home natural es la
// gestión de tenants, no el dashboard operativo del despacho.
const platformRoles = (response.user as { platformRoles?: string[] }).platformRoles;
const platformRoles = (response.user as { platformRoles?: PlatformRole[] }).platformRoles;
const isGlobalAdmin = isGlobalAdminRfc(response.user?.tenantRfc, userRole, platformRoles);
if (isGlobalAdmin) {
router.push('/clientes');