From 7ecf79e8a3a0dd7a24de6bfee378e70a874595fc Mon Sep 17 00:00:00 2001 From: keven Date: Mon, 15 Sep 2025 10:23:59 -0300 Subject: [PATCH] =?UTF-8?q?[MVPTN-62]=20feat(CRUD):=20Cria=20CRUD=20para?= =?UTF-8?q?=20Profiss=C3=B5es=20trabalhando=20com=20dados=20em=20mock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(g_tb_profissao)/profissao/page.tsx | 166 ++++++++++++++++++ .../g_tb_profissao/GTBProfissaoForm.tsx | 142 +++++++++++++++ .../g_tb_profissao/GTBProfissaoTable.tsx | 129 ++++++++++++++ .../GTBProfissao/GTBProfissaoIndexData.ts | 49 ++++++ .../GTBProfissao/GTBProfissaoRemoveData.ts | 11 ++ .../GTBProfissao/GTBProfissaoSaveData.ts | 10 ++ .../g_tb_profissao/useGTBProfissaoReadHook.ts | 23 +++ .../useGTBProfissaoRemoveHook.ts | 19 ++ .../g_tb_profissao/useGTBProfissaoSaveHook.ts | 23 +++ .../_interfaces/GTBProfissaoInterface.ts | 9 + .../cadastros/_schemas/GTBProfissaoSchema.ts | 8 + .../GTBProfissaoIndexService.ts | 9 + .../GTBProfissaoRemoveService.ts | 12 ++ .../g_tb_profissao/GTBProfissaoSaveService.ts | 10 ++ src/components/app-sidebar.tsx | 4 + 15 files changed, 624 insertions(+) create mode 100644 src/app/(protected)/(cadastros)/cadastros/(g_tb_profissao)/profissao/page.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_components/g_tb_profissao/GTBProfissaoForm.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_components/g_tb_profissao/GTBProfissaoTable.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoIndexData.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoRemoveData.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoSaveData.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoReadHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoRemoveHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoSaveHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_interfaces/GTBProfissaoInterface.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_schemas/GTBProfissaoSchema.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoIndexService.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoRemoveService.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoSaveService.ts diff --git a/src/app/(protected)/(cadastros)/cadastros/(g_tb_profissao)/profissao/page.tsx b/src/app/(protected)/(cadastros)/cadastros/(g_tb_profissao)/profissao/page.tsx new file mode 100644 index 0000000..847d1d2 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/(g_tb_profissao)/profissao/page.tsx @@ -0,0 +1,166 @@ +'use client'; + +import { useEffect, useState, useCallback } from "react"; +import { Card, CardContent } from "@/components/ui/card"; + +import Loading from "@/app/_components/loading/loading"; +import GTBProfissaoTable from "../../_components/g_tb_profissao/GTBProfissaoTable"; +import GTBProfissaoForm from "../../_components/g_tb_profissao/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 ConfirmDialog from "@/app/_components/confirm_dialog/ConfirmDialog"; +import { useConfirmDialog } from "@/app/_components/confirm_dialog/useConfirmDialog"; + +import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface"; +import Header from "@/app/_components/structure/Header"; + +export default function TTBAndamentoServico() { + // Hooks para leitura e salvamento + const { gTBProfissao, fetchGTBProfissao } = useGTBProfissaoReadHook(); + const { saveGTBProfissao } = useGTBProfissaoSaveHook(); + const { removeGTBProfissao } = useGTBProfissaoRemoveHook(); + + // Estados + const [selectedAndamento, setSelectedAndamento] = useState(null); + const [isFormOpen, setIsFormOpen] = useState(false); + + // Estado para saber qual item será deletado + const [itemToDelete, setItemToDelete] = useState(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: GTBProfissaoInterface | null) => { + setSelectedAndamento(data); + setIsFormOpen(true); + }, []); + + /** + * Fecha o formulário e limpa o andamento selecionado + */ + const handleCloseForm = useCallback(() => { + setSelectedAndamento(null); + setIsFormOpen(false); + }, []); + + /** + * Salva os dados do formulário + */ + const handleSave = useCallback(async (formData: GTBProfissaoInterface) => { + + // Aguarda salvar o registro + await saveGTBProfissao(formData); + + // Encerra o fomulário + handleCloseForm(); + + // Atualiza a lista de dados + fetchGTBProfissao(); + + }, [saveGTBProfissao, fetchGTBProfissao, handleCloseForm]); + + /** + * Quando o usuário clica em "remover" na tabela + */ + const handleConfirmDelete = useCallback((item: GTBProfissaoInterface) => { + + // 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 removeGTBProfissao(itemToDelete); + + // Atualiza a lista + await fetchGTBProfissao(); + + // Limpa o item selecionado + setItemToDelete(null); + + // Fecha o modal + handleCancel(); + + }, [itemToDelete, fetchGTBProfissao, handleCancel]); + + /** + * Busca inicial dos dados + */ + useEffect(() => { + fetchGTBProfissao(); + }, []); + + /** + * Tela de loading enquanto carrega os dados + */ + if (!gTBProfissao) { + return ; + } + + return ( +
+ {/* Cabeçalho */} +
{ handleOpenForm(null) }} + /> + + {/* Tabela de andamentos */} + + + + + + + {/* Modal de confirmação */} + + + {/* Formulário de criação/edição */} + +
+ ); 4 +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/g_tb_profissao/GTBProfissaoForm.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/g_tb_profissao/GTBProfissaoForm.tsx new file mode 100644 index 0000000..37aaf6a --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_components/g_tb_profissao/GTBProfissaoForm.tsx @@ -0,0 +1,142 @@ +'use client'; + +import z from "zod"; +import { useEffect } from "react"; +import { useForm, Controller } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; + +import { Button } from "@/components/ui/button"; +import { Checkbox } from "@/components/ui/checkbox"; +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle +} from "@/components/ui/dialog"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; + +import { GTBProfissaoSchema } from "../../_schemas/GTBProfissaoSchema"; + +type FormValues = z.infer; + +interface Props { + isOpen: boolean; + data: FormValues | null; + onClose: (item: null, isFormStatus: boolean) => void; + onSave: (data: FormValues) => void; +} + +export default function GTBProfissaoForm({ isOpen, data, onClose, onSave }: Props) { + // Inicializa o react-hook-form com schema zod + const form = useForm({ + resolver: zodResolver(GTBProfissaoSchema), + defaultValues: { + descricao: "", + cod_cbo: "", + situacao: "A", + tb_profissao_id: 0, + }, + }); + + // Atualiza o formulário quando recebe dados para edição + useEffect(() => { + if (data) form.reset(data); + }, [data, form]); + + return ( + { + if (!open) onClose(null, false); + }} + > + + + + Profissões + + + Controle de profissões + + + +
+ + + {/* Descrição */} + ( + + Descrição + + + + + + )} + /> + + {/* CBO */} + ( + + CBO + + + + + + )} + /> + + {/* Situação */} + ( +
+ field.onChange(checked ? "A" : "I")} + /> + +
+ )} + /> + + {/* Rodapé do Dialog */} + + + + + + + + {/* Campo oculto */} + + + +
+
+ ); +} diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/g_tb_profissao/GTBProfissaoTable.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/g_tb_profissao/GTBProfissaoTable.tsx new file mode 100644 index 0000000..295a003 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_components/g_tb_profissao/GTBProfissaoTable.tsx @@ -0,0 +1,129 @@ +'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 GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface"; + +interface GTBProfissaoTableProps { + data: GTBProfissaoInterface[]; + onEdit: (item: GTBProfissaoInterface, isEditingFormStatus: boolean) => void; + onDelete: (item: GTBProfissaoInterface, isEditingFormStatus: boolean) => void; +} + +/** + * Renderiza o badge de situação + */ +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 ( + + {isActive ? "Ativo" : "Inativo"} + + ); +} + +export default function GTBProfissaoTable({ + data, + onEdit, + onDelete +}: GTBProfissaoTableProps) { + return ( + + + + # + Situação + CBO + Descrição + Ações + + + + + {data.map((item) => ( + + + {item.tb_profissao_id} + + + + + + + + {item.cod_cbo} + + + {item.descricao} + + + + + + + + + + onEdit(item, true)} + > + + Editar + + + + + onDelete(item, true)} + > + + Remover + + + + + + + ))} + +
+ ); +} diff --git a/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoIndexData.ts b/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoIndexData.ts new file mode 100644 index 0000000..d6a5a97 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoIndexData.ts @@ -0,0 +1,49 @@ + +export default async function GTBProfissoesIndexData() { + + return Promise.resolve([ + { "tb_profissao_id": 2, "descricao": "gestora comercial", "situacao": "A", "cod_cbo": "" }, + { "tb_profissao_id": 3, "descricao": "OPERADOR DE SUBSTAÇÃO", "situacao": "A", "cod_cbo": "123456" }, + { "tb_profissao_id": 4, "descricao": "funcionária pública federal", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 5, "descricao": "Estudante", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 6, "descricao": "Fazendeiro", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 7, "descricao": "Gerente de Fazenda", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 8, "descricao": "Lavrador", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 9, "descricao": "motorista", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 11, "descricao": "2º Tenente", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 12, "descricao": "agricultor", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 13, "descricao": "Aposentada", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 14, "descricao": "Arquiteto", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 15, "descricao": "Artesã", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 16, "descricao": "Autônomo", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 17, "descricao": "Auxiliar de Escritório", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 19, "descricao": "Administrador Rural", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 20, "descricao": "Administrador de fazenda", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 21, "descricao": "Advogada", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 22, "descricao": "Designer de Sobrancelhas", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 23, "descricao": "Agente Administrativo Educacional", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 24, "descricao": "Agricultora", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 25, "descricao": "Agrimensor", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 26, "descricao": "Agropecuarista", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 27, "descricao": "Agrônoma", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 28, "descricao": "Ambulante", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 29, "descricao": "Analista de Sistemas", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 30, "descricao": "Arquiteta", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 31, "descricao": "Artesão", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 32, "descricao": "Assessora Parlamentar", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 33, "descricao": "Assistente de Gestão", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 34, "descricao": "Auxiliar Técnico", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 35, "descricao": "Auxiliar Administrativo", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 36, "descricao": "Auxiliar de Cartório", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 37, "descricao": "Auxiliar de Enfermagem", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 38, "descricao": "Auxiliar de Limpeza", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 39, "descricao": "Auxiliar de Produção II", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 40, "descricao": "Auxiliar de Serviços gerais", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 41, "descricao": "Auxiliar de Sondagem", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 42, "descricao": "Balconista", "situacao": "A", "cod_cbo": "-2" }, + { "tb_profissao_id": 43, "descricao": "Bancário Aposentado", "situacao": "A", "cod_cbo": null }, + { "tb_profissao_id": 44, "descricao": "Bioquímico", "situacao": "A", "cod_cbo": "-2" } + ] + ); + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoRemoveData.ts b/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoRemoveData.ts new file mode 100644 index 0000000..952b392 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoRemoveData.ts @@ -0,0 +1,11 @@ +import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface"; + +export default async function GTBProfissaoRemoveData(data: GTBProfissaoInterface) { + + console.log(data) + + return Promise.resolve({ + message: 'Dados removidos com sucesso' + }); + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoSaveData.ts b/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoSaveData.ts new file mode 100644 index 0000000..91c21e6 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_data/GTBProfissao/GTBProfissaoSaveData.ts @@ -0,0 +1,10 @@ +import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface"; + +export default async function GTBProfissaoSaveData(data: GTBProfissaoInterface) { + + return Promise.resolve({ + message: 'Profissao salva com sucesso', + data: { "tb_profissao_id": 2, "descricao": "gestora comercial", "situacao": "A", "cod_cbo": "" }, + }); + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoReadHook.ts b/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoReadHook.ts new file mode 100644 index 0000000..958da81 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoReadHook.ts @@ -0,0 +1,23 @@ +import { useResponse } from "@/app/_response/ResponseContext" +import { useState } from "react"; +import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface"; +import GTBProfissaoIndexService from "../../_services/g_tb_profissao/GTBProfissaoIndexService"; + +export const useGTBProfissaoReadHook = () => { + + const { setResponse } = useResponse(); + const [gTBProfissao, setGTBProfissao] = useState(null); + + const fetchGTBProfissao = async () => { + + const response = await GTBProfissaoIndexService(); + + setGTBProfissao(response); + + setResponse(response); + + } + + return { gTBProfissao, fetchGTBProfissao } + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoRemoveHook.ts b/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoRemoveHook.ts new file mode 100644 index 0000000..421c186 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoRemoveHook.ts @@ -0,0 +1,19 @@ +import { useResponse } from "@/app/_response/ResponseContext" +import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface"; +import GTBProfissaoRemoveService from "../../_services/g_tb_profissao/GTBProfissaoRemoveService"; + +export const useGTBProfissaoRemoveHook = () => { + + const { setResponse } = useResponse(); + + const removeGTBProfissao = async (data: GTBProfissaoInterface) => { + + const response = await GTBProfissaoRemoveService(data); + + setResponse(response); + + } + + return { removeGTBProfissao } + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoSaveHook.ts b/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoSaveHook.ts new file mode 100644 index 0000000..b259478 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_hooks/g_tb_profissao/useGTBProfissaoSaveHook.ts @@ -0,0 +1,23 @@ +import { useResponse } from "@/app/_response/ResponseContext" +import { useState } from "react"; +import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface"; +import GTBProfissaoSaveService from "../../_services/g_tb_profissao/GTBProfissaoSaveService"; + +export const useGTBProfissaoSaveHook = () => { + + const { setResponse } = useResponse(); + const [gTBProfissao, setGTBProfissao] = useState(null); + + const saveGTBProfissao = async (data: GTBProfissaoInterface) => { + + const response = await GTBProfissaoSaveService(data); + + setGTBProfissao(response); + + setResponse(response); + + } + + return { gTBProfissao, saveGTBProfissao } + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_interfaces/GTBProfissaoInterface.ts b/src/app/(protected)/(cadastros)/cadastros/_interfaces/GTBProfissaoInterface.ts new file mode 100644 index 0000000..13f7312 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_interfaces/GTBProfissaoInterface.ts @@ -0,0 +1,9 @@ + +export default interface GTBProfissaoInterface { + + tb_profissao_id?: number, + descricao: string, + situacao: string, + cod_cbo: string + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_schemas/GTBProfissaoSchema.ts b/src/app/(protected)/(cadastros)/cadastros/_schemas/GTBProfissaoSchema.ts new file mode 100644 index 0000000..b7823ff --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_schemas/GTBProfissaoSchema.ts @@ -0,0 +1,8 @@ +import z from "zod"; + +export const GTBProfissaoSchema = z.object({ + tb_profissao_id: z.number().optional, + descricao: z.string().optional, + situacao: z.string().optional, + cod_cbo: z.string().optional +}); \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoIndexService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoIndexService.ts new file mode 100644 index 0000000..8170fd7 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoIndexService.ts @@ -0,0 +1,9 @@ +import GTBProfissoesIndexData from "../../_data/GTBProfissao/GTBProfissaoIndexData"; + +export default async function GTBProfissaoIndexService() { + + const response = await GTBProfissoesIndexData(); + + return response; + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoRemoveService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoRemoveService.ts new file mode 100644 index 0000000..9a1dcef --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoRemoveService.ts @@ -0,0 +1,12 @@ +import GTBProfissaoRemoveData from "../../_data/GTBProfissao/GTBProfissaoRemoveData"; +import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface"; + +export default async function GTBProfissaoRemoveService(data: GTBProfissaoInterface) { + + console.log(data); + + const response = await GTBProfissaoRemoveData(data); + + return response; + +} \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoSaveService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoSaveService.ts new file mode 100644 index 0000000..034c23d --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_profissao/GTBProfissaoSaveService.ts @@ -0,0 +1,10 @@ +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; + +} \ No newline at end of file diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx index a037aff..cd55946 100644 --- a/src/components/app-sidebar.tsx +++ b/src/components/app-sidebar.tsx @@ -89,6 +89,10 @@ const data = { title: "Andamentos", url: "/cadastros/andamentos/", }, + { + title: "Profissões", + url: "/cadastros/profissoes/", + }, ], }, {