refactor(Arch): Refatora a arquitetura de pastas do projeto
This commit is contained in:
parent
ab45ac32bf
commit
5297d6ab2e
253 changed files with 810 additions and 1114 deletions
|
|
@ -4,8 +4,8 @@ import { useEffect } from 'react';
|
|||
import { useParams } from 'next/navigation';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useGUsuarioReadHooks } from '@/app/(protected)/(administrativo)/_hooks/g_usuario/useGUsuarioReadHooks';
|
||||
import Usuario from '@/app/(protected)/(administrativo)/_interfaces/GUsuarioInterface';
|
||||
import { useGUsuarioReadHooks } from '@/packages/administrativo/hooks/GUsuario/useGUsuarioReadHooks';
|
||||
import Usuario from '@/packages/administrativo/interfaces/GUsuario/GUsuarioInterface';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
export default function UsuarioDetalhes() {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|||
import { useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { GUsuarioSchema } from '../../../_schemas/GUsuarioSchema';
|
||||
import { GUsuarioSchema } from '../../../../../../packages/administrativo/schemas/GUsuario/GUsuarioSchema';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
FormMessage,
|
||||
} from '@/components/ui/form';
|
||||
|
||||
import { useGUsuarioSaveHook } from '../../../_hooks/g_usuario/useGUsuarioSaveHook';
|
||||
import { useGUsuarioSaveHook } from '../../../../../../packages/administrativo/hooks/GUsuario/useGUsuarioSaveHook';
|
||||
|
||||
type FormValues = z.infer<typeof GUsuarioSchema>;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ import {
|
|||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
|
||||
import Usuario from '../../_interfaces/GUsuarioInterface';
|
||||
import Usuario from '../../../../../packages/administrativo/interfaces/GUsuario/GUsuarioInterface';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import Link from 'next/link';
|
||||
import { useGUsuarioIndexHook } from '../../_hooks/g_usuario/useGUsuarioIndexHook';
|
||||
import { useGUsuarioIndexHook } from '../../../../../packages/administrativo/hooks/GUsuario/useGUsuarioIndexHook';
|
||||
import { useEffect } from 'react';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
import TTBAndamentoServicoIndex from "@/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex";
|
||||
|
||||
export default function TAtoParteTipo() {
|
||||
|
||||
return (
|
||||
< TTBAndamentoServicoIndex />
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GTBBairroIndex from "@/packages/administrativo/components/GTBBairro/GTBBairroIndex";
|
||||
|
||||
export default function GCidadePage() {
|
||||
return (
|
||||
< GTBBairroIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import TCensecIndex from "@/packages/administrativo/components/TCensec/TCensecIndex";
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return (
|
||||
< TCensecIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import TCensecNaturezaLitigioIndex from "@/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex";
|
||||
|
||||
export default function GCidadePage() {
|
||||
return (
|
||||
< TCensecNaturezaLitigioIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import TCensecQualidadeIndex from "@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex";
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return (
|
||||
< TCensecQualidadeIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import TCensecTipoAtoIndex from "@/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex";
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return (
|
||||
< TCensecTipoAtoIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GCidadeIndex from "@/packages/administrativo/components/GCidade/GCidadeIndex";
|
||||
|
||||
export default function GCidadePage() {
|
||||
return (
|
||||
< GCidadeIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GTBTipoLogradouroIndex from "@/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex";
|
||||
|
||||
export default function GMedidaTipoPage() {
|
||||
return (
|
||||
< GTBTipoLogradouroIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GMedidaTipoIndex from "@/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex";
|
||||
|
||||
export default function GMedidaTipoPage() {
|
||||
return (
|
||||
< GMedidaTipoIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GTBEstadoCivilIndex from "@/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex";
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return (
|
||||
< GTBEstadoCivilIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GTBProfissaoIndex from "@/packages/administrativo/components/GTBProfissao/GTBProfissaoIndex";
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return (
|
||||
< GTBProfissaoIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GTBRegimeBensIndex from "@/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensIndex";
|
||||
|
||||
export default function GTBRegimeBensPage() {
|
||||
return (
|
||||
< GTBRegimeBensIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GTBRegimeComunhaoIndex from "@/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex";
|
||||
|
||||
export default function GTBRegimeBensPage() {
|
||||
return (
|
||||
< GTBRegimeComunhaoIndex />
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import TTBReconhecimentoTipoIndex from "@/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndex";
|
||||
|
||||
export default function TAtoParteTipo() {
|
||||
|
||||
return (
|
||||
< TTBReconhecimentoTipoIndex />
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GCidadeTable from '../../_components/g_cidade/GCidadeTable';
|
||||
import GCidadeForm from '../../_components/g_cidade/GCidadeForm';
|
||||
|
||||
import { useGCidadeReadHook } from '../../_hooks/g_cidade/useGCidadeReadHook';
|
||||
import { useGCidadeSaveHook } from '../../_hooks/g_cidade/useGCidadeSaveHook';
|
||||
import { useGCidadeRemoveHook } from '../../_hooks/g_cidade/useGCidadeRemoveHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import GCidadeInterface from '../../_interfaces/GCidadeInterface';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
export default function GCidadePage() {
|
||||
// Hooks para leitura e salvamento
|
||||
const { gCidade, fetchGCidade } = useGCidadeReadHook();
|
||||
const { saveGCidade } = useGCidadeSaveHook();
|
||||
const { removeGCidade } = useGCidadeRemoveHook();
|
||||
|
||||
// Estados
|
||||
const [selectedCidade, setSelectedCidade] = useState<GCidadeInterface | null>(null);
|
||||
const [isFormOpen, setIsFormOpen] = useState(false);
|
||||
|
||||
// Estado para saber qual item será deletado
|
||||
const [itemToDelete, setItemToDelete] = useState<GCidadeInterface | null>(null);
|
||||
|
||||
/**
|
||||
* Hook do modal de confirmação
|
||||
*/
|
||||
const {
|
||||
isOpen: isConfirmOpen,
|
||||
openDialog: openConfirmDialog,
|
||||
handleConfirm,
|
||||
handleCancel,
|
||||
} = useConfirmDialog();
|
||||
|
||||
/**
|
||||
* Abre o formulário no modo de edição ou criação
|
||||
*/
|
||||
const handleOpenForm = useCallback((data: GCidadeInterface | null) => {
|
||||
setSelectedCidade(data);
|
||||
setIsFormOpen(true);
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Fecha o formulário e limpa o andamento selecionado
|
||||
*/
|
||||
const handleCloseForm = useCallback((_: null, __: boolean) => {
|
||||
setSelectedCidade(null);
|
||||
setIsFormOpen(false);
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Salva os dados do formulário
|
||||
*/
|
||||
const handleSave = useCallback(async (formData: GCidadeInterface) => {
|
||||
|
||||
|
||||
// Aguarda salvar o registro
|
||||
await saveGCidade(formData);
|
||||
|
||||
// Atualiza a lista de dados
|
||||
fetchGCidade();
|
||||
},
|
||||
[saveGCidade, fetchGCidade],
|
||||
);
|
||||
|
||||
/**
|
||||
* Quando o usuário clica em "remover" na tabela
|
||||
*/
|
||||
const handleConfirmDelete = useCallback(
|
||||
(item: GCidadeInterface) => {
|
||||
// Define o item atual para remoção
|
||||
setItemToDelete(item);
|
||||
|
||||
// Abre o modal de confirmação
|
||||
openConfirmDialog();
|
||||
},
|
||||
[openConfirmDialog],
|
||||
);
|
||||
|
||||
/**
|
||||
* Executa a exclusão de fato quando o usuário confirma
|
||||
*/
|
||||
const handleDelete = useCallback(async () => {
|
||||
// Protege contra null
|
||||
if (!itemToDelete) return;
|
||||
|
||||
// Executa o Hook de remoção
|
||||
await removeGCidade(itemToDelete);
|
||||
|
||||
// Atualiza a lista
|
||||
await fetchGCidade();
|
||||
|
||||
// Limpa o item selecionado
|
||||
setItemToDelete(null);
|
||||
|
||||
// Fecha o modal
|
||||
handleCancel();
|
||||
}, [itemToDelete, fetchGCidade, handleCancel]);
|
||||
|
||||
/**
|
||||
* Busca inicial dos dados
|
||||
*/
|
||||
useEffect(() => {
|
||||
fetchGCidade();
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Tela de loading enquanto carrega os dados
|
||||
*/
|
||||
if (!gCidade) {
|
||||
return <Loading type={2} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* Cabeçalho */}
|
||||
<Header
|
||||
title={'Cidades'}
|
||||
description={'Gerenciamento de Cidades'}
|
||||
buttonText={'Nova Cidade'}
|
||||
buttonAction={() => {
|
||||
handleOpenForm(null);
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Tabela de andamentos */}
|
||||
<Card>
|
||||
<CardContent>
|
||||
<GCidadeTable data={gCidade} onEdit={handleOpenForm} onDelete={handleConfirmDelete} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Modal de confirmação */}
|
||||
<ConfirmDialog
|
||||
isOpen={isConfirmOpen}
|
||||
title="Confirmar exclusão"
|
||||
description="Atenção"
|
||||
message={`Deseja realmente excluir a cidade "${itemToDelete?.cidade_nome}"?`}
|
||||
confirmText="Sim, excluir"
|
||||
cancelText="Cancelar"
|
||||
onConfirm={handleDelete}
|
||||
onCancel={handleCancel}
|
||||
/>
|
||||
|
||||
{/* Formulário de criação/edição */}
|
||||
<GCidadeForm
|
||||
isOpen={isFormOpen}
|
||||
data={selectedCidade}
|
||||
onClose={handleCloseForm}
|
||||
onSave={handleSave}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
4;
|
||||
}
|
||||
|
|
@ -7,8 +7,8 @@ import { Card, CardContent } from '@/components/ui/card';
|
|||
import MainEditor from '@/components/MainEditor';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import { useTMinutaReadHook } from '../../../../_hooks/t_minuta/useTMinutaReadHook';
|
||||
import { TMinutaInterface } from '../../../../_interfaces/TMinutaInterface';
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
|
||||
export default function TMinutaDetalhes() {
|
||||
const params = useParams();
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ import { Input } from '@/components/ui/input';
|
|||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { TMinutaSchema } from '../../../_schemas/TMinutaSchema';
|
||||
import { useTMinutaSaveHook } from '../../../_hooks/t_minuta/useTMinutaSaveHook';
|
||||
import { TMinutaSchema } from '@/packages/administrativo/schemas/TMinuta/TMinutaSchema';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
type FormValues = z.infer<typeof TMinutaSchema>;
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@ import Header from '@/shared/components/structure/Header';
|
|||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
import TMinutaTable from '../../_components/t_minuta/TMinutaTable';
|
||||
import TMinutaForm from '../../_components/t_minuta/TMinutaForm';
|
||||
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
|
||||
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
|
||||
|
||||
import { useTMinutaReadHook } from '../../_hooks/t_minuta/useTMinutaReadHook';
|
||||
import { useTMinutaSaveHook } from '../../_hooks/t_minuta/useTMinutaSaveHook';
|
||||
import { useTMinutaRemoveHook } from '../../_hooks/t_minuta/useTMinutaRemoveHook';
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
import { useTMinutaRemoveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaRemoveHook';
|
||||
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
import { useTMinutaIndexHook } from '../../_hooks/t_minuta/useTMinutaIndexHook';
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
|
||||
|
||||
export default function TMinutaPage() {
|
||||
// Hooks de leitura e escrita
|
||||
|
|
|
|||
|
|
@ -1,127 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow
|
||||
} from "@/components/ui/table";
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from "lucide-react";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import TCensecInterface from "../../_interfaces/TCensecInterface";
|
||||
|
||||
interface TCensecTipoAtoTableProps {
|
||||
data: TCensecTipoAtoInterface[];
|
||||
tCensec: TCensecInterface[];
|
||||
onEdit: (item: TCensecTipoAtoInterface, isEditingFormStatus: boolean) => void;
|
||||
onDelete: (item: TCensecTipoAtoInterface, isEditingFormStatus: boolean) => void;
|
||||
}
|
||||
|
||||
function StatusBadge({ situacao }: { situacao: string }) {
|
||||
const isActive = situacao === "A";
|
||||
|
||||
const baseClasses =
|
||||
"text-xs font-medium px-2.5 py-0.5 rounded-sm me-2";
|
||||
|
||||
const activeClasses =
|
||||
"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300";
|
||||
|
||||
const inactiveClasses =
|
||||
"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300";
|
||||
|
||||
return (
|
||||
<span className={`${baseClasses} ${isActive ? activeClasses : inactiveClasses}`}>
|
||||
{isActive ? "Ativo" : "Inativo"}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
export default function TCensecTipoAtoTable({
|
||||
data,
|
||||
tCensec,
|
||||
onEdit,
|
||||
onDelete
|
||||
}: TCensecTipoAtoTableProps) {
|
||||
return (
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>#</TableHead>
|
||||
<TableHead>Situação</TableHead>
|
||||
<TableHead>Central do CENSEC</TableHead>
|
||||
{/*<TableHead>Código</TableHead>*/}
|
||||
<TableHead>Descrição</TableHead>
|
||||
<TableHead>Separação</TableHead>
|
||||
<TableHead>Revogação</TableHead>
|
||||
<TableHead className="text-right">Ações</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
|
||||
<TableBody>
|
||||
{data.map((item) => {
|
||||
const censecDesc = tCensec.find(c => c.censec_id === item.censec_id)?.descricao || "N/A"
|
||||
return (
|
||||
<TableRow key={item.censec_tipoato_id} className="cursor-pointer">
|
||||
<TableCell className="font-medium">
|
||||
{item.censec_tipoato_id}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<StatusBadge situacao={item.situacao} />
|
||||
</TableCell>
|
||||
<TableCell>{censecDesc}</TableCell>
|
||||
{/*<TableCell>{item.codigo ?? "-"}</TableCell>*/}
|
||||
<TableCell>{item.descricao}</TableCell>
|
||||
<TableCell>{item.tipo_separacao ?? "-"}</TableCell>
|
||||
<TableCell>{item.tipo_revogacao ?? "-"}</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="cursor-pointer"
|
||||
>
|
||||
<EllipsisIcon />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent side="left" align="start">
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onEdit(item, true)}
|
||||
>
|
||||
<PencilIcon className="mr-2 h-4 w-4" />
|
||||
Editar
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onDelete(item, true)}
|
||||
>
|
||||
<Trash2Icon className="mr-2 h-4 w-4" />
|
||||
Remover
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)})}
|
||||
</TableBody>
|
||||
</Table>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,251 +0,0 @@
|
|||
export default async function TCensecTipoAtoMockDeDados() {
|
||||
return Promise.resolve({
|
||||
status: 200,
|
||||
message: 'Dados localizados',
|
||||
data: [
|
||||
{
|
||||
censec_tipoato_id: 1,
|
||||
censec_id: 2,
|
||||
codigo: 1,
|
||||
descricao: "Escritura",
|
||||
situacao: "I",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 2,
|
||||
censec_id: 1,
|
||||
codigo: 2,
|
||||
descricao: "Procuração",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 3,
|
||||
censec_id: 1,
|
||||
codigo: 3,
|
||||
descricao: "Procuração para Fins Previdenciários",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 4,
|
||||
censec_id: 1,
|
||||
codigo: 5,
|
||||
descricao: "Renúncia de Procuração",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 5,
|
||||
censec_id: 1,
|
||||
codigo: 6,
|
||||
descricao: "Revogação de Procuração",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 6,
|
||||
censec_id: 1,
|
||||
codigo: 7,
|
||||
descricao: "Substabelecimento",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 7,
|
||||
censec_id: 1,
|
||||
codigo: 8,
|
||||
descricao: "Ata Notarial",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 8,
|
||||
censec_id: 2,
|
||||
codigo: 1,
|
||||
descricao: "Separação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "S",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 9,
|
||||
censec_id: 2,
|
||||
codigo: 2,
|
||||
descricao: "Reconciliação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 10,
|
||||
censec_id: 2,
|
||||
codigo: 3,
|
||||
descricao: "Conversão de Separação em Divórcio",
|
||||
situacao: "A",
|
||||
tipo_separacao: "S",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 11,
|
||||
censec_id: 2,
|
||||
codigo: 4,
|
||||
descricao: "Divórcio Direto",
|
||||
situacao: "A",
|
||||
tipo_separacao: "S",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 12,
|
||||
censec_id: 2,
|
||||
codigo: 5,
|
||||
descricao: "Inventário",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 13,
|
||||
censec_id: 2,
|
||||
codigo: 6,
|
||||
descricao: "Sobrepartilha",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 14,
|
||||
censec_id: 2,
|
||||
codigo: 7,
|
||||
descricao: "Retificação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 15,
|
||||
censec_id: 3,
|
||||
codigo: 1,
|
||||
descricao: "Aditamento",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 16,
|
||||
censec_id: 3,
|
||||
codigo: 2,
|
||||
descricao: "Cerrado",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 17,
|
||||
censec_id: 3,
|
||||
codigo: 3,
|
||||
descricao: "Revogação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "S"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 18,
|
||||
censec_id: 3,
|
||||
codigo: 4,
|
||||
descricao: "Testamento",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 19,
|
||||
censec_id: 3,
|
||||
codigo: 5,
|
||||
descricao: "Testamento com Revogação",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 20,
|
||||
censec_id: 3,
|
||||
codigo: 6,
|
||||
descricao: "Testamento sem Conteúdo Patrimonial",
|
||||
situacao: "A",
|
||||
tipo_separacao: "N",
|
||||
tipo_revogacao: "N"
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 21,
|
||||
censec_id: 9,
|
||||
codigo: null,
|
||||
descricao: "Atos Diversos",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 204,
|
||||
censec_id: 1,
|
||||
codigo: 75,
|
||||
descricao: "Conciliação",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 208,
|
||||
censec_id: 1,
|
||||
codigo: 76,
|
||||
descricao: "Mediação",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 209,
|
||||
censec_id: 1,
|
||||
codigo: 8,
|
||||
descricao: "Compra e Venda",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 210,
|
||||
censec_id: 1,
|
||||
codigo: 1,
|
||||
descricao: "Escritura",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 211,
|
||||
censec_id: 2,
|
||||
codigo: 8,
|
||||
descricao: "Nomeação de Inventariante",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
},
|
||||
{
|
||||
censec_tipoato_id: 212,
|
||||
censec_id: 2,
|
||||
codigo: 9,
|
||||
descricao: "Partilha",
|
||||
situacao: "A",
|
||||
tipo_separacao: null,
|
||||
tipo_revogacao: null
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import GTBProfissaoRemoveData from '../../_data/GTBProfissao/GTBProfissaoRemoveData';
|
||||
import GTBProfissaoInterface from '../../_interfaces/GTBProfissaoInterface';
|
||||
|
||||
export default async function GTBProfissaoRemoveService(data: GTBProfissaoInterface) {
|
||||
const response = await GTBProfissaoRemoveData(data);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import GTBProfissaoSaveData from '../../_data/GTBProfissao/GTBProfissaoSaveData';
|
||||
import GTBProfissaoInterface from '../../_interfaces/GTBProfissaoInterface';
|
||||
|
||||
export default async function GTProfissaoSaveService(data: GTBProfissaoInterface) {
|
||||
const response = await GTBProfissaoSaveData(data);
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import GTBRegimeBensRemoveData from '../../_data/GTBRegimeBens/GTBRegimeBensRemoveData';
|
||||
import GTBRegimeBensInterface from '../../_interfaces/GTBRegimeBensInterface';
|
||||
|
||||
export default async function GTBRegimeBensRemoveService(data: GTBRegimeBensInterface) {
|
||||
const response = await GTBRegimeBensRemoveData(data);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import TMinutaIndexData from '../../_data/TMinuta/TMinutaIndexData';
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
|
||||
export default async function TMinutaIndex() {
|
||||
const response = await TMinutaIndexData();
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
import { FileText, Heart, Briefcase, Scale, Link as LinkIcon, MapPin } from 'lucide-react';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function CadastrosPage() {
|
||||
const items = [
|
||||
{
|
||||
title: 'Documentos',
|
||||
description: 'Gerencie os tipos de documentos aceitos e suas configurações no sistema.',
|
||||
icon: FileText,
|
||||
},
|
||||
{
|
||||
title: 'Estado Civil',
|
||||
description: 'Cadastre e mantenha os diferentes estados civis utilizados nos registros.',
|
||||
icon: Heart,
|
||||
},
|
||||
{
|
||||
title: 'Profissão',
|
||||
description: 'Gerencie a lista de profissões para utilização em cadastros e registros.',
|
||||
icon: Briefcase,
|
||||
},
|
||||
{
|
||||
title: 'Regime de Comunhão',
|
||||
description: 'Defina os regimes de comunhão aplicáveis em matrimônios e registros civis.',
|
||||
icon: Scale,
|
||||
},
|
||||
{
|
||||
title: 'Vínculo de Sinal Público',
|
||||
description:
|
||||
'Controle e cadastre vínculos relacionados a sinais públicos para autenticações.',
|
||||
icon: LinkIcon,
|
||||
},
|
||||
{
|
||||
title: 'Municípios',
|
||||
description: 'Gerencie a base de municípios para utilização em endereços e cadastros.',
|
||||
icon: MapPin,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div>
|
||||
<h1 className="mb-1 text-4xl font-semibold">Complementos de Cadastro pessoal</h1>
|
||||
<p className="text-muted-foreground text-base">
|
||||
Gerencie os cadastros relacionados a regimes, como estado civil, regime de comunhão e
|
||||
outras informações complementares necessárias para o registro de pessoas.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-5 gap-3">
|
||||
{items.map((item, key) => (
|
||||
<Link key={key} href={'/'}>
|
||||
<Card className="hover:bg-muted cursor-pointer transition-colors">
|
||||
<CardContent>
|
||||
<span className="mb-2 inline-flex shrink-0 rounded-md border border-blue-300 bg-blue-100 p-2 dark:border-blue-300/10 dark:bg-blue-400/10">
|
||||
<item.icon className="size-6 stroke-blue-700 dark:stroke-blue-500" />
|
||||
</span>
|
||||
<h3 className="mt-3 text-2xl font-medium tracking-tight text-gray-900 dark:text-white">
|
||||
{item.title}
|
||||
</h3>
|
||||
<p className="mt-1 text-sm text-gray-500 dark:text-gray-400">{item.description}</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { Card, CardAction, CardContent, CardDescription, CardTitle } from '@/components/ui/card';
|
||||
import {
|
||||
BabyIcon,
|
||||
CrossIcon,
|
||||
FileCheckIcon,
|
||||
FileTextIcon,
|
||||
GavelIcon,
|
||||
GlobeIcon,
|
||||
HeartIcon,
|
||||
PenIcon,
|
||||
ScrollIcon,
|
||||
UsersIcon,
|
||||
} from 'lucide-react';
|
||||
|
||||
const services = [
|
||||
{
|
||||
title: 'Registro de Nascimento',
|
||||
description:
|
||||
'Emissão e registro de certidões de nascimento, garantindo a cidadania e identidade legal do recém-nascido.',
|
||||
icon: BabyIcon,
|
||||
},
|
||||
{
|
||||
title: 'Registro de Casamento',
|
||||
description: 'Processo completo para habilitação, registro e emissão da certidão de casamento.',
|
||||
icon: HeartIcon,
|
||||
},
|
||||
{
|
||||
title: 'Registro de Óbito',
|
||||
description:
|
||||
'Lavratura do registro de óbito e emissão da certidão correspondente para fins legais.',
|
||||
icon: CrossIcon,
|
||||
},
|
||||
{
|
||||
title: 'Reconhecimento de Firma',
|
||||
description: 'Autenticação da assinatura de documentos, garantindo sua validade jurídica.',
|
||||
icon: PenIcon,
|
||||
},
|
||||
{
|
||||
title: 'Autenticação de Documentos',
|
||||
description: 'Confirmação de que cópias estão de acordo com o documento original apresentado.',
|
||||
icon: FileCheckIcon,
|
||||
},
|
||||
{
|
||||
title: 'Procurações',
|
||||
description:
|
||||
'Elaboração e registro de procurações públicas para representação legal de pessoas físicas ou jurídicas.',
|
||||
icon: ScrollIcon,
|
||||
},
|
||||
{
|
||||
title: 'Testamentos',
|
||||
description: 'Lavratura e registro de testamentos públicos com segurança jurídica.',
|
||||
icon: GavelIcon,
|
||||
},
|
||||
{
|
||||
title: 'Divórcio Extrajudicial',
|
||||
description:
|
||||
'Formalização do divórcio por via administrativa, de forma rápida e sem processo judicial.',
|
||||
icon: UsersIcon,
|
||||
},
|
||||
{
|
||||
title: 'Apostilamento de Documentos',
|
||||
description:
|
||||
'Apostilamento conforme a Convenção da Haia para validade internacional de documentos.',
|
||||
icon: GlobeIcon,
|
||||
},
|
||||
{
|
||||
title: 'Certidões e Segunda Via',
|
||||
description: 'Emissão de segundas vias e certidões de nascimento, casamento e óbito.',
|
||||
icon: FileTextIcon,
|
||||
},
|
||||
];
|
||||
|
||||
export default function ServicosPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="bg-primary/10 border-primary/20 w-full rounded-xl border p-6">
|
||||
<h2 className="text-primary text-2xl font-semibold">Bem-vindo(a)!</h2>
|
||||
<p className="mt-2 text-base text-gray-700">
|
||||
Olá, <span className="text-primary font-bold">Keven</span>! É um prazer ter você conosco.
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-3 grid grid-cols-4 space-y-2 space-x-2">
|
||||
{services.map((item: any, index) => (
|
||||
<Card className="cursor-pointer" key={index}>
|
||||
<CardContent>
|
||||
<div className="bg-primary flex h-12 w-12 items-center justify-center rounded-2xl">
|
||||
<item.icon className="h-6 w-6 text-white" />
|
||||
</div>
|
||||
|
||||
<CardTitle className="mt-3">{item.title}</CardTitle>
|
||||
<CardDescription className="mt-3">{item.description}</CardDescription>
|
||||
</CardContent>
|
||||
</Card>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -83,47 +83,47 @@ const data = {
|
|||
items: [
|
||||
{
|
||||
title: 'Reconhecimentos',
|
||||
url: '/cadastros/reconhecimentos/',
|
||||
url: '/administrativo/reconhecimentos/',
|
||||
},
|
||||
{
|
||||
title: 'Andamentos',
|
||||
url: '/cadastros/andamentos/',
|
||||
url: '/administrativo/andamentos/',
|
||||
},
|
||||
{
|
||||
title: 'Profissões',
|
||||
url: '/cadastros/profissoes/',
|
||||
url: '/administrativo/pessoas/profissoes/',
|
||||
},
|
||||
{
|
||||
title: 'Regimes/Bens',
|
||||
url: '/cadastros/regime-bens/',
|
||||
url: '/administrativo/pessoas/regimes-bens/',
|
||||
},
|
||||
{
|
||||
title: 'Tipos de Logradouros',
|
||||
url: '/cadastros/tipo-logradouro',
|
||||
},
|
||||
{
|
||||
title: 'Bairro',
|
||||
url: '/cadastros/bairro',
|
||||
url: '/administrativo/imoveis/tipos-logradouro',
|
||||
},
|
||||
{
|
||||
title: 'Estado Civil',
|
||||
url: '/cadastros/estado-civil',
|
||||
url: '/administrativo/pessoas/estados-civis',
|
||||
},
|
||||
{
|
||||
title: "Regimes/Comunhão",
|
||||
url: "/administrativo/pessoas/regimes-comunhao/",
|
||||
},
|
||||
{
|
||||
title: 'Tipo de Medida',
|
||||
url: '/cadastros/medida-tipo',
|
||||
},
|
||||
{
|
||||
title: 'Pessoas',
|
||||
url: '/cadastros/pessoas/complementos/',
|
||||
url: '/administrativo/medidas/tipos',
|
||||
},
|
||||
{
|
||||
title: 'Cidades',
|
||||
url: '/cadastros/cidades/',
|
||||
url: '/administrativo/cidades/',
|
||||
},
|
||||
{
|
||||
title: 'Bairro',
|
||||
url: '/administrativo/bairros',
|
||||
},
|
||||
{
|
||||
title: 'Minuta',
|
||||
url: '/cadastros/minuta/',
|
||||
url: '/administrativo/minutas/',
|
||||
},
|
||||
{
|
||||
title: 'Minuta/Naturezas',
|
||||
|
|
@ -131,23 +131,19 @@ const data = {
|
|||
},
|
||||
{
|
||||
title: "Censec/Tipo do Ato",
|
||||
url: "/cadastros/censec-tipoato"
|
||||
url: "/administrativo/centrais/censec/tipos-atos"
|
||||
},
|
||||
{
|
||||
title: "Censec/Qualidades",
|
||||
url: "/administrativo/censec/qualidades"
|
||||
url: "/administrativo/centrais/censec/qualidades"
|
||||
},
|
||||
{
|
||||
title: 'Censec/Centrais',
|
||||
url: '/cadastros/censec/',
|
||||
url: '/administrativo/centrais/censec/centrais',
|
||||
},
|
||||
{
|
||||
title: 'Censec/Natureza Litígio',
|
||||
url: '/cadastros/censec-natureza-litigio',
|
||||
},
|
||||
{
|
||||
title: "Regimes/Comunhão",
|
||||
url: "/cadastros/regime-comunhao/",
|
||||
url: '/administrativo/centrais/censec/naturezas-litigios',
|
||||
},
|
||||
{
|
||||
title: "Atos/Partes Tipos",
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ import { Card, CardContent } from '@/components/ui/card';
|
|||
import { Input } from '@/components/ui/input';
|
||||
import z from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import GUsuarioLoginService from '@/app/(protected)/(administrativo)/_services/g_usuario/GUsuarioLogin';
|
||||
import GUsuarioLoginService from '@/packages/administrativo/services/GUsuario/GUsuarioLogin';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { useState } from 'react';
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from './ui/form';
|
||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||
import { Button } from './ui/button';
|
||||
import { GUsuarioLoginSchema } from '@/app/(protected)/(administrativo)/_schemas/GUsuarioLoginSchema';
|
||||
import { GUsuarioLoginSchema } from '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
|
||||
|
||||
type FormValues = z.infer<typeof GUsuarioLoginSchema>;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import {
|
|||
|
||||
import GUsuarioAuthenticatedInterface from '@/shared/interfaces/GUsuarioAuthenticatedInterface';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useGUsuarioLogoutHook } from '@/app/(protected)/(administrativo)/_hooks/g_usuario/useGUsuarioLogoutHook';
|
||||
import { useGUsuarioLogoutHook } from '@/packages/administrativo/hooks/GUsuario/useGUsuarioLogoutHook';
|
||||
import { use, useCallback, useState } from 'react';
|
||||
|
||||
export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ import {
|
|||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
|
||||
import { GCidadeSchema } from '../../_schemas/GCidadeSchema';
|
||||
import { GCidadeSchema } from '../../schemas/GCidade/GCidadeSchema';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
// Hook responsável em trazer todos os estados brasileiros
|
||||
import { useGUfReadHook } from '../../_hooks/g_uf/useGUfReadHook';
|
||||
import { useGUfReadHook } from '@/packages/administrativo/hooks/GUF/useGUfReadHook';
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
|
|
@ -155,10 +155,10 @@ export default function GCidadeForm({ isOpen, data, onClose, onSave }: Props) {
|
|||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>UF</FormLabel>
|
||||
<Select
|
||||
value={field.value ?? ''} // garante que não será null
|
||||
onValueChange={(val) => field.onChange(val)}
|
||||
>
|
||||
<Select
|
||||
value={field.value ?? ''} // garante que não será null
|
||||
onValueChange={(val) => field.onChange(val)}
|
||||
>
|
||||
<FormControl className="w-full">
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Selecione o estado desejado" />
|
||||
163
src/packages/administrativo/components/GCidade/GCidadeIndex.tsx
Normal file
163
src/packages/administrativo/components/GCidade/GCidadeIndex.tsx
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GCidadeTable from '@/packages/administrativo/components/GCidade/GCidadeTable';
|
||||
import GCidadeForm from '@/packages/administrativo/components/GCidade/GCidadeForm';
|
||||
|
||||
import { useGCidadeReadHook } from '@/packages/administrativo/hooks/GCidade/useGCidadeReadHook';
|
||||
import { useGCidadeSaveHook } from '@/packages/administrativo/hooks/GCidade/useGCidadeSaveHook';
|
||||
import { useGCidadeRemoveHook } from '@/packages/administrativo/hooks/GCidade/useGCidadeRemoveHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import GCidadeInterface from '@/packages/administrativo/interfaces/GCidade/GCidadeInterface';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
export default function GCidadeIndex() {
|
||||
// Hooks para leitura e salvamento
|
||||
const { gCidade, fetchGCidade } = useGCidadeReadHook();
|
||||
const { saveGCidade } = useGCidadeSaveHook();
|
||||
const { removeGCidade } = useGCidadeRemoveHook();
|
||||
|
||||
// Estados
|
||||
const [selectedCidade, setSelectedCidade] = useState<GCidadeInterface | null>(null);
|
||||
const [isFormOpen, setIsFormOpen] = useState(false);
|
||||
|
||||
// Estado para saber qual item será deletado
|
||||
const [itemToDelete, setItemToDelete] = useState<GCidadeInterface | null>(null);
|
||||
|
||||
/**
|
||||
* Hook do modal de confirmação
|
||||
*/
|
||||
const {
|
||||
isOpen: isConfirmOpen,
|
||||
openDialog: openConfirmDialog,
|
||||
handleConfirm,
|
||||
handleCancel,
|
||||
} = useConfirmDialog();
|
||||
|
||||
/**
|
||||
* Abre o formulário no modo de edição ou criação
|
||||
*/
|
||||
const handleOpenForm = useCallback((data: GCidadeInterface | null) => {
|
||||
setSelectedCidade(data);
|
||||
setIsFormOpen(true);
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Fecha o formulário e limpa o andamento selecionado
|
||||
*/
|
||||
const handleCloseForm = useCallback((_: null, __: boolean) => {
|
||||
setSelectedCidade(null);
|
||||
setIsFormOpen(false);
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Salva os dados do formulário
|
||||
*/
|
||||
const handleSave = useCallback(async (formData: GCidadeInterface) => {
|
||||
|
||||
|
||||
// Aguarda salvar o registro
|
||||
await saveGCidade(formData);
|
||||
|
||||
// Atualiza a lista de dados
|
||||
fetchGCidade();
|
||||
},
|
||||
[saveGCidade, fetchGCidade],
|
||||
);
|
||||
|
||||
/**
|
||||
* Quando o usuário clica em "remover" na tabela
|
||||
*/
|
||||
const handleConfirmDelete = useCallback(
|
||||
(item: GCidadeInterface) => {
|
||||
// Define o item atual para remoção
|
||||
setItemToDelete(item);
|
||||
|
||||
// Abre o modal de confirmação
|
||||
openConfirmDialog();
|
||||
},
|
||||
[openConfirmDialog],
|
||||
);
|
||||
|
||||
/**
|
||||
* Executa a exclusão de fato quando o usuário confirma
|
||||
*/
|
||||
const handleDelete = useCallback(async () => {
|
||||
// Protege contra null
|
||||
if (!itemToDelete) return;
|
||||
|
||||
// Executa o Hook de remoção
|
||||
await removeGCidade(itemToDelete);
|
||||
|
||||
// Atualiza a lista
|
||||
await fetchGCidade();
|
||||
|
||||
// Limpa o item selecionado
|
||||
setItemToDelete(null);
|
||||
|
||||
// Fecha o modal
|
||||
handleCancel();
|
||||
}, [itemToDelete, fetchGCidade, handleCancel]);
|
||||
|
||||
/**
|
||||
* Busca inicial dos dados
|
||||
*/
|
||||
useEffect(() => {
|
||||
fetchGCidade();
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Tela de loading enquanto carrega os dados
|
||||
*/
|
||||
if (!gCidade) {
|
||||
return <Loading type={2} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* Cabeçalho */}
|
||||
<Header
|
||||
title={'Cidades'}
|
||||
description={'Gerenciamento de Cidades'}
|
||||
buttonText={'Nova Cidade'}
|
||||
buttonAction={() => {
|
||||
handleOpenForm(null);
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Tabela de andamentos */}
|
||||
<Card>
|
||||
<CardContent>
|
||||
<GCidadeTable data={gCidade} onEdit={handleOpenForm} onDelete={handleConfirmDelete} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Modal de confirmação */}
|
||||
<ConfirmDialog
|
||||
isOpen={isConfirmOpen}
|
||||
title="Confirmar exclusão"
|
||||
description="Atenção"
|
||||
message={`Deseja realmente excluir a cidade "${itemToDelete?.cidade_nome}"?`}
|
||||
confirmText="Sim, excluir"
|
||||
cancelText="Cancelar"
|
||||
onConfirm={handleDelete}
|
||||
onCancel={handleCancel}
|
||||
/>
|
||||
|
||||
{/* Formulário de criação/edição */}
|
||||
<GCidadeForm
|
||||
isOpen={isFormOpen}
|
||||
data={selectedCidade}
|
||||
onClose={handleCloseForm}
|
||||
onSave={handleSave}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
4;
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from '@/components/ui/table';
|
||||
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import GCidadeInterface from '../../_interfaces/GCidadeInterface';
|
||||
import GCidadeInterface from '../../interfaces/GCidade/GCidadeInterface';
|
||||
|
||||
// Tipagem das props do componente da tabela
|
||||
interface GCidadeTableProps {
|
||||
|
|
@ -25,8 +25,8 @@ import {
|
|||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||
import { GMedidaTipoSchema } from '../../_schemas/GMedidaTipoSchema';
|
||||
import { GMedidaTipoInterface } from '../../_interfaces/GMedidaTipoInterface';
|
||||
import { GMedidaTipoSchema } from '../../schemas/GMedidaTipo/GMedidaTipoSchema';
|
||||
import { GMedidaTipoInterface } from '../../interfaces/GMedidaTipo/GMedidaTipoInterface';
|
||||
|
||||
type FormValues = z.infer<typeof GMedidaTipoSchema>;
|
||||
|
||||
|
|
@ -8,14 +8,14 @@ import { useResponse } from '@/shared/components/response/ResponseContext';
|
|||
import Header from '@/shared/components/structure/Header';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GMedidaTipoTable from '../../_components/g_medidatipo/GMedidaTipoTable';
|
||||
import GMedidaTipoForm from '../../_components/g_medidatipo/GMedidaTipoForm';
|
||||
import GMedidaTipoTable from './GMedidaTipoTable';
|
||||
import GMedidaTipoForm from './GMedidaTipoForm';
|
||||
|
||||
import { useGMedidaTipoReadHook } from '../../_hooks/g_medidatipo/useGMedidaTipoReadHook';
|
||||
import { useGMedidaTipoSaveHook } from '../../_hooks/g_medidatipo/useGMedidaTipoSaveHook';
|
||||
import { useGMedidaTipoRemoveHook } from '../../_hooks/g_medidatipo/useGMedidaTipoRemoveHook';
|
||||
import { useGMedidaTipoReadHook } from '../../hooks/GMedidaTipo/useGMedidaTipoReadHook';
|
||||
import { useGMedidaTipoSaveHook } from '../../hooks/GMedidaTipo/useGMedidaTipoSaveHook';
|
||||
import { useGMedidaTipoRemoveHook } from '../../hooks/GMedidaTipo/useGMedidaTipoRemoveHook';
|
||||
|
||||
import { GMedidaTipoInterface } from '../../_interfaces/GMedidaTipoInterface';
|
||||
import { GMedidaTipoInterface } from '../../interfaces/GMedidaTipo/GMedidaTipoInterface';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
|
||||
const initialMedidaTipo: GMedidaTipoInterface = {
|
||||
|
|
@ -24,7 +24,7 @@ const initialMedidaTipo: GMedidaTipoInterface = {
|
|||
descricao: '',
|
||||
};
|
||||
|
||||
export default function GMedidaTipoPage() {
|
||||
export default function GMedidaTipoIndex() {
|
||||
// Controle de exibição de respostas
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ import {
|
|||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import { GMedidaTipoInterface } from '../../_interfaces/GMedidaTipoInterface';
|
||||
import { GMedidaTipoInterface } from '../../interfaces/GMedidaTipo/GMedidaTipoInterface';
|
||||
|
||||
interface GMedidaTipoTableProps {
|
||||
data: GMedidaTipoInterface[];
|
||||
|
|
@ -27,7 +27,7 @@ import {
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import { GTBBairroSchema } from '../../_schemas/GTBBairroSchema';
|
||||
import { GTBBairroSchema } from '../../schemas/GTBBairro/GTBBairroSchema';
|
||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
import SituacoesSelect from '@/shared/components/situacoes/SituacoesSelect';
|
||||
|
|
@ -8,14 +8,14 @@ import { useResponse } from '@/shared/components/response/ResponseContext';
|
|||
import Header from '@/shared/components/structure/Header';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GTBBairroTable from '../../_components/g_tb_bairro/GTBBairroTable';
|
||||
import GTBBairroForm from '../../_components/g_tb_bairro/GTBBairroForm';
|
||||
import GTBBairroTable from './GTBBairroTable';
|
||||
import GTBBairroForm from './GTBBairroForm';
|
||||
|
||||
import { useGTBBairroReadHook } from '../../_hooks/g_tb_bairro/useGTBBairroReadHook';
|
||||
import { useGTBBairroSaveHook } from '../../_hooks/g_tb_bairro/useGTBBairroSaveHook';
|
||||
import { useGTBBairroRemoveHook } from '../../_hooks/g_tb_bairro/useGTBBairroRemoveHook';
|
||||
import { useGTBBairroReadHook } from '@/packages/administrativo/hooks/GTBBairro/useGTBBairroReadHook';
|
||||
import { useGTBBairroSaveHook } from '@/packages/administrativo/hooks/GTBBairro/useGTBBairroSaveHook';
|
||||
import { useGTBBairroRemoveHook } from '@/packages/administrativo/hooks/GTBBairro/useGTBBairroRemoveHook';
|
||||
|
||||
import { GTBBairroInterface } from '../../_interfaces/GTBBairroInterface';
|
||||
import { GTBBairroInterface } from '../../interfaces/GTBBairro/GTBBairroInterface';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
|
||||
const initialBairro: GTBBairroInterface = {
|
||||
|
|
@ -25,7 +25,7 @@ const initialBairro: GTBBairroInterface = {
|
|||
situacao: SituacoesEnum.A,
|
||||
};
|
||||
|
||||
export default function GTBBairroPage() {
|
||||
export default function GTBBairroIndex() {
|
||||
// Controle de exibição de respostas
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
|
|
@ -15,8 +15,8 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover
|
|||
import { cn } from '@/lib/utils';
|
||||
import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
|
||||
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
|
||||
import { useGTBBairroReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_bairro/useGTBBairroReadHook';
|
||||
import GTBairroSelectInterface from './GTBairroSelectInterface';
|
||||
import { useGTBBairroReadHook } from '@/packages/administrativo/hooks/GTBBairro/useGTBBairroReadHook';
|
||||
import GTBairroSelectInterface from '../../interfaces/GTBBairro/GTBairroSelectInterface';
|
||||
|
||||
export default function GTBBairroSelect({ field }: GTBairroSelectInterface) {
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import { GTBBairroInterface } from '../../_interfaces/GTBBairroInterface';
|
||||
import { GTBBairroInterface } from '../../interfaces/GTBBairro/GTBBairroInterface';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
|
||||
interface GTBBairroTableProps {
|
||||
|
|
@ -28,8 +28,8 @@ import {
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import { GTBEstadoCivilSchema } from '../../_schemas/GTBEstadoCivilSchema';
|
||||
import { GTBEstadoCivilInterface } from '../../_interfaces/GTBEstadoCivilInterface';
|
||||
import { GTBEstadoCivilSchema } from '../../schemas/GTBEstadoCivil/GTBEstadoCivilSchema';
|
||||
import { GTBEstadoCivilInterface } from '../../interfaces/GTBEstadoCivil/GTBEstadoCivilInterface';
|
||||
|
||||
type FormValues = z.infer<typeof GTBEstadoCivilSchema>;
|
||||
|
||||
|
|
@ -7,14 +7,14 @@ import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDi
|
|||
import Header from '@/shared/components/structure/Header';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GTBEstadoCivilTable from '../../_components/g_tb_estadocivil/GTBEstadoCivilTable';
|
||||
import GTBEstadoCivilForm from '../../_components/g_tb_estadocivil/GTBEstadoCivilForm';
|
||||
import GTBEstadoCivilTable from './GTBEstadoCivilTable';
|
||||
import GTBEstadoCivilForm from './GTBEstadoCivilForm';
|
||||
|
||||
import { useGTBEstadoCivilReadHook } from '../../_hooks/g_tb_estadocivil/useGTBEstadoCivilReadHook';
|
||||
import { useGTBEstadoCivilSaveHook } from '../../_hooks/g_tb_estadocivil/useGTBEstadoCivilSaveHook';
|
||||
import { useGTBEstadoCivilRemoveHook } from '../../_hooks/g_tb_estadocivil/useGTBEstadoCivilRemoveHook';
|
||||
import { useGTBEstadoCivilReadHook } from '../../hooks/GTBEstadoCivil/useGTBEstadoCivilReadHook';
|
||||
import { useGTBEstadoCivilSaveHook } from '../../hooks/GTBEstadoCivil/useGTBEstadoCivilSaveHook';
|
||||
import { useGTBEstadoCivilRemoveHook } from '../../hooks/GTBEstadoCivil/useGTBEstadoCivilRemoveHook';
|
||||
|
||||
import { GTBEstadoCivilInterface } from '../../_interfaces/GTBEstadoCivilInterface';
|
||||
import { GTBEstadoCivilInterface } from '../../interfaces/GTBEstadoCivil/GTBEstadoCivilInterface';
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
const initalEstadoCivil: GTBEstadoCivilInterface = {
|
||||
|
|
@ -24,7 +24,7 @@ const initalEstadoCivil: GTBEstadoCivilInterface = {
|
|||
situacao: 'A',
|
||||
};
|
||||
|
||||
export default function TBEstadoCivilPage() {
|
||||
export default function GTBEstadoCivilIndex() {
|
||||
// Controle de exibição de respostas
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ import {
|
|||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import { GTBEstadoCivilInterface } from '../../_interfaces/GTBEstadoCivilInterface';
|
||||
import { GTBEstadoCivilInterface } from '../../interfaces/GTBEstadoCivil/GTBEstadoCivilInterface';
|
||||
|
||||
interface TBEstadoCivilTableProps {
|
||||
data: GTBEstadoCivilInterface[];
|
||||
|
|
@ -27,7 +27,7 @@ import {
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import { GTBProfissaoSchema } from '../../_schemas/GTBProfissaoSchema';
|
||||
import { GTBProfissaoSchema } from '../../schemas/GTBProfissao/GTBProfissaoSchema';
|
||||
|
||||
type FormValues = z.infer<typeof GTBProfissaoSchema>;
|
||||
|
||||
|
|
@ -4,20 +4,20 @@ import { useEffect, useState, useCallback } from 'react';
|
|||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GTBProfissaoTable from '../../_components/g_tb_profissao/GTBProfissaoTable';
|
||||
import GTBProfissaoForm from '../../_components/g_tb_profissao/GTBProfissaoForm';
|
||||
import GTBProfissaoTable from './GTBProfissaoTable';
|
||||
import GTBProfissaoForm from './GTBProfissaoForm';
|
||||
|
||||
import { useGTBProfissaoReadHook } from '../../_hooks/g_tb_profissao/useGTBProfissaoReadHook';
|
||||
import { useGTBProfissaoSaveHook } from '../../_hooks/g_tb_profissao/useGTBProfissaoSaveHook';
|
||||
import { useGTBProfissaoRemoveHook } from '../../_hooks/g_tb_profissao/useGTBProfissaoRemoveHook';
|
||||
import { useGTBProfissaoReadHook } from '@/packages/administrativo/hooks/GTBProfissao/useGTBProfissaoReadHook';
|
||||
import { useGTBProfissaoSaveHook } from '@/packages/administrativo/hooks/GTBProfissao/useGTBProfissaoSaveHook';
|
||||
import { useGTBProfissaoRemoveHook } from '@/packages/administrativo/hooks/GTBProfissao/useGTBProfissaoRemoveHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import GTBProfissaoInterface from '../../_interfaces/GTBProfissaoInterface';
|
||||
import GTBProfissaoInterface from '../../interfaces/GTBProfissao/GTBProfissaoInterface';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
export default function GTBProfissaoIndex() {
|
||||
// Hooks para leitura e salvamento
|
||||
const { gTBProfissao, fetchGTBProfissao } = useGTBProfissaoReadHook();
|
||||
const { saveGTBProfissao } = useGTBProfissaoSaveHook();
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from '@/components/ui/table';
|
||||
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import GTBProfissaoInterface from '../../_interfaces/GTBProfissaoInterface';
|
||||
import GTBProfissaoInterface from '../../interfaces/GTBProfissao/GTBProfissaoInterface';
|
||||
|
||||
interface GTBProfissaoTableProps {
|
||||
data: GTBProfissaoInterface[];
|
||||
|
|
@ -26,7 +26,7 @@ import {
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import { GTBRegimeBensSchema } from '../../_schemas/GTBRegimeBensSchema';
|
||||
import { GTBRegimeBensSchema } from '@/packages/administrativo/schemas/GTBRegimeBens/GTBRegimeBensSchema';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
type FormValues = z.infer<typeof GTBRegimeBensSchema>;
|
||||
|
|
@ -4,20 +4,20 @@ import { useEffect, useState, useCallback } from 'react';
|
|||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GTBRegimeBensTable from '../../_components/g_tb_regimebens/GTBRegimeBensTable';
|
||||
import GTBRegimeBensForm from '../../_components/g_tb_regimebens/GTBRegimeBensForm';
|
||||
import GTBRegimeBensTable from '@/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensTable';
|
||||
import GTBRegimeBensForm from '@/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensForm';
|
||||
|
||||
import { useGTBRegimeBensReadHook } from '../../_hooks/g_tb_regimebens/useGTBRegimeBensReadHook';
|
||||
import { useGTBRegimeBensSaveHook } from '../../_hooks/g_tb_regimebens/useGTBRegimeBensSaveHook';
|
||||
import { useGTBRegimeBensRemoveHook } from '../../_hooks/g_tb_regimebens/useGTBRegimeBensRemoveHook';
|
||||
import { useGTBRegimeBensReadHook } from '../../hooks/GTBRegimeBens/useGTBRegimeBensReadHook';
|
||||
import { useGTBRegimeBensSaveHook } from '../../hooks/GTBRegimeBens/useGTBRegimeBensSaveHook';
|
||||
import { useGTBRegimeBensRemoveHook } from '../../hooks/GTBRegimeBens/useGTBRegimeBensRemoveHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import GTBRegimeBensInterface from '../../_interfaces/GTBRegimeBensInterface';
|
||||
import GTBRegimeBensInterface from '../../interfaces/GTBRegimeBens/GTBRegimeBensInterface';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
export default function GTBRegimeBensIndex() {
|
||||
// Hooks para leitura e salvamento
|
||||
const { gTBRegimeBens, fetchGTBRegimeBens } = useGTBRegimeBensReadHook();
|
||||
const { saveGTBRegimeComunhao } = useGTBRegimeBensSaveHook();
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from '@/components/ui/table';
|
||||
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import GTBRegimeBensInterface from '../../_interfaces/GTBRegimeBensInterface';
|
||||
import GTBRegimeBensInterface from '@/packages/administrativo/interfaces/GTBRegimeBens/GTBRegimeBensInterface';
|
||||
|
||||
interface GTBRegimeBensTableProps {
|
||||
data: GTBRegimeBensInterface[];
|
||||
|
|
@ -27,7 +27,7 @@ import {
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import { GTBRegimeComunhaoSchema } from '../../_schemas/GTBRegimeComunhaoSchema';
|
||||
import { GTBRegimeComunhaoSchema } from '../../schemas/GTBRegimeComunhao/GTBRegimeComunhaoSchema';
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
|
|
@ -35,7 +35,7 @@ import {
|
|||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import { useGTBRegimeBensReadHook } from '../../_hooks/g_tb_regimebens/useGTBRegimeBensReadHook';
|
||||
import { useGTBRegimeBensReadHook } from '../../hooks/GTBRegimeBens/useGTBRegimeBensReadHook';
|
||||
|
||||
type FormValues = z.infer<typeof GTBRegimeComunhaoSchema>;
|
||||
|
||||
|
|
@ -4,20 +4,20 @@ import { useEffect, useState, useCallback } from 'react';
|
|||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GTBRegimeComunhaoTable from '../../_components/g_tb_regimecomunhao/GTBRegimeComunhaoTable';
|
||||
import GTBRegimeComunhaoForm from '../../_components/g_tb_regimecomunhao/GTBRegimeComunhaoForm';
|
||||
import GTBRegimeComunhaoTable from './GTBRegimeComunhaoTable';
|
||||
import GTBRegimeComunhaoForm from './GTBRegimeComunhaoForm';
|
||||
|
||||
import { useGTBRegimeComunhaoReadHook } from '../../_hooks/g_tb_regimecomunhao/useGTBRegimeComunhaoReadHook';
|
||||
import { useGTBRegimeComunhaoSaveHook } from '../../_hooks/g_tb_regimecomunhao/useGTBRegimeComunhaoSaveHook';
|
||||
import { useGTBRegimeComunhaoRemoveHook } from '../../_hooks/g_tb_regimecomunhao/useGTBRegimeComunhaoRemoveHook';
|
||||
import { useGTBRegimeComunhaoReadHook } from '../../hooks/GTBRegimeComunhao/useGTBRegimeComunhaoReadHook';
|
||||
import { useGTBRegimeComunhaoSaveHook } from '../../hooks/GTBRegimeComunhao/useGTBRegimeComunhaoSaveHook';
|
||||
import { useGTBRegimeComunhaoRemoveHook } from '../../hooks/GTBRegimeComunhao/useGTBRegimeComunhaoRemoveHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import GTBRegimeComunhaoInterface from '../../_interfaces/GTBRegimeComunhaoInterface';
|
||||
import GTBRegimeComunhaoInterface from '../../interfaces/GTBRegimeComunhao/GTBRegimeComunhaoInterface';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
export default function GTBRegimeComunhaoIndex() {
|
||||
// Hooks para leitura e salvamento
|
||||
const { gTBRegimeComunhao, fetchGTBRegimeComunhao } = useGTBRegimeComunhaoReadHook();
|
||||
const { saveGTBRegimeComunhao } = useGTBRegimeComunhaoSaveHook();
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from '@/components/ui/table';
|
||||
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import GTBRegimeComunhaoInterface from '../../_interfaces/GTBRegimeComunhaoInterface';
|
||||
import GTBRegimeComunhaoInterface from '../../interfaces/GTBRegimeComunhao/GTBRegimeComunhaoInterface';
|
||||
|
||||
interface GTBRegimeComunhaoTableProps {
|
||||
data: GTBRegimeComunhaoInterface[];
|
||||
|
|
@ -29,8 +29,8 @@ import { Label } from '@/components/ui/label';
|
|||
|
||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||
|
||||
import { GTBTipoLogradouroSchema } from '../../_schemas/GTBTipoLogradouroSchema';
|
||||
import { GTBTipoLogradouroInterface } from '../../_interfaces/GTBTipoLogradouroInterface';
|
||||
import { GTBTipoLogradouroSchema } from '../../schemas/GTBTipoLogradouro/GTBTipoLogradouroSchema';
|
||||
import { GTBTipoLogradouroInterface } from '../../interfaces/GTBTipoLogradouro/GTBTipoLogradouroInterface';
|
||||
|
||||
type FormValues = z.infer<typeof GTBTipoLogradouroSchema>;
|
||||
|
||||
|
|
@ -7,18 +7,18 @@ import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDi
|
|||
import Header from '@/shared/components/structure/Header';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import GTBTipoLogradouroTable from '../../_components/g_tb_tipologradouro/GTBTipoLogradouroTable';
|
||||
import GTBTipoLogradouroForm from '../../_components/g_tb_tipologradouro/GTBTipoLogradouroForm';
|
||||
import GTBTipoLogradouroTable from './GTBTipoLogradouroTable';
|
||||
import GTBTipoLogradouroForm from './GTBTipoLogradouroForm';
|
||||
|
||||
import { useGTBTipoLogradouroReadHook } from '../../_hooks/g_tb_tipologradouro/useGTBTipoLogradouroReadHook';
|
||||
import { useGTBTipoLogradouroSaveHook } from '../../_hooks/g_tb_tipologradouro/useGTBTipoLogradouroSaveHook';
|
||||
import { useGTBTipoLogradouroRemoveHook } from '../../_hooks/g_tb_tipologradouro/useGTBTipoLogradouroRemoveHook';
|
||||
import { useGTBTipoLogradouroReadHook } from '../../hooks/GTBTipoLogradouro/useGTBTipoLogradouroReadHook';
|
||||
import { useGTBTipoLogradouroSaveHook } from '../../hooks/GTBTipoLogradouro/useGTBTipoLogradouroSaveHook';
|
||||
import { useGTBTipoLogradouroRemoveHook } from '../../hooks/GTBTipoLogradouro/useGTBTipoLogradouroRemoveHook';
|
||||
|
||||
import { GTBTipoLogradouroInterface } from '../../_interfaces/GTBTipoLogradouroInterface';
|
||||
import { GTBTipoLogradouroInterface } from '../../interfaces/GTBTipoLogradouro/GTBTipoLogradouroInterface';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
export default function GTBTipoLogradouroIndex() {
|
||||
// Controle de exibição de respostas
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ import {
|
|||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import { GTBTipoLogradouroInterface } from '../../_interfaces/GTBTipoLogradouroInterface';
|
||||
import { GTBTipoLogradouroInterface } from '../../interfaces/GTBTipoLogradouro/GTBTipoLogradouroInterface';
|
||||
|
||||
interface GTBTipoLogradouroTableProps {
|
||||
data: GTBTipoLogradouroInterface[];
|
||||
|
|
@ -27,7 +27,7 @@ import {
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import { TCensecSchema } from '../../_schemas/TCensecSchema';
|
||||
import { TCensecSchema } from '@/packages/administrativo/schemas/TCensec/TCensecSchema';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||
|
||||
|
|
@ -4,20 +4,20 @@ import { useEffect, useState, useCallback } from 'react';
|
|||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import TCensecTable from '../../_components/t_censec/TCensecTable';
|
||||
import TCensecForm from '../../_components/t_censec/TCensecForm';
|
||||
import TCensecTable from './TCensecTable';
|
||||
import TCensecForm from './TCensecForm';
|
||||
|
||||
import { useTCensecReadHook } from '../../_hooks/t_censec/useTCensecReadHook';
|
||||
import { useTCensecSaveHook } from '../../_hooks/t_censec/useTCensecSaveHook';
|
||||
import { useTCensecDeleteHook } from '../../_hooks/t_censec/useTCensecDeleteHook';
|
||||
import { useTCensecReadHook } from '../../hooks/TCensec/useTCensecReadHook';
|
||||
import { useTCensecSaveHook } from '../../hooks/TCensec/useTCensecSaveHook';
|
||||
import { useTCensecDeleteHook } from '../../hooks/TCensec/useTCensecDeleteHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import TCensecInterface from '../../_interfaces/TCensecInterface';
|
||||
import TCensecInterface from '../../interfaces/TCensec/TCensecInterface';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
export default function TCensecIndex() {
|
||||
// Controle de estado do botão
|
||||
const [buttonIsLoading, setButtonIsLoading] = useState(false);
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from '@/components/ui/table';
|
||||
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import TCensecInterface from '../../_interfaces/TCensecInterface';
|
||||
import TCensecInterface from '@/packages/administrativo/interfaces/TCensec//TCensecInterface';
|
||||
|
||||
interface TCensecTableProps {
|
||||
data: TCensecInterface[];
|
||||
|
|
@ -28,7 +28,7 @@ import {
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import { TCensecNaturezaLitigioSchema } from '../../_schemas/TCensecNaturezaLitigioSchema';
|
||||
import { TCensecNaturezaLitigioSchema } from '@/packages/administrativo/schemas/TCensecNaturezaLitigio/TCensecNaturezaLitigioSchema';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
import SituacoesSelect from '@/shared/components/situacoes/SituacoesSelect';
|
||||
|
||||
|
|
@ -9,14 +9,14 @@ import Header from '@/shared/components/structure/Header';
|
|||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
import TCensecNaturezaLitigioTable from '../../_components/t_censecnaturezalitigio/TCensecNaturezaLitigioTable';
|
||||
import TCensecNaturezaLitigioForm from '../../_components/t_censecnaturezalitigio/TCensecNaturezaLitigioForm';
|
||||
import TCensecNaturezaLitigioTable from './TCensecNaturezaLitigioTable';
|
||||
import TCensecNaturezaLitigioForm from './TCensecNaturezaLitigioForm';
|
||||
|
||||
import { useTCensecNaturezaLitigioReadHook } from '../../_hooks/t_censecnaturezalitigio/useTCensecNaturezaLitigioReadHook';
|
||||
import { useTCensecNaturezaLitigioSaveHook } from '../../_hooks/t_censecnaturezalitigio/useTCensecNaturezaLitigioSaveHook';
|
||||
import { useTCensecNaturezaLitigioRemoveHook } from '../../_hooks/t_censecnaturezalitigio/useTCensecNaturezaLitigioRemoveHook';
|
||||
import { useTCensecNaturezaLitigioReadHook } from '@/packages/administrativo/hooks/TCensecNaturezaLitigio/useTCensecNaturezaLitigioReadHook';
|
||||
import { useTCensecNaturezaLitigioSaveHook } from '@/packages/administrativo/hooks/TCensecNaturezaLitigio/useTCensecNaturezaLitigioSaveHook';
|
||||
import { useTCensecNaturezaLitigioRemoveHook } from '@/packages/administrativo/hooks/TCensecNaturezaLitigio/useTCensecNaturezaLitigioRemoveHook';
|
||||
|
||||
import { TCensecNaturezaLitigioInterface } from '../../_interfaces/TCensecNaturezaLitigioInterface';
|
||||
import { TCensecNaturezaLitigioInterface } from '../../interfaces/TCensecNaturezaLitigio/TCensecNaturezaLitigioInterface';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
|
||||
const initialCensecNaturezaLitigio: TCensecNaturezaLitigioInterface = {
|
||||
|
|
@ -25,7 +25,7 @@ const initialCensecNaturezaLitigio: TCensecNaturezaLitigioInterface = {
|
|||
situacao: SituacoesEnum.A,
|
||||
};
|
||||
|
||||
export default function TCensecNaturezaLitigioPage() {
|
||||
export default function TCensecNaturezaLitigioIndex() {
|
||||
// Controle de exibição de respostas
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ import {
|
|||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import { TCensecNaturezaLitigioInterface } from '../../_interfaces/TCensecNaturezaLitigioInterface';
|
||||
import { TCensecNaturezaLitigioInterface } from '@/packages/administrativo/interfaces/TCensecNaturezaLitigio/TCensecNaturezaLitigioInterface';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
|
||||
interface TCensecNaturezaLitigioTableProps {
|
||||
|
|
@ -25,8 +25,8 @@ import {
|
|||
} from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { TCensecTipoAtoSchema } from "../../_schemas/TCensecTipoAtoSchema";
|
||||
import TCensecInterface from "../../_interfaces/TCensecInterface";
|
||||
import { TCensecTipoAtoSchema } from "../../schemas/TCensecTipoAto/TCensecTipoAtoSchema";
|
||||
import TCensecInterface from "../../interfaces/TCensec/TCensecInterface";
|
||||
import { SituacoesEnum } from "@/shared/enums/SituacoesEnum";
|
||||
import SituacoesSelect from "@/shared/components/situacoes/SituacoesSelect";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
|
|
@ -8,15 +8,15 @@ import Header from "@/shared/components/structure/Header";
|
|||
import ConfirmDialog from "@/shared/components/confirmDialog/ConfirmDialog";
|
||||
import Loading from "@/shared/components/loading/loading";
|
||||
|
||||
import TCensecTipoAtoTable from "../../_components/t_censec_tipoato/TCensecTipoAtoTable";
|
||||
import TCensecTipoAtoForm from "../../_components/t_censec_tipoato/TCensecTipoAtoForm";
|
||||
import TCensecTipoAtoTable from "./TCensecTipoAtoTable";
|
||||
import TCensecTipoAtoForm from "./TCensecTipoAtoForm";
|
||||
|
||||
import { useTCensecTipoAtoReadHook } from "../../_hooks/t_censec_tipoato/useTCensecTipoAtoReadHook";
|
||||
import { useTCensecTipoAtoSaveHook } from "../../_hooks/t_censec_tipoato/useTCensecTipoAtoSaveHook";
|
||||
import { useTCensecTipoAtoRemoveHook } from "../../_hooks/t_censec_tipoato/useTCensecTipoAtoRemoveHook";
|
||||
import { useTCensecReadHook } from "../../_hooks/t_censec/useTCensecReadHook";
|
||||
import { useTCensecTipoAtoReadHook } from "../../hooks/TCensecTipoAto/useTCensecTipoAtoReadHook";
|
||||
import { useTCensecTipoAtoSaveHook } from "../../hooks/TCensecTipoAto/useTCensecTipoAtoSaveHook";
|
||||
import { useTCensecTipoAtoRemoveHook } from "../../hooks/TCensecTipoAto/useTCensecTipoAtoRemoveHook";
|
||||
import { useTCensecReadHook } from "../../hooks/TCensec/useTCensecReadHook";
|
||||
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import { TCensecTipoAtoInterface } from "../../interfaces/TCensecTipoAto/TCensecTipoAtoInterface";
|
||||
import { SituacoesEnum } from "@/shared/enums/SituacoesEnum";
|
||||
|
||||
// Estado inicial para criação
|
||||
|
|
@ -30,7 +30,7 @@ const initialTCensecTipoAto: TCensecTipoAtoInterface = {
|
|||
tipo_revogacao: null,
|
||||
};
|
||||
|
||||
export default function TCensecTipoAtoPage() {
|
||||
export default function TCensecTipoAtoIndex() {
|
||||
// Hooks para leitura, salvamento e remoção
|
||||
const { tCensecTipoAto, fetchTCensecTipoAto } = useTCensecTipoAtoReadHook();
|
||||
const { saveTCensecTipoAto } = useTCensecTipoAtoSaveHook();
|
||||
|
|
@ -15,7 +15,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover
|
|||
import { cn } from "@/lib/utils";
|
||||
import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
|
||||
import GetCapitalize from "@/shared/actions/text/GetCapitalize";
|
||||
import { useTCensecTipoAtoReadHook } from "@/app/(protected)/(cadastros)/cadastros/_hooks/t_censec_tipoato/useTCensecTipoAtoReadHook";
|
||||
import { useTCensecTipoAtoReadHook } from "@/packages/administrativo/hooks/TCensecTipoAto/useTCensecTipoAtoReadHook";
|
||||
|
||||
export default function TCensecTipoAtoSelect({ field }: any) {
|
||||
const [open, setOpen] = React.useState(false);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,128 @@
|
|||
'use client';
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow
|
||||
} from "@/components/ui/table";
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from "lucide-react";
|
||||
import { TCensecTipoAtoInterface } from "../../interfaces/TCensecTipoAto/TCensecTipoAtoInterface";
|
||||
import TCensecInterface from "../../interfaces/TCensec/TCensecInterface";
|
||||
|
||||
interface TCensecTipoAtoTableProps {
|
||||
data: TCensecTipoAtoInterface[];
|
||||
tCensec: TCensecInterface[];
|
||||
onEdit: (item: TCensecTipoAtoInterface, isEditingFormStatus: boolean) => void;
|
||||
onDelete: (item: TCensecTipoAtoInterface, isEditingFormStatus: boolean) => void;
|
||||
}
|
||||
|
||||
function StatusBadge({ situacao }: { situacao: string }) {
|
||||
const isActive = situacao === "A";
|
||||
|
||||
const baseClasses =
|
||||
"text-xs font-medium px-2.5 py-0.5 rounded-sm me-2";
|
||||
|
||||
const activeClasses =
|
||||
"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300";
|
||||
|
||||
const inactiveClasses =
|
||||
"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300";
|
||||
|
||||
return (
|
||||
<span className={`${baseClasses} ${isActive ? activeClasses : inactiveClasses}`}>
|
||||
{isActive ? "Ativo" : "Inativo"}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
export default function TCensecTipoAtoTable({
|
||||
data,
|
||||
tCensec,
|
||||
onEdit,
|
||||
onDelete
|
||||
}: TCensecTipoAtoTableProps) {
|
||||
return (
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>#</TableHead>
|
||||
<TableHead>Situação</TableHead>
|
||||
<TableHead>Central do CENSEC</TableHead>
|
||||
{/*<TableHead>Código</TableHead>*/}
|
||||
<TableHead>Descrição</TableHead>
|
||||
<TableHead>Separação</TableHead>
|
||||
<TableHead>Revogação</TableHead>
|
||||
<TableHead className="text-right">Ações</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
|
||||
<TableBody>
|
||||
{data.map((item) => {
|
||||
const censecDesc = tCensec.find(c => c.censec_id === item.censec_id)?.descricao || "N/A"
|
||||
return (
|
||||
<TableRow key={item.censec_tipoato_id} className="cursor-pointer">
|
||||
<TableCell className="font-medium">
|
||||
{item.censec_tipoato_id}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<StatusBadge situacao={item.situacao} />
|
||||
</TableCell>
|
||||
<TableCell>{censecDesc}</TableCell>
|
||||
{/*<TableCell>{item.codigo ?? "-"}</TableCell>*/}
|
||||
<TableCell>{item.descricao}</TableCell>
|
||||
<TableCell>{item.tipo_separacao ?? "-"}</TableCell>
|
||||
<TableCell>{item.tipo_revogacao ?? "-"}</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="cursor-pointer"
|
||||
>
|
||||
<EllipsisIcon />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
<DropdownMenuContent side="left" align="start">
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onEdit(item, true)}
|
||||
>
|
||||
<PencilIcon className="mr-2 h-4 w-4" />
|
||||
Editar
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onDelete(item, true)}
|
||||
>
|
||||
<Trash2Icon className="mr-2 h-4 w-4" />
|
||||
Remover
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)
|
||||
})}
|
||||
</TableBody>
|
||||
</Table>
|
||||
);
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover
|
|||
import { cn } from "@/lib/utils";
|
||||
import { CheckIcon, ChevronsUpDownIcon } from "lucide-react";
|
||||
import GetCapitalize from "@/shared/actions/text/GetCapitalize";
|
||||
import { useGTBTipoLogradouroReadHook } from "@/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_tipologradouro/useGTBTipoLogradouroReadHook";
|
||||
import { useGTBTipoLogradouroReadHook } from "@/packages/administrativo/hooks/GTBTipoLogradouro/useGTBTipoLogradouroReadHook";
|
||||
|
||||
export default function TImovelTipoLogradouroSelect({ field }: any) {
|
||||
const [open, setOpen] = React.useState(false);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ import { Input } from '@/components/ui/input';
|
|||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
import { TMinutaSchema } from '../../_schemas/TMinutaSchema';
|
||||
import { TMinutaInterface } from '../../interfaces/TMinuta/TMinutaInterface';
|
||||
import { TMinutaSchema } from '../../schemas/TMinuta/TMinutaSchema';
|
||||
|
||||
type FormValues = z.infer<typeof TMinutaSchema>;
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import { TMinutaInterface } from '../../_interfaces/TMinutaInterface';
|
||||
import { TMinutaInterface } from '../../interfaces/TMinuta/TMinutaInterface';
|
||||
|
||||
interface TMinutaTableProps {
|
||||
data: TMinutaInterface[];
|
||||
|
|
@ -32,10 +32,10 @@ import {
|
|||
} from '@/components/ui/select';
|
||||
import { CheckIcon, ChevronsUpDownIcon, HouseIcon, IdCardIcon, UserIcon } from 'lucide-react';
|
||||
import { Sexo } from '@/shared/enums/SexoEnum';
|
||||
import { useGTBEstadoCivilReadHook } from '../../../../../app/(protected)/(cadastros)/cadastros/_hooks/g_tb_estadocivil/useGTBEstadoCivilReadHook';
|
||||
import { useGTBEstadoCivilReadHook } from '../../../hooks/GTBEstadoCivil/useGTBEstadoCivilReadHook';
|
||||
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
|
||||
import { useGTBRegimeComunhaoReadHook } from '../../../../../app/(protected)/(cadastros)/cadastros/_hooks/g_tb_regimecomunhao/useGTBRegimeComunhaoReadHook';
|
||||
import { useGTBProfissaoReadHook } from '../../../../../app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoReadHook';
|
||||
import { useGTBRegimeComunhaoReadHook } from '../../../hooks/GTBRegimeComunhao/useGTBRegimeComunhaoReadHook';
|
||||
import { useGTBProfissaoReadHook } from '@/packages/administrativo/hooks/GTBProfissao/useGTBProfissaoReadHook';
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
||||
import {
|
||||
Command,
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ import {
|
|||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
|
||||
import { TTBAndamentoServicoSchema } from '../../_schemas/TTBAndamentoServicoSchema';
|
||||
import { tipoEnum } from '../../_interfaces/TTBAndamentoServicoInterface';
|
||||
import { TTBAndamentoServicoSchema } from '../../schemas/TTBAndamentoServico/TTBAndamentoServicoSchema';
|
||||
import { tipoEnum } from '../../interfaces/TTBAndamentoServico/TTBAndamentoServicoInterface';
|
||||
|
||||
type FormValues = z.infer<typeof TTBAndamentoServicoSchema>;
|
||||
|
||||
|
|
@ -4,20 +4,20 @@ import { useEffect, useState, useCallback } from 'react';
|
|||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import TTBAndamentoServicoTable from '../../_components/t_tb_andamentoservico/TTBAndamentoServicoTable';
|
||||
import TTBAndamentoServicoForm from '../../_components/t_tb_andamentoservico/TTBAndamentoServicoForm';
|
||||
import TTBAndamentoServicoTable from './TTBAndamentoServicoTable';
|
||||
import TTBAndamentoServicoForm from './TTBAndamentoServicoForm';
|
||||
|
||||
import { useTTBAndamentoServicoReadHook } from '../../_hooks/t_tb_andamentoservico/useTTBAndamentoServicoReadHook';
|
||||
import { useTTBAndamentoServicoSaveHook } from '../../_hooks/t_tb_andamentoservico/useTTBAndamentoServicoSaveHook';
|
||||
import { useTTBAndamentoServicoReadHook } from '@/packages/administrativo/hooks/TTBAndamentoServico/useTTBAndamentoServicoReadHook';
|
||||
import { useTTBAndamentoServicoSaveHook } from '@/packages/administrativo/hooks/TTBAndamentoServico/useTTBAndamentoServicoSaveHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import TTBAndamentoServicoInterface from '../../_interfaces/TTBAndamentoServicoInterface';
|
||||
import { useTTBAndamentoServicoDeleteHook } from '../../_hooks/t_tb_andamentoservico/useTTBAndamentoServicoDeleteHook';
|
||||
import TTBAndamentoServicoInterface from '../../interfaces/TTBAndamentoServico/TTBAndamentoServicoInterface';
|
||||
import { useTTBAndamentoServicoDeleteHook } from '@/packages/administrativo/hooks/TTBAndamentoServico/useTTBAndamentoServicoDeleteHook';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
export default function TTBAndamentoServicoIndex() {
|
||||
// Hooks para leitura e salvamento
|
||||
const { tTBAndamentosServicos, fetchTTBAndamentoServico } = useTTBAndamentoServicoReadHook();
|
||||
const { saveTTBAndamentoServico } = useTTBAndamentoServicoSaveHook();
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from '@/components/ui/table';
|
||||
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import TTBAndamentoServicoInteface from '../../_interfaces/TTBAndamentoServicoInterface';
|
||||
import TTBAndamentoServicoInteface from '../../interfaces/TTBAndamentoServico/TTBAndamentoServicoInterface';
|
||||
|
||||
interface TTBAndamentoServicoTableProps {
|
||||
data: TTBAndamentoServicoInteface[];
|
||||
|
|
@ -27,8 +27,8 @@ import {
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
|
||||
import { TTBReconhecimentoTipoSchema } from '../../_schemas/TTBReconhecimentoTipoSchema';
|
||||
import { situacaoEnum } from '../../_interfaces/TTBReconhecimentoTipoInterface';
|
||||
import { TTBReconhecimentoTipoSchema } from '../../schemas/TTBReconhecimentoTipo/TTBReconhecimentoTipoSchema';
|
||||
import { situacaoEnum } from '../../interfaces/TTBREconhecimentoTipo/TTBReconhecimentoTipoInterface';
|
||||
|
||||
type FormValues = z.infer<typeof TTBReconhecimentoTipoSchema>;
|
||||
|
||||
|
|
@ -5,19 +5,19 @@ import { Card, CardContent } from '@/components/ui/card';
|
|||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
import TTBReconhecimentoTipoTable from '../../_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoTable';
|
||||
import TTBReconhecimentoTipoForm from '../../_components/t_tb_reconhecimentotipo/TTBReconhecimentoTipoForm';
|
||||
import TTBReconhecimentoTipoTable from './TTBReconhecimentoTipoTable';
|
||||
import TTBReconhecimentoTipoForm from './TTBReconhecimentoTipoForm';
|
||||
|
||||
import { useTTBReconhecimentoTipoReadHook } from '../../_hooks/t_tb_reconhecimentotipo/useTTBReconhecimentoTipoReadHook';
|
||||
import { useTTBReconhecimentoTipoSaveHook } from '../../_hooks/t_tb_reconhecimentotipo/useTTBReconhecimentoTipoSaveHook';
|
||||
import { useTTBReconhecimentoTipoDeleteHook } from '../../_hooks/t_tb_reconhecimentotipo/useTTBReconhecimentoTipoDeleteHook';
|
||||
import { useTTBReconhecimentoTipoReadHook } from '@/packages/administrativo/hooks/TTBReconhecimentoTipo/useTTBReconhecimentoTipoReadHook';
|
||||
import { useTTBReconhecimentoTipoSaveHook } from '@/packages/administrativo/hooks/TTBReconhecimentoTipo/useTTBReconhecimentoTipoSaveHook';
|
||||
import { useTTBReconhecimentoTipoDeleteHook } from '@/packages/administrativo/hooks/TTBReconhecimentoTipo/useTTBReconhecimentoTipoDeleteHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
|
||||
import TTBReconhecimentoTipoInterface from '../../_interfaces/TTBReconhecimentoTipoInterface';
|
||||
import TTBReconhecimentoTipoInterface from '../../interfaces/TTBREconhecimentoTipo/TTBReconhecimentoTipoInterface';
|
||||
|
||||
export default function TTBAndamentoServico() {
|
||||
export default function TTBReconhecimentoTipoIndex() {
|
||||
// Hooks para leitura e salvamento
|
||||
const { tTBReconhecimentosTipos, fetchTTBReconhecimentosTipos } =
|
||||
useTTBReconhecimentoTipoReadHook();
|
||||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from '@/components/ui/table';
|
||||
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import TTBReconhecimentoTipoInterface from '../../_interfaces/TTBReconhecimentoTipoInterface';
|
||||
import TTBReconhecimentoTipoInterface from '../../interfaces/TTBREconhecimentoTipo/TTBReconhecimentoTipoInterface';
|
||||
|
||||
interface TTBReconhecimentoTipoTableProps {
|
||||
data: TTBReconhecimentoTipoInterface[];
|
||||
|
|
@ -5,7 +5,7 @@ import API from '@/shared/services/api/Api';
|
|||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados de uma cidade
|
||||
import GCidadeInterface from '../../_interfaces/GCidadeInterface';
|
||||
import GCidadeInterface from '@/packages/administrativo/interfaces/GCidade/GCidadeInterface';
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
|
@ -5,7 +5,7 @@ import API from '@/shared/services/api/Api';
|
|||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados de uma cidade
|
||||
import GCidadeInterface from '../../_interfaces/GCidadeInterface';
|
||||
import GCidadeInterface from '@/packages/administrativo/interfaces/GCidade/GCidadeInterface';
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { GMedidaTipoInterface } from '../../_interfaces/GMedidaTipoInterface';
|
||||
import { GMedidaTipoInterface } from '../../interfaces/GMedidaTipo/GMedidaTipoInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { GMedidaTipoInterface } from '../../_interfaces/GMedidaTipoInterface';
|
||||
import { GMedidaTipoInterface } from '../../interfaces/GMedidaTipo/GMedidaTipoInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { GTBBairroInterface } from '../../_interfaces/GTBBairroInterface';
|
||||
import { GTBBairroInterface } from '@/packages/administrativo/interfaces/GTBBairro/GTBBairroInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { GTBBairroInterface } from '../../_interfaces/GTBBairroInterface';
|
||||
import { GTBBairroInterface } from '@/packages/administrativo/interfaces/GTBBairro/GTBBairroInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ async function executeGTBEstadoCivilIndexData() {
|
|||
const api = new API();
|
||||
return await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/g_tb_estado_civil/`,
|
||||
endpoint: `administrativo/g_tb_estadocivil/`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { GTBEstadoCivilInterface } from '../../_interfaces/GTBEstadoCivilInterface';
|
||||
import { GTBEstadoCivilInterface } from '../../interfaces/GTBEstadoCivil/GTBEstadoCivilInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ async function executeGTBEstadoCivilRemoveData(data: GTBEstadoCivilInterface) {
|
|||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/g_tb_bairro/${data.tb_estadocivil_id}`,
|
||||
endpoint: `administrativo/g_tb_estadocivil/${data.tb_estadocivil_id}`,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { GTBEstadoCivilInterface } from '../../_interfaces/GTBEstadoCivilInterface';
|
||||
import { GTBEstadoCivilInterface } from '../../interfaces/GTBEstadoCivil/GTBEstadoCivilInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ async function executeGTBEstadoCivilSaveData(data: GTBEstadoCivilInterface) {
|
|||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/g_tb_bairro/${data.tb_estadocivil_id || ''}`,
|
||||
endpoint: `administrativo/g_tb_estadocivil/${data.tb_estadocivil_id || ''}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import GTBProfissaoInterface from '../../_interfaces/GTBProfissaoInterface';
|
||||
import GTBProfissaoInterface from '@/packages/administrativo/interfaces/GTBProfissao/GTBProfissaoInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
export default async function GTBProfissaoRemoveData(data: GTBProfissaoInterface) {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import GTBProfissaoInterface from '../../_interfaces/GTBProfissaoInterface';
|
||||
import GTBProfissaoInterface from '@/packages/administrativo/interfaces/GTBProfissao/GTBProfissaoInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
export default async function GTBProfissaoSaveData(data: GTBProfissaoInterface) {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import GTBRegimeBensInterface from '../../_interfaces/GTBRegimeBensInterface';
|
||||
import GTBRegimeBensInterface from '../../interfaces/GTBRegimeBens/GTBRegimeBensInterface';
|
||||
|
||||
export default async function GTBRegimeBensRemoveData(data: GTBRegimeBensInterface) {
|
||||
const api = new API();
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import GTBRegimeBensInterface from '../../_interfaces/GTBRegimeBensInterface';
|
||||
import GTBRegimeBensInterface from '../../interfaces/GTBRegimeBens/GTBRegimeBensInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { GTBTipoLogradouroInterface } from '../../_interfaces/GTBTipoLogradouroInterface';
|
||||
import { GTBTipoLogradouroInterface } from '../../interfaces/GTBTipoLogradouro/GTBTipoLogradouroInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import { GTBTipoLogradouroInterface } from '../../_interfaces/GTBTipoLogradouroInterface';
|
||||
import { GTBTipoLogradouroInterface } from '../../interfaces/GTBTipoLogradouro/GTBTipoLogradouroInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import GTBRegimeComunhaoInterface from '../../_interfaces/GTBRegimeComunhaoInterface';
|
||||
import GTBRegimeComunhaoInterface from '../../interfaces/GTBRegimeComunhao/GTBRegimeComunhaoInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
export default async function GTBRegimeComunhaoIndexData() {
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue