ADM-008: Puntos de Venta (CRUD fundacional) #19
@@ -14,6 +14,7 @@ import {
|
||||
PanelLeftOpen,
|
||||
Newspaper,
|
||||
Columns3,
|
||||
Store,
|
||||
} from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
@@ -61,6 +62,12 @@ const adminItems: NavItem[] = [
|
||||
icon: Columns3,
|
||||
requiredPermission: 'administracion:secciones:gestionar',
|
||||
},
|
||||
{
|
||||
label: 'Puntos de Venta',
|
||||
href: '/admin/puntos-de-venta',
|
||||
icon: Store,
|
||||
requiredPermission: 'administracion:puntos_de_venta:gestionar',
|
||||
},
|
||||
]
|
||||
|
||||
interface SidebarNavProps {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { AlertTriangle } from 'lucide-react'
|
||||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
|
||||
|
||||
interface MedioInactivoBannerProps {
|
||||
medioNombre: string
|
||||
}
|
||||
|
||||
export function MedioInactivoBanner({ medioNombre }: MedioInactivoBannerProps) {
|
||||
return (
|
||||
<Alert variant="destructive" className="mb-4">
|
||||
<AlertTriangle className="h-4 w-4" />
|
||||
<AlertTitle>Medio desactivado</AlertTitle>
|
||||
<AlertDescription>
|
||||
El medio "{medioNombre}" está desactivado. Las operaciones de edición, activación y
|
||||
desactivación de sus puntos de venta están bloqueadas hasta que se reactive el medio.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { AlertTriangle } from 'lucide-react'
|
||||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
|
||||
|
||||
interface PdvInactivoBannerProps {
|
||||
puntoDeVentaNombre: string
|
||||
}
|
||||
|
||||
export function PdvInactivoBanner({ puntoDeVentaNombre }: PdvInactivoBannerProps) {
|
||||
return (
|
||||
<Alert variant="destructive" className="mb-4">
|
||||
<AlertTriangle className="h-4 w-4" />
|
||||
<AlertTitle>Punto de venta desactivado</AlertTitle>
|
||||
<AlertDescription>
|
||||
El punto de venta "{puntoDeVentaNombre}" está desactivado. Reactivalo para habilitar
|
||||
nuevamente sus operaciones.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)
|
||||
}
|
||||
@@ -21,6 +21,10 @@ import { SeccionesListPage } from './features/secciones/pages/SeccionesListPage'
|
||||
import { CreateSeccionPage } from './features/secciones/pages/CreateSeccionPage'
|
||||
import { EditSeccionPage } from './features/secciones/pages/EditSeccionPage'
|
||||
import { SeccionDetailPage } from './features/secciones/pages/SeccionDetailPage'
|
||||
import { PuntosDeVentaListPage } from './features/puntos-de-venta/pages/PuntosDeVentaListPage'
|
||||
import { CreatePuntoDeVentaPage } from './features/puntos-de-venta/pages/CreatePuntoDeVentaPage'
|
||||
import { PuntoDeVentaDetailPage } from './features/puntos-de-venta/pages/PuntoDeVentaDetailPage'
|
||||
import { EditPuntoDeVentaPage } from './features/puntos-de-venta/pages/EditPuntoDeVentaPage'
|
||||
import { HomePage } from './pages/HomePage'
|
||||
import { PublicLayout } from './layouts/PublicLayout'
|
||||
import { ProtectedLayout } from './layouts/ProtectedLayout'
|
||||
@@ -240,6 +244,40 @@ export function AppRoutes() {
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Puntos de Venta routes */}
|
||||
<Route
|
||||
path="/admin/puntos-de-venta"
|
||||
element={
|
||||
<ProtectedPage requiredPermissions={['administracion:puntos_de_venta:gestionar']}>
|
||||
<PuntosDeVentaListPage />
|
||||
</ProtectedPage>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/admin/puntos-de-venta/nuevo"
|
||||
element={
|
||||
<ProtectedPage requiredPermissions={['administracion:puntos_de_venta:gestionar']}>
|
||||
<CreatePuntoDeVentaPage />
|
||||
</ProtectedPage>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/admin/puntos-de-venta/:id"
|
||||
element={
|
||||
<ProtectedPage requiredPermissions={['administracion:puntos_de_venta:gestionar']}>
|
||||
<PuntoDeVentaDetailPage />
|
||||
</ProtectedPage>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/admin/puntos-de-venta/:id/edit"
|
||||
element={
|
||||
<ProtectedPage requiredPermissions={['administracion:puntos_de_venta:gestionar']}>
|
||||
<EditPuntoDeVentaPage />
|
||||
</ProtectedPage>
|
||||
}
|
||||
/>
|
||||
|
||||
<Route path="*" element={<Navigate to="/" replace />} />
|
||||
</Routes>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user