Compare commits
No commits in common. "main" and "release(MVP/Sprint6)" have entirely different histories.
main
...
release(MV
732 changed files with 1950 additions and 19513 deletions
117
.code-workspace
117
.code-workspace
|
|
@ -1,117 +0,0 @@
|
|||
{
|
||||
"folders": [{ "path": "D:/IIS/Orius/app" }],
|
||||
"settings": {
|
||||
// === GERAL ===
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit",
|
||||
"source.organizeImports": "explicit",
|
||||
},
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnType": false,
|
||||
"editor.minimap.enabled": false,
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"files.autoSave": "onFocusChange",
|
||||
"telemetry.telemetryLevel": "off",
|
||||
"update.mode": "manual",
|
||||
|
||||
// === PERFORMANCE ===
|
||||
"files.watcherExclude": {
|
||||
"**/node_modules/**": true,
|
||||
"**/dist/**": true,
|
||||
"**/build/**": true,
|
||||
"**/.next/**": true,
|
||||
"**/.git/**": true,
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/dist": true,
|
||||
"**/.next": true,
|
||||
"**/.git": true,
|
||||
},
|
||||
|
||||
// === FRONTEND ===
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
},
|
||||
"[typescriptreact]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
},
|
||||
|
||||
// === TAILWIND ===
|
||||
"files.associations": {
|
||||
"*.css": "tailwindcss",
|
||||
},
|
||||
"tailwindCSS.includeLanguages": {
|
||||
"plaintext": "html",
|
||||
"javascript": "javascript",
|
||||
"typescriptreact": "typescriptreact",
|
||||
},
|
||||
|
||||
// === TERMINAIS ===
|
||||
"terminal.integrated.profiles.windows": {
|
||||
"Next.js Dev": {
|
||||
"path": "cmd.exe",
|
||||
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run dev"],
|
||||
},
|
||||
"Build & Preview": {
|
||||
"path": "cmd.exe",
|
||||
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run build && npm run start"],
|
||||
},
|
||||
"Git Bash": {
|
||||
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
|
||||
},
|
||||
},
|
||||
"terminal.integrated.defaultProfile.windows": "Git Bash",
|
||||
|
||||
// === GIT ===
|
||||
"git.enabled": true,
|
||||
"git.autorefresh": false,
|
||||
"git.fetchOnPull": true,
|
||||
"git.confirmSync": false,
|
||||
|
||||
// === VISUAL ===
|
||||
"workbench.colorTheme": "Default Dark Modern",
|
||||
"window.zoomLevel": 0,
|
||||
"breadcrumbs.enabled": true,
|
||||
"explorer.compactFolders": false,
|
||||
|
||||
// === MISC ===
|
||||
"files.exclude": {
|
||||
"**/.DS_Store": true,
|
||||
"**/*.log": true,
|
||||
},
|
||||
},
|
||||
"launch": {
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Next.js: Debug Development Server",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": ["run", "dev"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"port": 9229,
|
||||
},
|
||||
],
|
||||
},
|
||||
"extensions": {
|
||||
"recommendations": [
|
||||
// === FRONTEND CORE ===
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"ms-vscode.vscode-typescript-next",
|
||||
|
||||
// === DEV EXPERIENCE ===
|
||||
"formulahendry.code-runner",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"eamodio.gitlens",
|
||||
"mhutchie.git-graph",
|
||||
"donjayamanne.githistory",
|
||||
],
|
||||
},
|
||||
}
|
||||
65
Dockerfile
65
Dockerfile
|
|
@ -1,59 +1,22 @@
|
|||
# ============================
|
||||
# STAGE 1 – Build
|
||||
# ============================
|
||||
FROM node:20-alpine AS builder
|
||||
# Use uma imagem Node.js completa para o desenvolvimento
|
||||
FROM node:20-alpine
|
||||
|
||||
# Define o diretório de trabalho no container
|
||||
WORKDIR /app
|
||||
|
||||
# Copia pacotes e instala dependências
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
# Copia os arquivos de configuração do projeto
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Copia o restante do código
|
||||
# Instala todas as dependências do projeto
|
||||
# Isso é necessário para o modo de desenvolvimento, pois o build não pré-compila os arquivos.
|
||||
RUN npm install
|
||||
|
||||
# Copia o restante do código da sua aplicação
|
||||
COPY . .
|
||||
|
||||
# ---------- Variáveis de build ----------
|
||||
# Estas variáveis são usadas pelo Next.js durante o "build"
|
||||
# para embutir no bundle do frontend.
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_STATE
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_URL
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_PREFIX
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE
|
||||
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_STATE=$NEXT_PUBLIC_ORIUS_APP_STATE
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_URL=$NEXT_PUBLIC_ORIUS_APP_API_URL
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_PREFIX=$NEXT_PUBLIC_ORIUS_APP_API_PREFIX
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE=$NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE
|
||||
|
||||
# ---------- Build ----------
|
||||
ENV NODE_ENV=production
|
||||
RUN npm run build
|
||||
|
||||
# ============================
|
||||
# STAGE 2 – Runner (standalone)
|
||||
# ============================
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# ---------- Variáveis em runtime ----------
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Copia apenas o necessário do build
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package*.json ./
|
||||
|
||||
# ---------- Corrige permissões ----------
|
||||
RUN addgroup -S nodejs && adduser -S nextjs -G nodejs \
|
||||
&& mkdir -p .next/cache/images \
|
||||
&& chown -R nextjs:nodejs /app
|
||||
|
||||
USER nextjs
|
||||
|
||||
# Expõe a porta de desenvolvimento padrão do Next.js
|
||||
EXPOSE 3000
|
||||
|
||||
# ---------- Executa o servidor ----------
|
||||
CMD ["node", "server.js"]
|
||||
# Define o comando para iniciar a aplicação em modo de desenvolvimento
|
||||
# Isso ativará o servidor de desenvolvimento e a recarga automática
|
||||
CMD ["npm", "run", "dev"]
|
||||
|
|
|
|||
41
Dockerfile-homologacao
Normal file
41
Dockerfile-homologacao
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Etapa 1: Construir a aplicação
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
# Define o diretório de trabalho
|
||||
WORKDIR /app
|
||||
|
||||
# Copia os arquivos de configuração do pacote
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Instala as dependências do projeto
|
||||
RUN npm install
|
||||
|
||||
# Copia todo o código da aplicação para o container
|
||||
COPY . .
|
||||
|
||||
# Constrói a aplicação com o output 'standalone'
|
||||
RUN npm run build
|
||||
|
||||
# Etapa 2: Executar a aplicação
|
||||
# Usa uma imagem Node.js leve
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
# Define o diretório de trabalho
|
||||
WORKDIR /app
|
||||
|
||||
# Copia o diretório 'standalone' da etapa de build, que já contém o servidor e as dependências
|
||||
# O diretório 'standalone' é a pasta .next/standalone gerada pela configuração 'output: standalone'
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
|
||||
# Copia os arquivos públicos
|
||||
COPY --from=builder /app/public ./public
|
||||
|
||||
# Copia os arquivos estáticos gerados pelo build. É aqui que os arquivos CSS e JS ficam.
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
|
||||
# Expõe a porta padrão do Next.js
|
||||
EXPOSE 3000
|
||||
|
||||
# Define o comando para iniciar a aplicação
|
||||
# O 'start' do package.json não é necessário, o próprio servidor standalone já está no container
|
||||
CMD ["node", "server.js"]
|
||||
57
README.md
57
README.md
|
|
@ -1,58 +1 @@
|
|||
# saas_app
|
||||
|
||||
Criar envlocal para usar variaveis de ambiente no em desenvolvimento
|
||||
NEXT_PUBLIC_ORIUS_APP_STATE=GO
|
||||
NEXT_PUBLIC_ORIUS_APP_API_URL=<http://localhost:8000/>
|
||||
NEXT_PUBLIC_ORIUS_APP_API_PREFIX=api/v1/
|
||||
NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE=application/json
|
||||
|
||||
## Modo Debug
|
||||
|
||||
Abra Run → Add Configuration… → Attach to Node.js
|
||||
|
||||
Configure:
|
||||
|
||||
{
|
||||
"name": "Attach Next.js (9230)",
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"port": 9230,
|
||||
"restart": true,
|
||||
"smartStep": true,
|
||||
"skipFiles": ["<node_internals>/**"]
|
||||
}
|
||||
|
||||
npm run dev:debug
|
||||
|
||||
## onlyoffice
|
||||
|
||||
docker run -i -t -d -p 8081:80 --restart=always -e JWT_ENABLED=false onlyoffice/documentserver
|
||||
|
||||
## next em rede
|
||||
|
||||
```
|
||||
npx next dev -H 0.0.0.0
|
||||
```
|
||||
|
||||
```
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"dev:lan": "next dev -H 0.0.0.0" <-- Adicione esta linha
|
||||
},
|
||||
```
|
||||
|
||||
Como acessar no outro dispositivo
|
||||
Descubra seu IP Local:
|
||||
|
||||
No Windows (seu caso), abra um terminal (CMD ou PowerShell) e digite:
|
||||
|
||||
Bash
|
||||
|
||||
ipconfig
|
||||
Procure por Endereço IPv4 (geralmente começa com 192.168.x.x ou 10.0.x.x).
|
||||
|
||||
Acesse no navegador: No celular ou outro computador, digite: http://SEU_IP_AQUI:3000
|
||||
|
||||
Exemplo: <http://192.168.0.15:3000>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,12 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// Gera build autônomo para rodar com "node server.js"
|
||||
import type { NextConfig } from 'next';
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// Isso gera um diretório otimizado que inclui tudo o que a aplicação precisa para rodar
|
||||
output: 'standalone',
|
||||
|
||||
// Configurações gerais
|
||||
reactStrictMode: true,
|
||||
poweredByHeader: false,
|
||||
compress: true,
|
||||
|
||||
// Desativa verificações no build de produção
|
||||
eslint: { ignoreDuringBuilds: true },
|
||||
typescript: { ignoreBuildErrors: true },
|
||||
|
||||
eslint: {
|
||||
// Desativa a verificação de lint durante o build
|
||||
ignoreDuringBuilds: true,
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
export default nextConfig;
|
||||
|
|
|
|||
1043
package-lock.json
generated
1043
package-lock.json
generated
File diff suppressed because it is too large
Load diff
20
package.json
20
package.json
|
|
@ -4,17 +4,14 @@
|
|||
"version": "25.9.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev:debug": "cross-env NEXT_USE_TURBOPACK=0 NODE_OPTIONS=\"--inspect=9230\" next dev",
|
||||
"dev": "next dev --turbopack",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"postinstall": "shx mkdir -p public/libs && shx cp -r node_modules/tinymce public/libs/tinymce"
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@faker-js/faker": "^10.0.0",
|
||||
"@hookform/resolvers": "^5.2.1",
|
||||
"@onlyoffice/document-editor-react": "^2.1.1",
|
||||
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||
"@radix-ui/react-avatar": "^1.1.10",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
|
|
@ -23,12 +20,9 @@
|
|||
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
||||
"@radix-ui/react-label": "^2.1.7",
|
||||
"@radix-ui/react-popover": "^1.1.15",
|
||||
"@radix-ui/react-progress": "^1.1.7",
|
||||
"@radix-ui/react-radio-group": "^1.3.8",
|
||||
"@radix-ui/react-scroll-area": "^1.2.10",
|
||||
"@radix-ui/react-select": "^2.2.6",
|
||||
"@radix-ui/react-separator": "^1.1.8",
|
||||
"@radix-ui/react-slot": "^1.2.4",
|
||||
"@radix-ui/react-separator": "^1.1.7",
|
||||
"@radix-ui/react-slot": "^1.2.3",
|
||||
"@radix-ui/react-switch": "^1.2.6",
|
||||
"@radix-ui/react-tabs": "^1.1.13",
|
||||
"@radix-ui/react-tooltip": "^1.2.8",
|
||||
|
|
@ -38,9 +32,7 @@
|
|||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"cookies-next": "^6.1.0",
|
||||
"date-fns": "^3.6.0",
|
||||
"faker-js": "^1.0.0",
|
||||
"framer-motion": "^12.23.24",
|
||||
"input-otp": "^1.4.2",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
|
|
@ -52,7 +44,6 @@
|
|||
"react-dom": "19.1.0",
|
||||
"react-hook-form": "^7.62.0",
|
||||
"react-masked-text": "^1.0.5",
|
||||
"recharts": "^3.3.0",
|
||||
"sonner": "^2.0.7",
|
||||
"tailwind-merge": "^3.3.1",
|
||||
"tinymce": "^8.1.2",
|
||||
|
|
@ -60,7 +51,6 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/date-fns": "^2.5.3",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/jsonwebtoken": "^9.0.10",
|
||||
"@types/node": "^20",
|
||||
|
|
@ -68,7 +58,6 @@
|
|||
"@types/react-dom": "^19",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
||||
"@typescript-eslint/parser": "^8.46.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"eslint": "^9.38.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
|
|
@ -80,7 +69,6 @@
|
|||
"eslint-plugin-unused-imports": "^4.2.0",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-plugin-tailwindcss": "^0.6.14",
|
||||
"shx": "^0.4.0",
|
||||
"tailwindcss": "^4",
|
||||
"tw-animate-css": "^1.3.7",
|
||||
"typescript": "5.9.3",
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,50 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
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() {
|
||||
const params = useParams();
|
||||
|
||||
const { usuario, fetchUsuario } = useGUsuarioReadHooks();
|
||||
|
||||
useEffect(() => {
|
||||
if (params.id) {
|
||||
fetchUsuario({ usuario_id: Number(params.id) } as Usuario);
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (!usuario) return <Loading type={1} />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<div className="mb-4 grid grid-cols-4 gap-4">
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Nome</div>
|
||||
<div className="text-xl">{usuario?.nome_completo}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">CPF</div>
|
||||
<div className="text-xl">{usuario?.cpf}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Função</div>
|
||||
<div className="text-xl">{usuario?.funcao}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Email</div>
|
||||
<div className="text-xl">{usuario?.email}</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
'use client';
|
||||
|
||||
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 '../../../../../../packages/administrativo/schemas/GUsuario/GUsuarioSchema';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from '@/components/ui/form';
|
||||
|
||||
import { useGUsuarioSaveHook } from '../../../../../../packages/administrativo/hooks/GUsuario/useGUsuarioSaveHook';
|
||||
|
||||
type FormValues = z.infer<typeof GUsuarioSchema>;
|
||||
|
||||
export default function UsuarioFormularioPage() {
|
||||
const { usuario, saveUsuario } = useGUsuarioSaveHook();
|
||||
|
||||
const form = useForm<FormValues>({
|
||||
resolver: zodResolver(GUsuarioSchema),
|
||||
defaultValues: {
|
||||
login: '',
|
||||
nome_completo: '',
|
||||
funcao: '',
|
||||
email: '',
|
||||
cpf: '',
|
||||
},
|
||||
});
|
||||
|
||||
async function onSubmit(values: FormValues) {
|
||||
saveUsuario(values);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="login"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Login</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="nome_completo"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Nome Completo</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="funcao"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Função</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="email"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Email</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="cpf"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Cpf</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<Button type="submit">Salvar</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
'use client';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
|
||||
import Usuario from '../../../../../packages/administrativo/interfaces/GUsuario/GUsuarioInterface';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import Link from 'next/link';
|
||||
import { useGUsuarioIndexHook } from '../../../../../packages/administrativo/hooks/GUsuario/useGUsuarioIndexHook';
|
||||
import { useEffect } from 'react';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
export default function UsuarioPage() {
|
||||
const { usuarios, fetchUsuarios } = useGUsuarioIndexHook();
|
||||
|
||||
useEffect(() => {
|
||||
fetchUsuarios();
|
||||
}, []);
|
||||
|
||||
if (!usuarios) return <Loading type={2} />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-2">
|
||||
<div className="text-2xl font-semibold">Usuarios</div>
|
||||
<div className="text-right">
|
||||
<Button asChild>
|
||||
<Link href="/usuarios/formulario">+ Usuário</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead className="text-center">#</TableHead>
|
||||
<TableHead>Situação</TableHead>
|
||||
<TableHead>CPF</TableHead>
|
||||
<TableHead>Login / Sigla / Nome</TableHead>
|
||||
<TableHead>Função</TableHead>
|
||||
<TableHead></TableHead>
|
||||
<TableHead></TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{usuarios.map((usuario: Usuario) => (
|
||||
<TableRow key={usuario.usuario_id} className="cursor-pointer">
|
||||
<TableCell className="text-center">{usuario.usuario_id}</TableCell>
|
||||
<TableCell className="font-medium">{usuario.situacao}</TableCell>
|
||||
<TableCell className="font-medium">{usuario.cpf}</TableCell>
|
||||
<TableCell>
|
||||
<div className="text-xs font-semibold">
|
||||
{usuario.login} - {usuario.sigla}
|
||||
</div>
|
||||
<div className="text-base">{usuario.nome_completo}</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div className="text-base">{usuario.funcao}</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Button asChild>
|
||||
<Link href={`/usuarios/${usuario.usuario_id}/detalhes`}>Detalhes</Link>
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import GCartorioIndex from '@/packages/administrativo/components/GCartorio/GCartorioIndex';
|
||||
|
||||
export default function GCartorioPage() {
|
||||
return <GCartorioIndex />;
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
export default function TCensecPage() {
|
||||
return <div></div>;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import GCalculoIndex from '@/packages/administrativo/components/GCalculo/GCalculoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GCalculoIndex />;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import GEmolumentoItemIndex from '@/packages/administrativo/components/GEmolumentoItem/GEmolumentoItemIndex';
|
||||
|
||||
export default function GGramaticaPage() {
|
||||
const params = useParams();
|
||||
|
||||
return (
|
||||
<GEmolumentoItemIndex
|
||||
emolumento_id={Number(params.emolumentoId)}
|
||||
emolumento_periodo_id={Number(params.emolumentoPeriodoId)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import GEmolumentoIndex from '@/packages/administrativo/components/GEmolumento/GEmolumentoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GEmolumentoIndex />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import GEmolumentoPeriodoIndex from '@/packages/administrativo/components/GEmolumentoPeriodo/GEmolumentoPeriodoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GEmolumentoPeriodoIndex />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import GGramaticaIndex from '@/packages/administrativo/components/GGramatica/GGramaticaIndex';
|
||||
|
||||
export default function GGramaticaPage() {
|
||||
return <GGramaticaIndex />;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import TImovelDashboard from '@/packages/administrativo/components/TImovel/TImovelDashboard';
|
||||
|
||||
export default function TImovelDashboardPage() {
|
||||
return <TImovelDashboard />;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import TPessoaDashboard from '@/packages/administrativo/components/TPessoa/TPessoaDashboard';
|
||||
|
||||
export default function TPessoaDashboardPage() {
|
||||
return <TPessoaDashboard />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import GSeloGrupoIndex from '@/packages/administrativo/components/GSeloGrupo/GSeloGrupoIndex';
|
||||
|
||||
export default function GSeloGrupoPage() {
|
||||
return <GSeloGrupoIndex />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TServicoTipoIndex from '@/packages/administrativo/components/TServicoTipo/TServicoTipoIndex';
|
||||
|
||||
export default function TServicoTipoPage() {
|
||||
return <TServicoTipoIndex />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import GNaturezaTituloIndex from '@/packages/administrativo/components/GNaturezaTitulo/GNaturezaTituloIndex';
|
||||
|
||||
export default function GNaturezaPage() {
|
||||
return <GNaturezaTituloIndex sistema_id={2} />;
|
||||
}
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
export default function TMinutaDetalhes() {
|
||||
const params = useParams();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
'use client';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import z from 'zod';
|
||||
import { useEffect } from 'react';
|
||||
import { useForm, Controller } from 'react-hook-form';
|
||||
import z from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import {
|
||||
Form,
|
||||
|
|
@ -19,8 +17,11 @@ import {
|
|||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
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>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
|
||||
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
|
||||
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { useTMinutaRemoveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaRemoveHook';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
|
||||
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
|
||||
|
||||
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 '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
|
||||
|
||||
export default function TMinutaPage() {
|
||||
// Hooks de leitura e escrita
|
||||
|
|
|
|||
|
|
@ -1,22 +1,29 @@
|
|||
'use client';
|
||||
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useTServicoTipoEditHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoEditHook';
|
||||
import { useTServicoTipoReadHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoReadHook';
|
||||
import { useTServicoTipoRemoveHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoRemoveHook';
|
||||
import { useTServicoTipoSaveHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoSaveHook';
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
// Componentes específicos para TServicoTipo
|
||||
import TServicoTipoTable from '../../_components/t_servico_tipo/TServicoTipoTable';
|
||||
import TServicoTipoForm from '../../_components/t_servico_tipo/TServicoTipoForm';
|
||||
|
||||
// Hooks específicos para TServicoTipo
|
||||
import { useTServicoTipoReadHook } from '../../_hooks/t_servico_tipo/useTServicoTipoReadHook';
|
||||
import { useTServicoTipoSaveHook } from '../../_hooks/t_servico_tipo/useTServicoTipoSaveHook';
|
||||
import { useTServicoTipoRemoveHook } from '../../_hooks/t_servico_tipo/useTServicoTipoRemoveHook';
|
||||
import { useTServicoTipoEditHook } from '../../_hooks/t_servico_tipo/useTServicoTipoEditHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
// Interface específica para TServicoTipo
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
|
||||
import TServicoTipoForm from './TServicoTipoForm';
|
||||
import TServicoTipoTable from './TServicoTipoTable';
|
||||
|
||||
export default function TServicoTipoIndex() {
|
||||
export default function TServicoTipoPage() {
|
||||
// Hooks para leitura, salvamento e remoção
|
||||
const { tServicoTipo, fetchTServicoTipo } = useTServicoTipoReadHook();
|
||||
const { saveTServicoTipo } = useTServicoTipoSaveHook();
|
||||
const { removeTServicoTipo } = useTServicoTipoRemoveHook();
|
||||
|
|
@ -26,8 +33,9 @@ export default function TServicoTipoIndex() {
|
|||
const [selectedServicoTipo, setSelectedServicoTipo] = useState<TServicoTipoInterface | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
const [isFormOpen, setIsFormOpen] = useState(false);
|
||||
|
||||
// Estado para saber qual item será deletado
|
||||
const [itemToDelete, setItemToDelete] = useState<TServicoTipoInterface | null>(null);
|
||||
|
||||
/**
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
'use client';
|
||||
|
||||
import { CirclePlus, DollarSign, Settings, SquarePen, Trash } from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import React from 'react';
|
||||
import z from 'zod';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useState } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
|
|
@ -14,6 +15,8 @@ import {
|
|||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { CirclePlus, DollarSign, Settings, SquarePen, Trash } from 'lucide-react';
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
|
|
@ -23,6 +26,14 @@ import {
|
|||
FormMessage,
|
||||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
|
|
@ -31,95 +42,147 @@ import {
|
|||
TableHeader,
|
||||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import CCaixaServicoSelect from '@/packages/administrativo/components/CCaixaServico/CCaixaServicoSelect';
|
||||
import GEmolumentoSelect from '@/packages/administrativo/components/GEmolumento/GEmolumentoSelect';
|
||||
|
||||
import { TServicoTipoSchema, TServicoTipoFormValues } from '../../_schemas/TServicoTipoSchema';
|
||||
import { useEffect } from 'react';
|
||||
import GMarcacaoTipoSelect from '@/packages/administrativo/components/GMarcacaoTipo/GMarcacaoTipoSelect';
|
||||
import TTBReconhecimentoTipoSelect from '@/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoSelect';
|
||||
import { TServicoTipoSaveData } from '@/packages/administrativo/data/TServicoTipo/TServicoTipoSaveData';
|
||||
import { useGEmolumentoItemReadHook } from '@/packages/administrativo/hooks/GEmolumentoItem/useGEmolumentoItemReadHook';
|
||||
import { useTServicoEtiquetaReadHook } from '@/packages/administrativo/hooks/TServicoEtiqueta/useTServicoEtiquetaReadHook';
|
||||
import { useTServicoEtiquetaRemoveHook } from '@/packages/administrativo/hooks/TServicoEtiqueta/useTServicoEtiquetaRemoveHook';
|
||||
import { useTServicoEtiquetaSaveHook } from '@/packages/administrativo/hooks/TServicoEtiqueta/useTServicoEtiquetaSaveHook';
|
||||
import { useTServicoTipoFormHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoFormHook';
|
||||
import { GEmolumentoItemReadInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemReadInterface';
|
||||
import TServicoTipoFormInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoFormInterface';
|
||||
import { TServicoTipoFormValues } from '@/packages/administrativo/schemas/TServicoTipo/TServicoTipoSchema';
|
||||
import GEmolumentoSelect from '@/packages/administrativo/components/GEmolumento/GEmolumentoSelect';
|
||||
import { useGEmolumentoItemReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/g_emolumento_item/useGEmolumentoItemReadHook';
|
||||
import { GEmolumentoItemReadInterface } from '@/app/(protected)/(cadastros)/cadastros/_interfaces/GEmolumentoItemReadInterface';
|
||||
import CategoriaServicoSelect from '@/shared/components/categoriaServicoSelect/CategoriaServicoSelect';
|
||||
import CCaixaServicoSelect from '@/packages/administrativo/components/CCaixaServico/CCaixaServicoSelect';
|
||||
import { TServicoTipoSaveData } from '../../_data/TServicoTipo/TServicoTipoSaveData';
|
||||
import TTBReconhecimentoTipoSelect from '@/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoSelect';
|
||||
import { ConfirmacaoCheckBox } from '@/shared/components/confirmacao/ConfirmacaoCheckBox';
|
||||
import ConfirmacaoSelect from '@/shared/components/confirmacao/ConfirmacaoSelect';
|
||||
import { TipoPessoaSelect } from '@/shared/components/tipoPessoa/tipoPessoaSelect';
|
||||
import { ConfirmacaoEnum } from '@/shared/enums/ConfirmacaoEnum';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
import { useTServicoEtiquetaReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/t_servico_etiqueta/useTServicoEtiquetaReadHook';
|
||||
import { useTServicoEtiquetaSaveHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/t_servico_etiqueta/useTServicoEtiquetaSaveHook';
|
||||
import { useTServicoEtiquetaRemoveHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/t_servico_etiqueta/useTServicoEtiquetaRemoveHook';
|
||||
|
||||
// Propriedades esperadas pelo componente
|
||||
interface Props {
|
||||
isOpen: boolean;
|
||||
data: TServicoTipoFormValues | null;
|
||||
onClose: (item: null, isFormStatus: boolean) => void;
|
||||
onSave: (data: TServicoTipoFormValues) => void;
|
||||
}
|
||||
|
||||
// Componente principal do formulário
|
||||
export default function TServicoTipoForm({
|
||||
isOpen,
|
||||
data,
|
||||
onClose,
|
||||
onSave,
|
||||
}: TServicoTipoFormInterface) {
|
||||
const form = useTServicoTipoFormHook({});
|
||||
export default function TServicoTipoForm({ isOpen, data, onClose, onSave }: Props) {
|
||||
// Inicializa o react-hook-form com validação via Zod
|
||||
const form = useForm<TServicoTipoFormValues>({
|
||||
resolver: zodResolver(TServicoTipoSchema),
|
||||
defaultValues: {
|
||||
servico_tipo_id: 0,
|
||||
emolumento_id: 0,
|
||||
emolumento_obrigatorio: 0,
|
||||
descricao: '',
|
||||
maximo_pessoa: 0,
|
||||
tipo_item: '',
|
||||
frenteverso: 'N',
|
||||
averbacao: 'N',
|
||||
transferencia_veiculo: 'N',
|
||||
usar_a4: 'N',
|
||||
etiqueta_unica: 'N',
|
||||
situacao: 'A',
|
||||
selar: 'N',
|
||||
valor_emolumento: 0,
|
||||
valor_taxa_judiciaria: 0,
|
||||
fundesp_valor: 0,
|
||||
valor_total: 0,
|
||||
tipo_pessoa: 'F', // ou "J"
|
||||
} as unknown as TServicoTipoFormValues,
|
||||
});
|
||||
|
||||
// Carrega o ID caso esteja informado no form
|
||||
const servico_tipo_id = form.getValues('servico_tipo_id') || 0;
|
||||
|
||||
// Hook responsável por buscar emolumentos no backend
|
||||
const { tServicoEtiqueta, fetchTServicoEtiqueta } = useTServicoEtiquetaReadHook();
|
||||
const { fetchTServicoEtiquetaSave } = useTServicoEtiquetaSaveHook();
|
||||
|
||||
// Hook responsável em salvar o a etiqueta selecionada
|
||||
const { tServicoEtiquetaSave, fetchTServicoEtiquetaSave } = useTServicoEtiquetaSaveHook();
|
||||
|
||||
// Hook responsável em excluir a etiqueta selecionada
|
||||
const { fetchTServicoEtiquetaRemove } = useTServicoEtiquetaRemoveHook();
|
||||
|
||||
// Estado para gerenciar os itens da tabela de etiquetas/carimbos
|
||||
const [itensTabela, setItensTabela] = useState<
|
||||
{ servico_etiqueta_id: string | number; descricao: string }[]
|
||||
>([]);
|
||||
|
||||
// Carrega etiquetas quando o form tem ID
|
||||
useEffect(() => {
|
||||
// Carrega os dados de emolumentos apenas uma vez ao montar o componente
|
||||
React.useEffect(() => {
|
||||
// Função para consumir o endpoint da api
|
||||
const loadData = async () => {
|
||||
// Verifica se o ID do serviço tipo foi informado
|
||||
if (servico_tipo_id > 0) {
|
||||
// Consumo o endpoint da api
|
||||
await fetchTServicoEtiqueta({ servico_tipo_id });
|
||||
}
|
||||
};
|
||||
|
||||
// Chama a função para consumir o endpoint da api
|
||||
loadData();
|
||||
}, [servico_tipo_id]);
|
||||
|
||||
// Atualiza a tabela quando muda o hook
|
||||
useEffect(() => {
|
||||
// Atualiza itensTabela sempre que tServicoEtiqueta for carregado
|
||||
React.useEffect(() => {
|
||||
// Verifica se a consulta retornou os dados como objeto
|
||||
if (Array.isArray(tServicoEtiqueta) && tServicoEtiqueta.length > 0) {
|
||||
// Lista os itens
|
||||
const mapped = tServicoEtiqueta.map((item) => ({
|
||||
servico_etiqueta_id: Number(item.servico_etiqueta_id ?? 0),
|
||||
descricao: String(item.descricao ?? 'Sem descrição'),
|
||||
}));
|
||||
|
||||
setItensTabela(mapped);
|
||||
} else {
|
||||
setItensTabela([]);
|
||||
}
|
||||
}, [tServicoEtiqueta]);
|
||||
|
||||
// Função para adicionar um novo item à tabela Etiquetas/Carimbos
|
||||
const handleAddEtiquetaCarimbo = async () => {
|
||||
// Captura o valor selecionado do formulário
|
||||
const valorSelecionado = form.getValues('etiquetas_carimbos');
|
||||
|
||||
// Se não houver valor selecionado, não faz nada
|
||||
if (!valorSelecionado) return;
|
||||
|
||||
// Verifica se o item já se encontra na tabela
|
||||
const alreadyExists = itensTabela.some(
|
||||
(p) => String(p.descricao).trim() === String(valorSelecionado).trim(),
|
||||
(p) => String(p.descricao).trim() === String(valorSelecionado.value).trim(),
|
||||
);
|
||||
|
||||
if (alreadyExists) return;
|
||||
// Caso o item já esteja na tabela, para o procedimento
|
||||
if (alreadyExists) {
|
||||
return;
|
||||
}
|
||||
|
||||
// --- Envio opcional para API ---
|
||||
try {
|
||||
// Verifica se o ID do serviço tipo foi informado
|
||||
if (servico_tipo_id > 0) {
|
||||
const dataToSave = {
|
||||
etiqueta_modelo_id: 0, // não há ID, pois o valor é string
|
||||
// Monta o objeto do item selecionado
|
||||
const data = {
|
||||
etiqueta_modelo_id: valorSelecionado.key,
|
||||
servico_tipo_id: servico_tipo_id,
|
||||
};
|
||||
|
||||
const response = await fetchTServicoEtiquetaSave(dataToSave);
|
||||
// Consumo o endpoint da api
|
||||
const response = await fetchTServicoEtiquetaSave(data);
|
||||
|
||||
// Verifica se tServicoEtiquetaSave é um objeto válido (não null e não array)
|
||||
if (response && typeof response === 'object' && !Array.isArray(response)) {
|
||||
// Monta o objeto com um único item para a tabela
|
||||
const item = {
|
||||
servico_etiqueta_id: Number(response.servico_etiqueta_id) ?? 0,
|
||||
descricao: String(valorSelecionado) ?? 'Sem descrição',
|
||||
descricao: String(valorSelecionado.value) ?? 'Sem descrição',
|
||||
};
|
||||
|
||||
// Adiciona o item na tabela
|
||||
setItensTabela((prev) => {
|
||||
const idAtual = String(response.servico_etiqueta_id ?? '');
|
||||
const exists = prev.some((p) => String(p.servico_etiqueta_id ?? '') === idAtual);
|
||||
|
|
@ -127,80 +190,110 @@ export default function TServicoTipoForm({
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Se ocorrer erros, informo
|
||||
} catch (error) {
|
||||
console.log('Erro ao enviar o serviço para a API: ' + error);
|
||||
}
|
||||
};
|
||||
|
||||
// Remove item da tabela
|
||||
// Função para remover um item da tabela
|
||||
const handleRemoveItem = async (servico_etiqueta_id: number) => {
|
||||
try {
|
||||
// Verifica se o ID da etiqueta tipo foi informado
|
||||
if (servico_etiqueta_id > 0) {
|
||||
const data = { servico_etiqueta_id };
|
||||
// Monta o objeto do item selecionado
|
||||
const data = {
|
||||
servico_etiqueta_id: servico_etiqueta_id,
|
||||
};
|
||||
|
||||
// Consumo o endpoint da api
|
||||
await fetchTServicoEtiquetaRemove(data);
|
||||
}
|
||||
|
||||
// Atualiza a tabela no form
|
||||
setItensTabela((prev) =>
|
||||
prev.filter((p) => Number(p.servico_etiqueta_id) !== servico_etiqueta_id),
|
||||
);
|
||||
|
||||
// Se ocorrer erros, informo
|
||||
} catch (error) {
|
||||
console.log('Erro ao enviar o serviço para a API: ' + error);
|
||||
}
|
||||
};
|
||||
|
||||
// Parâmetros para o hook de leitura de emolumento_item
|
||||
// Inicializa com valores padrão (0) para evitar uso de propriedades não declaradas.
|
||||
const gEmolumentoItemReadParams: GEmolumentoItemReadInterface = { emolumento_id: 0, valor: 0 };
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
// Estados locais
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [isLoading, setIsLoading] = React.useState(false);
|
||||
|
||||
// Hook que realiza a leitura do emolumento_item
|
||||
const { gGEmolumentoItem, fetchGEmolumentoItem } = useGEmolumentoItemReadHook();
|
||||
|
||||
// Busca emolumento item
|
||||
useEffect(() => {
|
||||
// Busca os dados ao montar o componente (somente se houver ID válido)
|
||||
React.useEffect(() => {
|
||||
const loadData = async () => {
|
||||
// Validação: só executa se houver emolumento_id informado e válido
|
||||
if (
|
||||
!gEmolumentoItemReadParams?.emolumento_id ||
|
||||
isNaN(Number(gEmolumentoItemReadParams.emolumento_id)) ||
|
||||
Number(gEmolumentoItemReadParams.emolumento_id) <= 0
|
||||
!gEmolumentoItemReadParams?.emolumento_id || // se não existir o campo
|
||||
isNaN(Number(gEmolumentoItemReadParams.emolumento_id)) || // se não for número
|
||||
Number(gEmolumentoItemReadParams.emolumento_id) <= 0 // se for zero ou negativo
|
||||
) {
|
||||
return;
|
||||
return; // encerra sem executar a busca
|
||||
}
|
||||
|
||||
// Executa a busca apenas se ainda não houver dados carregados
|
||||
if (!gGEmolumentoItem.length) {
|
||||
setIsLoading(true);
|
||||
await fetchGEmolumentoItem(gEmolumentoItemReadParams);
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
loadData();
|
||||
}, [gEmolumentoItemReadParams.emolumento_id]);
|
||||
|
||||
// Captura o ID do serviço para uso local
|
||||
const servicoTipoId = Number(form.watch('servico_tipo_id') || data?.servico_tipo_id || 0);
|
||||
|
||||
// Função chamada ao clicar em "Salvar"
|
||||
const handleSave = async (formData: TServicoTipoFormValues) => {
|
||||
try {
|
||||
// Se o form não trouxe o ID, tenta puxar de `data`
|
||||
const servico_tipo_id =
|
||||
formData.servico_tipo_id || data?.servico_tipo_id || form.getValues('servico_tipo_id') || 0;
|
||||
|
||||
// Atualiza o valor dentro do formData
|
||||
formData.servico_tipo_id = Number(servico_tipo_id);
|
||||
|
||||
// Intercepta e trata o valor de emolumento_id
|
||||
const emolumentoId = Number(formData.emolumento_id ?? 0);
|
||||
formData.emolumento_id = emolumentoId === 0 ? null : emolumentoId;
|
||||
|
||||
// Intercepta e trata o valor de emolumento_obrigatorio
|
||||
const emolumentoObrigatorio = Number(formData.emolumento_obrigatorio ?? 0);
|
||||
formData.emolumento_obrigatorio = emolumentoObrigatorio === 0 ? null : emolumentoObrigatorio;
|
||||
|
||||
// Detecta automaticamente se é edição
|
||||
const isEditing = !!formData.servico_tipo_id && Number(formData.servico_tipo_id) > 0;
|
||||
|
||||
// Envia os dados para o módulo com o método correto
|
||||
const response = await TServicoTipoSaveData({
|
||||
...formData,
|
||||
metodo: isEditing ? 'PUT' : 'POST',
|
||||
metodo: isEditing ? 'PUT' : 'POST', // 💡 Definição explícita do método
|
||||
});
|
||||
|
||||
// Atualiza o formulário apenas se o retorno for válido
|
||||
if (response?.data?.servico_tipo_id) {
|
||||
const novoId = response.data.servico_tipo_id;
|
||||
form.setValue('servico_tipo_id', novoId);
|
||||
form.setValue('servico_tipo_id', novoId); // mantém o ID atualizado
|
||||
|
||||
// Merge dos dados para preservar valores locais
|
||||
form.reset({ ...form.getValues(), ...response.data });
|
||||
|
||||
console.log(`Serviço ${isEditing ? 'atualizado' : 'criado'} com sucesso (ID: ${novoId})`);
|
||||
} else {
|
||||
console.log('Erro ao salvar o tipo de serviço.');
|
||||
|
|
@ -210,12 +303,17 @@ export default function TServicoTipoForm({
|
|||
}
|
||||
};
|
||||
|
||||
// Carrega dados ao abrir o modal
|
||||
// Carrega os dados apenas quando o modal
|
||||
// abrir e houver um registro para editar
|
||||
useEffect(() => {
|
||||
// Remove as etiquetas selecionadas
|
||||
setItensTabela([]);
|
||||
|
||||
if (isOpen && data && Number(data.servico_tipo_id ?? 0) > 0) {
|
||||
form.reset(data);
|
||||
/** Carrega os dados no formulário */
|
||||
form.reset(data); // edição
|
||||
} else if (isOpen && !data) {
|
||||
/** Reseta os campos do formulário */
|
||||
form.reset({
|
||||
servico_tipo_id: 0,
|
||||
emolumento_id: 0,
|
||||
|
|
@ -223,13 +321,13 @@ export default function TServicoTipoForm({
|
|||
descricao: '',
|
||||
maximo_pessoa: 0,
|
||||
tipo_item: '',
|
||||
frenteverso: ConfirmacaoEnum.N,
|
||||
averbacao: ConfirmacaoEnum.N,
|
||||
transferencia_veiculo: ConfirmacaoEnum.N,
|
||||
usar_a4: ConfirmacaoEnum.N,
|
||||
etiqueta_unica: ConfirmacaoEnum.N,
|
||||
situacao: SituacoesEnum.A,
|
||||
selar: ConfirmacaoEnum.N,
|
||||
frenteverso: 'N',
|
||||
averbacao: 'N',
|
||||
transferencia_veiculo: 'N',
|
||||
usar_a4: 'N',
|
||||
etiqueta_unica: 'N',
|
||||
situacao: 'A',
|
||||
selar: 'N',
|
||||
valor_emolumento: 0,
|
||||
valor_taxa_judiciaria: 0,
|
||||
fundesp_valor: 0,
|
||||
|
|
@ -402,10 +500,8 @@ export default function TServicoTipoForm({
|
|||
<FormControl>
|
||||
<Checkbox
|
||||
className="cursor-pointer"
|
||||
checked={field.value === ConfirmacaoEnum.S}
|
||||
onCheckedChange={(checked) =>
|
||||
field.onChange(checked ? ConfirmacaoEnum.S : ConfirmacaoEnum.N)
|
||||
}
|
||||
checked={field.value === 'S'} // marca quando o valor for "S"
|
||||
onCheckedChange={(checked) => field.onChange(checked ? 'S' : 'N')} // grava "S" ou "N"
|
||||
disabled={!isEnabled}
|
||||
/>
|
||||
</FormControl>
|
||||
|
|
@ -424,7 +520,9 @@ export default function TServicoTipoForm({
|
|||
control={form.control}
|
||||
name="situacao"
|
||||
render={({ field }) => {
|
||||
const isChecked = field.value === SituacoesEnum.A || !field.value;
|
||||
// Considera "A" ou vazio como marcado
|
||||
const isChecked = field.value === 'A' || !field.value;
|
||||
|
||||
return (
|
||||
<FormItem className="flex flex-row items-center space-y-0 space-x-3">
|
||||
<FormControl>
|
||||
|
|
@ -432,7 +530,7 @@ export default function TServicoTipoForm({
|
|||
className="cursor-pointer"
|
||||
checked={isChecked}
|
||||
onCheckedChange={(checked) => {
|
||||
field.onChange(checked ? SituacoesEnum.A : SituacoesEnum.I);
|
||||
field.onChange(checked ? 'A' : 'I'); // grava "A" ou "I" no form
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
|
|
@ -508,9 +606,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Biometria</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -525,9 +633,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>CPF/CNPJ</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -542,9 +660,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Autorização</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -559,9 +687,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Abonador</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -625,7 +763,7 @@ export default function TServicoTipoForm({
|
|||
variant="outline"
|
||||
className="w-full cursor-pointer"
|
||||
type="button"
|
||||
onClick={() => handleRemoveItem(Number(item.servico_etiqueta_id))}
|
||||
onClick={() => handleRemoveItem(item.servico_etiqueta_id)}
|
||||
>
|
||||
<Trash /> Remover
|
||||
</Button>
|
||||
|
|
@ -655,9 +793,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Selar</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
'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 TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface'; // Import alterado
|
||||
|
||||
// Tipagem das props do componente da tabela
|
||||
interface TServicoTipoTableProps {
|
||||
// Nome da interface alterado
|
||||
data: TServicoTipoInterface[]; // lista de tipos de serviço
|
||||
onEdit: (item: TServicoTipoInterface, isEditingFormStatus: boolean) => void; // callback para edição
|
||||
onDelete: (item: TServicoTipoInterface, isEditingFormStatus: boolean) => void; // callback para exclusão
|
||||
}
|
||||
|
||||
/**
|
||||
* Componente principal da tabela de Tipos de Serviço
|
||||
*/
|
||||
export default function TServicoTipoTable({ data, onEdit, onDelete }: TServicoTipoTableProps) {
|
||||
return (
|
||||
<Table className="w-full table-fixed">
|
||||
{/* Cabeçalho da tabela */}
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead className="w-15 font-bold">#</TableHead>
|
||||
{/* As colunas IBGE e UF foram removidas */}
|
||||
<TableHead className="font-bold">Descrição</TableHead>
|
||||
<TableHead className="text-right"></TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
|
||||
{/* Corpo da tabela */}
|
||||
<TableBody>
|
||||
{data.map((item) => (
|
||||
// Assumindo que o ID do Tipo de Serviço é 'servico_tipo_id'
|
||||
<TableRow key={item.servico_tipo_id} className="cursor-pointer">
|
||||
{/* ID do Tipo de Serviço */}
|
||||
<TableCell>{item.servico_tipo_id}</TableCell>
|
||||
|
||||
{/* Nome/descrição do Tipo de Serviço (descricao) */}
|
||||
<TableCell>{item.descricao}</TableCell>
|
||||
{/* As células de IBGE e UF foram removidas */}
|
||||
|
||||
{/* Ações (menu dropdown) */}
|
||||
<TableCell className="text-right">
|
||||
<DropdownMenu>
|
||||
{/* Botão de disparo do menu */}
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="outline" size="icon" className="cursor-pointer">
|
||||
<EllipsisIcon />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
{/* Conteúdo do menu */}
|
||||
<DropdownMenuContent side="left" align="start">
|
||||
<DropdownMenuGroup>
|
||||
{/* Opção editar */}
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onEdit(item, true)}
|
||||
>
|
||||
<PencilIcon className="mr-2 h-4 w-4" />
|
||||
Editar
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
{/* Opção remover */}
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
|
@ -6,8 +6,7 @@ import API from '@/shared/services/api/Api';
|
|||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
import { CCaixaServicoReadInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoReadInterface';
|
||||
import { CCaixaServicoReadInterface } from '../../_interfaces/CCaixaServicoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeCCaixaServicoIndexData(data: CCaixaServicoReadInterface) {
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
// Importa o utilitário responsável por tratar erros de forma padronizada no cliente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a classe de serviço que gerencia requisições HTTP para a API
|
||||
import API from '@/shared/services/api/Api';
|
||||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { GEmolumentoReadInterface } from '../../_interfaces/GEmolumentoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeGEmolumentoIndexData(data: GEmolumentoReadInterface) {
|
||||
// Cria uma nova instância da classe API para enviar a requisição
|
||||
const api = new API();
|
||||
|
||||
// Concatena o endpoint com a query string (caso existam parâmetros)
|
||||
const endpoint = `administrativo/g_emolumento/${data.sistema_id}`;
|
||||
|
||||
// Envia uma requisição GET para o endpoint 'administrativo/g_marcacao_tipo/'
|
||||
return await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: endpoint,
|
||||
});
|
||||
}
|
||||
|
||||
// Exporta a função encapsulada pelo handler de erro, garantindo tratamento uniforme em caso de falhas
|
||||
export const GEmolumentoIndexData = withClientErrorHandler(executeGEmolumentoIndexData);
|
||||
|
|
@ -6,8 +6,7 @@ import API from '@/shared/services/api/Api';
|
|||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
import { GEmolumentoItemReadInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemReadInterface';
|
||||
import { GEmolumentoItemReadInterface } from '../../_interfaces/GEmolumentoItemReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeGEmolumentoItemValorData(data: GEmolumentoItemReadInterface) {
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
// Importa o utilitário responsável por tratar erros de forma padronizada no cliente
|
||||
import { buildQueryString } from '@/shared/actions/api/buildQueryString';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a classe de serviço que gerencia requisições HTTP para a API
|
||||
|
|
@ -7,10 +6,10 @@ import API from '@/shared/services/api/Api';
|
|||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
import { GMarcacaoTipoReadInterface } from '@/packages/administrativo/interfaces/GMarcacaoTipo/GMarcacaoTipoReadInterface';
|
||||
import { GMarcacaoTipoReadInterface } from '../../_interfaces/GMarcacaoTipoReadInterface';
|
||||
|
||||
// Importa a função genérica que monta a query string dinamicamente
|
||||
import { buildQueryString } from '@/shared/actions/api/buildQueryString';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeGMarcacaoTipoIndexData(data: GMarcacaoTipoReadInterface) {
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de localizar um tipo de serviço
|
||||
async function executeTServicoEtiquetaService(data: TServicoEtiquetaInterface) {
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface'; // Alterado de GCidadeInterface
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface'; // Alterado de GCidadeInterface
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de remover um tipo de serviço
|
||||
async function executeTServicoEtiquetaRemoveData(data: TServicoEtiquetaInterface) {
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o esquema de validação de dados para tipos de serviço
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
import { TServicoEtiquetaFormValues } from '@/packages/administrativo/schemas/TServicoEtiqueta/TServicoEtiquetaSchema';
|
||||
import { TServicoEtiquetaFormValues } from '../../_schemas/TServicoEtiquetaSchema';
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface'; // Interface alterada
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de salvar (criar/atualizar) um tipo de serviço
|
||||
async function executeTServicoEtiquetaSaveData(data: TServicoEtiquetaFormValues) {
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface'; // Alterado de GCidadeInterface
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface'; // Alterado de GCidadeInterface
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de localizar um tipo de serviço
|
||||
async function executeTServicoTipoEditService(data: TServicoTipoInterface) {
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de buscar todos os tipos de serviço (GET)
|
||||
async function executeTServicoTipoIndexData() {
|
||||
// Instancia o cliente da API para enviar a requisição
|
||||
const api = new API(); //
|
||||
|
||||
// Executa a requisição para a API com o método apropriado e o endpoint da tabela t_servico_tipo
|
||||
return await api.send({
|
||||
method: Methods.GET, // GET listar todos os itens
|
||||
endpoint: `administrativo/t_servico_tipo/`, // Endpoint atualizado
|
||||
});
|
||||
}
|
||||
|
||||
// Exporta a função de listar tipos de serviço já encapsulada com tratamento de erros
|
||||
export const TServicoTipoIndexData = withClientErrorHandler(executeTServicoTipoIndexData);
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface'; // Alterado de GCidadeInterface
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface'; // Alterado de GCidadeInterface
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de remover um tipo de serviço
|
||||
async function executeTServicoTipoRemoveData(data: TServicoTipoInterface) {
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o esquema de validação de dados para tipos de serviço
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
import { TServicoTipoFormValues } from '@/packages/administrativo/schemas/TServicoTipo/TServicoTipoSchema';
|
||||
import { TServicoTipoFormValues } from '../../_schemas/TServicoTipoSchema';
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface'; // Interface alterada
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de salvar (criar/atualizar) um tipo de serviço
|
||||
async function executeTServicoTipoSaveData(
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Importa o utilitário responsável por tratar erros de forma padronizada no cliente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a classe de serviço que gerencia requisições HTTP para a API
|
||||
import API from '@/shared/services/api/Api';
|
||||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { TTBReconhecimentoTipoReadInterface } from '../../_interfaces/TTBReconhecimentoTipoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeTTBReconhecimentoTipoIndexData(data: TTBReconhecimentoTipoReadInterface) {
|
||||
// Cria uma nova instância da classe API para enviar a requisição
|
||||
const api = new API();
|
||||
|
||||
// Concatena o endpoint com a query string (caso existam parâmetros)
|
||||
const endpoint = `administrativo/t_tb_reconhecimentotipo/`;
|
||||
|
||||
// Envia uma requisição GET para o endpoint 'administrativo/g_marcacao_tipo/'
|
||||
return await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: endpoint,
|
||||
});
|
||||
}
|
||||
|
||||
// Exporta a função encapsulada pelo handler de erro, garantindo tratamento uniforme em caso de falhas
|
||||
export const TTBReconhecimentoTipoIndexData = withClientErrorHandler(
|
||||
executeTTBReconhecimentoTipoIndexData,
|
||||
);
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "CCaixaServico"
|
||||
import { CCaixaServicoInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoInterface';
|
||||
import { CCaixaServicoReadInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoReadInterface';
|
||||
import { CCaixaServicoReadInterface } from '../../_interfaces/CCaixaServicoReadInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "CCaixaServico" na API
|
||||
import { CCaixaServicoIndexService } from '@/packages/administrativo/services/CCaixaServico/CCaixaServicoIndexService';
|
||||
import { CCaixaServicoIndexService } from '../../_services/c_caixa_servico/CCaixaServicoIndexService';
|
||||
import { CCaixaServicoInterface } from '../../_interfaces/CCaixaServicoInterface';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
||||
export const useCCaixaServicoReadHook = () => {
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "GEmolumento"
|
||||
import { GEmolumentoReadInterface } from '../../_interfaces/GEmolumentoReadInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "GEmolumento" na API
|
||||
import { GEmolumentoIndexService } from '../../_services/g_emolumento/GEmolumentoIndexService';
|
||||
import { GEmolumentoInterface } from '../../_interfaces/GEmolumentoInterface';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos emolumentos
|
||||
export const useGEmolumentoReadHook = () => {
|
||||
// Obtém a função que atualiza a resposta global do sistema
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
// Define o estado local que armazenará a lista de emolumentos
|
||||
const [gEmolumento, setGEmolumento] = useState<GEmolumentoInterface[]>([]);
|
||||
|
||||
// Função responsável por buscar os dados da API e atualizar o estado
|
||||
const fetchGEmolumento = async (data: GEmolumentoReadInterface) => {
|
||||
// Executa o serviço que faz a requisição à API
|
||||
const response = await GEmolumentoIndexService(data);
|
||||
|
||||
// Atualiza o estado local com os dados retornados
|
||||
setGEmolumento(response.data);
|
||||
|
||||
// Atualiza o contexto global de resposta (ex: para exibir alertas ou mensagens)
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
// Retorna os dados e a função de busca, memorizando o valor para evitar recriações desnecessárias
|
||||
return useMemo(() => ({ gEmolumento, fetchGEmolumento }), [gEmolumento, fetchGEmolumento]);
|
||||
};
|
||||
|
|
@ -1,10 +1,15 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import GEmolumentoItemInterface from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemInterface';
|
||||
import { GEmolumentoItemReadInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemReadInterface';
|
||||
import { GEmolumentoItemValorService } from '@/packages/administrativo/services/GEmolumentoItem/GEmolumentoItemValorService';
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
// Importa a interface que define a estrutura dos dados de "gEmolumentoItem"
|
||||
import { GEmolumentoItemReadInterface } from '../../_interfaces/GEmolumentoItemReadInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "GEmolumentoItem" na API
|
||||
import { GEmolumentoItemValorService } from '../../_services/g_emolumento_item/GEmolumentoItemValorService';
|
||||
import { GEmolumentoItemInterface } from '../../_interfaces/GEmolumentoItemInterface';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos emolumentos
|
||||
export const useGEmolumentoItemReadHook = () => {
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "GMarcacaoTipo"
|
||||
import { GMarcacaoTipoInterface } from '@/packages/administrativo/interfaces/GMarcacaoTipo/GMarcacaoTipoInterface';
|
||||
import { GMarcacaoTipoReadInterface } from '@/packages/administrativo/interfaces/GMarcacaoTipo/GMarcacaoTipoReadInterface';
|
||||
import { GMarcacaoTipoReadInterface } from '../../_interfaces/GMarcacaoTipoReadInterface';
|
||||
import { GMarcacaoTipoInterface } from '../../_interfaces/GMarcacaoTipoInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "GMarcacaoTipo" na API
|
||||
import { GMarcacaoTipoIndexService } from '@/packages/administrativo/services/GMarcacaoTipo/GMarcacaoTipoIndexService';
|
||||
import { GMarcacaoTipoIndexService } from '../../_services/g_marcacao_tipo/GMarcacaoTipoIndexService';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
||||
export const useGMarcacaoTipoReadHook = () => {
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "TServicoEtiqueta"
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "TServicoEtiqueta" na API
|
||||
import { TServicoEtiquetaServicoIdService } from '@/packages/administrativo/services/TServicoEtiqueta/TServicoEtiquetaServicoIdService';
|
||||
import { TServicoEtiquetaServicoIdService } from '../../_services/t_servico_etiqueta/TServicoEtiquetaServicoIdService';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
||||
export const useTServicoEtiquetaReadHook = () => {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { useResponse } from '@/shared/components/response/ResponseContext'; // Contexto global para gerenciar respostas da API
|
||||
|
||||
// Interface tipada do tipo de serviço
|
||||
import { TServicoEtiquetaRemoveData } from '@/packages/administrativo/data/TServicoEtiqueta/TServicoEtiquetaRemoveData';
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Função que remove o tipo de serviço via API
|
||||
import { TServicoEtiquetaRemoveData } from '../../_data/TServicoEtiqueta/TServicoEtiquetaRemoveData';
|
||||
|
||||
// Hook customizado para remoção de tipos de serviço
|
||||
export const useTServicoEtiquetaRemoveHook = () => {
|
||||
|
|
@ -1,12 +1,11 @@
|
|||
import { useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Interface tipada do serviço etiqueta
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Serviço que salva os dados do serviço etiqueta
|
||||
import { TServicoEtiquetaSaveService } from '@/packages/administrativo/services/TServicoEtiqueta/TServicoEtiquetaSaveService';
|
||||
import { TServicoEtiquetaSaveService } from '../../_services/t_servico_etiqueta/TServicoEtiquetaSaveService';
|
||||
|
||||
export const useTServicoEtiquetaSaveHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { useResponse } from '@/shared/components/response/ResponseContext'; // Contexto global para gerenciar respostas da API
|
||||
|
||||
// Interface tipada do tipo de serviço
|
||||
import { TServicoTipoEditData } from '@/packages/administrativo/data/TServicoTipo/TServicoTipoEditData';
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
|
||||
// Função que Edit o tipo de serviço via API
|
||||
import { TServicoTipoEditData } from '../../_data/TServicoTipo/TServicoTipoEditData';
|
||||
|
||||
// Hook customizado para remoção de tipos de serviço
|
||||
export const useTServicoTipoEditHook = () => {
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
import { useResponse } from '@/shared/components/response/ResponseContext'; // Contexto global para gerenciar respostas da API
|
||||
import { useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext'; // Contexto global para gerenciar respostas da API
|
||||
|
||||
// Serviço que busca a lista de tipos de serviço (TServicoTipoIndexService)
|
||||
import TServicoTipoIndexInteface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoIndexInteface';
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
import { TServicoTipoIndexService } from '@/packages/administrativo/services/TServicoTipo/TServicoTipoIndexService';
|
||||
import { TServicoTipoIndexService } from '../../_services/t_servico_tipo/TServicoTipoIndexService';
|
||||
|
||||
// Interface tipada do tipo de serviço
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
|
||||
// Hook customizado para leitura de dados de tipos de serviço
|
||||
export const useTServicoTipoReadHook = () => {
|
||||
|
|
@ -18,9 +16,9 @@ export const useTServicoTipoReadHook = () => {
|
|||
const [tServicoTipo, setTServicoTipo] = useState<TServicoTipoInterface[]>([]);
|
||||
|
||||
// Função assíncrona que busca os dados dos tipos de serviço
|
||||
const fetchTServicoTipo = async (data?: TServicoTipoIndexInteface) => {
|
||||
const fetchTServicoTipo = async () => {
|
||||
// Chama o serviço responsável por consultar a API
|
||||
const response = await TServicoTipoIndexService(data);
|
||||
const response = await TServicoTipoIndexService();
|
||||
|
||||
// Atualiza o estado local com os dados retornados
|
||||
setTServicoTipo(response.data);
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { useResponse } from '@/shared/components/response/ResponseContext'; // Contexto global para gerenciar respostas da API
|
||||
|
||||
// Interface tipada do tipo de serviço
|
||||
import { TServicoTipoRemoveData } from '@/packages/administrativo/data/TServicoTipo/TServicoTipoRemoveData';
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
|
||||
// Função que remove o tipo de serviço via API
|
||||
import { TServicoTipoRemoveData } from '../../_data/TServicoTipo/TServicoTipoRemoveData';
|
||||
|
||||
// Hook customizado para remoção de tipos de serviço
|
||||
export const useTServicoTipoRemoveHook = () => {
|
||||
|
|
@ -1,12 +1,11 @@
|
|||
import { useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Interface tipada do tipo de serviço
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
|
||||
// Serviço que salva os dados do tipo de serviço
|
||||
import { TServicoTipoSaveService } from '@/packages/administrativo/services/TServicoTipo/TServicoTipoSaveService';
|
||||
import { TServicoTipoSaveService } from '../../_services/t_servico_tipo/TServicoTipoSaveService';
|
||||
|
||||
export const useTServicoTipoSaveHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "TTBReconhecimentoTipo"
|
||||
import { TTBReconhecimentoTipoReadInterface } from '../../_interfaces/TTBReconhecimentoTipoReadInterface';
|
||||
import { TTBReconhecimentoTipoInterface } from '../../_interfaces/TTBReconhecimentoTipoInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "TTBReconhecimentoTipo" na API
|
||||
import { TTBReconhecimentoTipoIndexService } from '../../_services/t_tb_reconhecimentotipo/TTBReconhecimentoTipoIndexService';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
||||
export const useTTBReconhecimentoTipoReadHook = () => {
|
||||
// Obtém a função que atualiza a resposta global do sistema
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
// Define o estado local que armazenará a lista de tipos de marcação
|
||||
const [tTBReconhecimentoTipo, setTTBReconhecimentoTipo] = useState<
|
||||
TTBReconhecimentoTipoInterface[]
|
||||
>([]);
|
||||
|
||||
// Função responsável por buscar os dados da API e atualizar o estado
|
||||
const fetchTTBReconhecimentoTipo = async (data: TTBReconhecimentoTipoReadInterface) => {
|
||||
// Executa o serviço que faz a requisição à API
|
||||
const response = await TTBReconhecimentoTipoIndexService(data);
|
||||
|
||||
// Atualiza o estado local com os dados retornados
|
||||
setTTBReconhecimentoTipo(response.data);
|
||||
|
||||
// Atualiza o contexto global de resposta (ex: para exibir alertas ou mensagens)
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
// Retorna os dados e a função de busca, memorizando o valor para evitar recriações desnecessárias
|
||||
return useMemo(
|
||||
() => ({ tTBReconhecimentoTipo, fetchTTBReconhecimentoTipo }),
|
||||
[tTBReconhecimentoTipo, fetchTTBReconhecimentoTipo],
|
||||
);
|
||||
};
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
// Interface que representa a tabela G_EMOLUMENTO
|
||||
export default interface GEmolumentoInterface {
|
||||
export interface GEmolumentoInterface {
|
||||
emolumento_id?: number; // NUMERIC(10,2) - Chave primária
|
||||
descricao?: string; // VARCHAR(260)
|
||||
tipo?: string; // VARCHAR(1)
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// Interface que representa a tabela G_EMOLUMENTO_ITEM (inferido)
|
||||
export interface GEmolumentoItemInterface {
|
||||
valor_emolumento?: number; // NUMERIC(14,3)
|
||||
emolumento_item_id: number; // NUMERIC(10,2) NOT NULL - Chave primária (assumida)
|
||||
emolumento_id?: number; // NUMERIC(10,2)
|
||||
valor_inicio?: number; // NUMERIC(14,3)
|
||||
valor_fim?: number; // NUMERIC(14,3)
|
||||
valor_taxa_judiciaria?: number; // NUMERIC(14,3)
|
||||
emolumento_periodo_id?: number; // NUMERIC(10,2)
|
||||
codigo?: number; // NUMERIC(10,2)
|
||||
pagina_extra?: number; // NUMERIC(10,2)
|
||||
valor_pagina_extra?: number; // NUMERIC(14,3)
|
||||
valor_outra_taxa1?: number; // NUMERIC(14,3)
|
||||
codigo_selo?: string; // VARCHAR(30)
|
||||
valor_fundo_ri?: number; // NUMERIC(14,3)
|
||||
codigo_tabela?: string; // VARCHAR(30)
|
||||
selo_grupo_id?: number; // NUMERIC(10,2)
|
||||
codigo_km?: string; // VARCHAR(30)
|
||||
emolumento_acresce?: number; // NUMERIC(14,3)
|
||||
taxa_acresce?: number; // NUMERIC(14,3)
|
||||
funcivil_acresce?: number; // NUMERIC(14,3)
|
||||
valor_fracao?: number; // NUMERIC(14,3)
|
||||
valor_por_excedente_emol?: number; // NUMERIC(14,3)
|
||||
valor_por_excedente_tj?: number; // NUMERIC(14,3)
|
||||
valor_por_excedente_fundo?: number; // NUMERIC(14,3)
|
||||
valor_limite_excedente_emol?: number; // NUMERIC(14,3)
|
||||
valor_limite_excedente_tj?: number; // NUMERIC(14,3)
|
||||
valor_limite_excedente_fundo?: number; // NUMERIC(14,3)
|
||||
fundo_selo?: number; // NUMERIC(14,3)
|
||||
distribuicao?: number; // NUMERIC(14,3)
|
||||
vrc_ext?: number; // NUMERIC(10,2) - Renomeado de VRCEXT para vrc_ext (convenção)
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
export interface GEmolumentoReadInterface {
|
||||
sistema_id?: number;
|
||||
urlParams?: Record<string, string>;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
export default interface TServicoTipoInterface {
|
||||
servico_tipo_id?: number; // SERVICO_TIPO_ID NUMERIC(10,2) NOT NULL (PK)
|
||||
descricao: string; // DESCRICAO VARCHAR(60)
|
||||
valor?: number; // VALOR NUMERIC(14,3)
|
||||
requer_autorizacao?: string; // REQUER_AUTORIZACAO VARCHAR(1)
|
||||
requer_biometria?: string; // REQUER_BIOMETRIA VARCHAR(1)
|
||||
tipo_pessoa?: string; // TIPO_PESSOA VARCHAR(1)
|
||||
tb_reconhecimentotipo_id?: number; // TB_RECONHECIMENTOTIPO_ID NUMERIC(10,2) (FK)
|
||||
requer_abonador?: string; // REQUER_ABONADOR VARCHAR(1)
|
||||
situacao?: string; // SITUACAO VARCHAR(1)
|
||||
requer_cpf?: string; // REQUER_CPF VARCHAR(1)
|
||||
servico_padrao?: string; // SERVICO_PADRAO VARCHAR(1)
|
||||
maximo_pessoa?: number; // MAXIMO_PESSOA NUMERIC(10,2)
|
||||
alterar_valor?: string; // ALTERAR_VALOR VARCHAR(1)
|
||||
servico_caixa_id?: number; // SERVICO_CAIXA_ID NUMERIC(10,2)
|
||||
caixa_servico_id?: number; // LIBERAR_DESCONTO VARCHAR(1)
|
||||
valor_fixo?: string; // VALOR_FIXO VARCHAR(1)
|
||||
emolumento_id?: number; // EMOLUMENTO_ID NUMERIC(10,2) (FK)
|
||||
emolumento_obrigatorio?: number; // EMOLUMENTO_OBRIGATORIO NUMERIC(10,2) (FK)
|
||||
ato_praticado?: string; // ATO_PRATICADO VARCHAR(1)
|
||||
selar?: string; // SELAR VARCHAR(1)
|
||||
frenteverso?: string; // FRENTEVERSO VARCHAR(1)
|
||||
etiqueta_unica?: string; // ETIQUETA_UNICA VARCHAR(1)
|
||||
transferencia_veiculo?: string; // TRANSFERENCIA_VEICULO VARCHAR(1)
|
||||
usar_a4?: string; // USAR_A4 VARCHAR(1)
|
||||
averbacao?: string; // AVERBACAO VARCHAR(1)
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// Interface que representa a tabela T_TB_RECONHECIMENTOTIPO
|
||||
export interface TTbReconhecimentoTipoInterface {
|
||||
tb_reconhecimentotipo_id: number; // NUMERIC(10,2) NOT NULL - Chave primária
|
||||
descricao?: string; // VARCHAR(30)
|
||||
situacao?: string; // VARCHAR(1)
|
||||
}
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
export interface TTBReconhecimentoTipoReadInterface {
|
||||
tb_reconhecimentotipo_id?: number;
|
||||
descricao?: string;
|
||||
urlParams?: Record<string, string>;
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
import z from 'zod';
|
||||
|
||||
/**
|
||||
* Tipos utilitários para campos simples
|
||||
*/
|
||||
const SN = z.enum(['S', 'N']).default('N'); // Campos do tipo Sim/Não
|
||||
const AI = z.enum(['A', 'I']).default('A'); // Situação Ativo/Inativo
|
||||
const OneCharString = z.string().max(1, 'Deve ter no máximo 1 caractere').optional();
|
||||
const RequiredString = z.string().min(1, 'O campo é obrigatório');
|
||||
const OptionalNumber = z.number().optional();
|
||||
const RequiredNumber = z.number();
|
||||
|
||||
/**
|
||||
* Schema principal baseado na DDL e adaptado ao formulário React
|
||||
*/
|
||||
export const TServicoTipoSchema = z.object({
|
||||
// Identificador
|
||||
servico_tipo_id: RequiredNumber.describe('ID do Tipo de Serviço').optional(),
|
||||
|
||||
// Campos principais
|
||||
descricao: z.string().max(60, 'A descrição deve ter no máximo 60 caracteres').optional(),
|
||||
categoria: z.string().optional(),
|
||||
|
||||
// Controle de flags (S/N)
|
||||
frenteverso: SN.optional(),
|
||||
averbacao: SN.optional(),
|
||||
transferencia_veiculo: SN.optional(),
|
||||
usar_a4: SN.optional(),
|
||||
etiqueta_unica: SN.optional(),
|
||||
selar: SN.optional(),
|
||||
servico_padrao: SN.optional(),
|
||||
// lancar_taxa: SN.optional(),
|
||||
// lancar_fundesp: SN.optional(),
|
||||
// liberar_desconto: SN.optional(),
|
||||
// fundesp_automatica: SN.optional(),
|
||||
// lancar_valor_documento: SN.optional(),
|
||||
valor_fixo: SN.optional(),
|
||||
ato_praticado: SN.optional(),
|
||||
// apresentante_selo: SN.optional(),
|
||||
// renovacao_cartao: SN.optional(),
|
||||
|
||||
// Situação
|
||||
situacao: AI,
|
||||
|
||||
// Campos numéricos
|
||||
valor: OptionalNumber,
|
||||
maximo_pessoa: OptionalNumber,
|
||||
servico_caixa_id: OptionalNumber,
|
||||
emolumento_id: z.number().nullable(),
|
||||
emolumento_obrigatorio: z.number().nullable(),
|
||||
|
||||
// Relacionamentos e permissões
|
||||
tipo_item: OneCharString,
|
||||
requer_autorizacao: OneCharString,
|
||||
requer_biometria: OneCharString,
|
||||
tipo_pessoa: OneCharString,
|
||||
tb_reconhecimentotipo_id: OptionalNumber,
|
||||
// tipo_permissao_cpf: OneCharString,
|
||||
requer_abonador: OneCharString,
|
||||
// requer_representante: OneCharString,
|
||||
requer_cpf: OneCharString,
|
||||
// alterar_valor: OneCharString,
|
||||
// pagina_acrescida: OneCharString,
|
||||
|
||||
// Campos auxiliares usados apenas no formulário (não persistidos)
|
||||
valor_emolumento: z.number().optional(),
|
||||
valor_taxa_judiciaria: z.number().optional(),
|
||||
fundesp_valor: z.number().optional(),
|
||||
valor_total: z.number().optional(),
|
||||
etiquetas_carimbos: z.any().optional(),
|
||||
emolumento: z.any().optional(),
|
||||
emolumento_auxiliar: z.any().optional(),
|
||||
});
|
||||
|
||||
/**
|
||||
* Tipo inferido do schema — usado diretamente no useForm
|
||||
*/
|
||||
export type TServicoTipoFormValues = z.infer<typeof TServicoTipoSchema>;
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { CCaixaServicoIndexData } from '@/packages/administrativo/data/CCaixaServico/CCaixaServicoIndexData';
|
||||
import { CCaixaServicoReadInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoReadInterface';
|
||||
import { CCaixaServicoIndexData } from '../../_data/CCaixaServico/CCaixaServicoIndexData';
|
||||
import { CCaixaServicoReadInterface } from '../../_interfaces/CCaixaServicoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeCCaixaServicoIndexService(data: CCaixaServicoReadInterface) {
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
'use server';
|
||||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
import { GEmolumentoIndexData } from '@/packages/administrativo/data/GEmolumento/GEmolumentoIndexData';
|
||||
import { GEmolumentoReadInterface } from '@/packages/administrativo/interfaces/GEmolumento/GEmolumentoReadInterface';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { GEmolumentoIndexData } from '../../_data/GEmolumento/GEmolumentoIndexData';
|
||||
import { GEmolumentoReadInterface } from '../../_interfaces/GEmolumentoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeGEmolumentoIndexService(data?: GEmolumentoReadInterface) {
|
||||
async function executeGEmolumentoIndexService(data: GEmolumentoReadInterface) {
|
||||
// Chama a função que realiza a requisição à API e aguarda a resposta
|
||||
const response = await GEmolumentoIndexData(data);
|
||||
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { GEmolumentoItemValorData } from '@/packages/administrativo/data/GEmolumentoItem/GEmolumentoItemValorData';
|
||||
import { GEmolumentoItemReadInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemReadInterface';
|
||||
import { GEmolumentoItemValorData } from '../../_data/GEmolumentoItem/GEmolumentoItemValorData';
|
||||
import { GEmolumentoItemReadInterface } from '../../_interfaces/GEmolumentoItemReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeGEmolumentoItemValorService(data: GEmolumentoItemReadInterface) {
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { GMarcacaoTipoIndexData } from '@/packages/administrativo/data/GMarcacaoTipo/GMarcacaoTipoIndexData';
|
||||
import { GMarcacaoTipoReadInterface } from '@/packages/administrativo/interfaces/GMarcacaoTipo/GMarcacaoTipoReadInterface';
|
||||
import { GMarcacaoTipoIndexData } from '../../_data/GMarcacaoTipo/GMarcacaoTipoIndexData';
|
||||
import { GMarcacaoTipoReadInterface } from '../../_interfaces/GMarcacaoTipoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeGMarcacaoTipoIndexService(data: GMarcacaoTipoReadInterface) {
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Função que salva os dados do serviço etiqueta via API (ou mock)
|
||||
import { TServicoEtiquetaSaveData } from '@/packages/administrativo/data/TServicoEtiqueta/TServicoEtiquetaSaveData';
|
||||
import { TServicoEtiquetaSaveData } from '../../_data/TServicoEtiqueta/TServicoEtiquetaSaveData';
|
||||
|
||||
// Interface tipada do serviço etiqueta
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Função assíncrona que executa o salvamento de um serviço etiqueta
|
||||
async function executeTServicoEtiquetaSaveService(data: TServicoEtiquetaInterface) {
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
|
||||
import { TServicoEtiquetaReadData } from '@/packages/administrativo/data/TServicoEtiqueta/TServicoEtiquetaReadData';
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaReadData } from '../../_data/TServicoEtiqueta/TServicoEtiquetaReadData';
|
||||
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
// Interface tipada do tipo de serviço
|
||||
|
||||
// Função assíncrona que executa a consulta de um tipo de serviço etiqueta
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
|
||||
import { TServicoTipoEditData } from '@/packages/administrativo/data/TServicoTipo/TServicoTipoEditData';
|
||||
import { TServicoTipoEditData } from '../../_data/TServicoTipo/TServicoTipoEditData';
|
||||
// Função que remove os dados do tipo de serviço via API
|
||||
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
// Interface tipada do tipo de serviço
|
||||
|
||||
// Função assíncrona que executa a remoção de um tipo de serviço
|
||||
|
|
@ -1,16 +1,13 @@
|
|||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
|
||||
import { TServicoTipoIndexData } from '@/packages/administrativo/data/TServicoTipo/TServicoTipoIndexData';
|
||||
import TServicoTipoIndexInteface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoIndexInteface';
|
||||
import { TServicoTipoIndexData } from '../../_data/TServicoTipo/TServicoTipoIndexData';
|
||||
// Função que retorna os dados da lista de tipos de serviço (chamada à API ou mock)
|
||||
|
||||
// Função assíncrona que executa a chamada para buscar os dados dos tipos de serviço
|
||||
async function executeTServicoTipoIndexService(data?: TServicoTipoIndexInteface) {
|
||||
async function executeTServicoTipoIndexService() {
|
||||
// Chama a função que retorna os dados dos tipos de serviço
|
||||
const response = await TServicoTipoIndexData(data);
|
||||
const response = await TServicoTipoIndexData();
|
||||
|
||||
// Retorna a resposta para o chamador
|
||||
return response;
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
|
||||
import { TServicoTipoRemoveData } from '@/packages/administrativo/data/TServicoTipo/TServicoTipoRemoveData';
|
||||
import { TServicoTipoRemoveData } from '../../_data/TServicoTipo/TServicoTipoRemoveData';
|
||||
// Função que remove os dados do tipo de serviço via API
|
||||
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
// Interface tipada do tipo de serviço
|
||||
|
||||
// Função assíncrona que executa a remoção de um tipo de serviço
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Função que salva os dados do tipo de serviço via API (ou mock)
|
||||
import { TServicoTipoSaveData } from '@/packages/administrativo/data/TServicoTipo/TServicoTipoSaveData';
|
||||
import { TServicoTipoSaveData } from '../../_data/TServicoTipo/TServicoTipoSaveData';
|
||||
|
||||
// Interface tipada do tipo de serviço
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
|
||||
// Função assíncrona que executa o salvamento de um tipo de serviço
|
||||
async function executeTServicoTipoSaveService(data: TServicoTipoInterface) {
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { TTBReconhecimentoTipoIndexData } from '@/packages/administrativo/data/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndexData';
|
||||
import { TTBReconhecimentoTipoReadInterface } from '@/packages/administrativo/interfaces/TTBREconhecimentoTipo/TTBReconhecimentoTipoReadInterface';
|
||||
import { TTBReconhecimentoTipoIndexData } from '../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndexData';
|
||||
import { TTBReconhecimentoTipoReadInterface } from '../../_interfaces/TTBReconhecimentoTipoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeTTBReconhecimentoTipoIndexService(data?: TTBReconhecimentoTipoReadInterface) {
|
||||
async function executeTTBReconhecimentoTipoIndexService(data: TTBReconhecimentoTipoReadInterface) {
|
||||
// Chama a função que realiza a requisição à API e aguarda a resposta
|
||||
const response = await TTBReconhecimentoTipoIndexData(data);
|
||||
|
||||
|
|
@ -2,8 +2,8 @@ import type { Metadata } from 'next';
|
|||
import { Geist, Geist_Mono } from 'next/font/google';
|
||||
import '../globals.css';
|
||||
|
||||
import { ResponseProvider } from '../../shared/components/response/ResponseContext';
|
||||
import { AppSidebar } from '@/components/app-sidebar';
|
||||
import { ThemeProvider } from '@/components/theme-provider';
|
||||
import {
|
||||
Breadcrumb,
|
||||
BreadcrumbItem,
|
||||
|
|
@ -15,9 +15,7 @@ import {
|
|||
import { Separator } from '@/components/ui/separator';
|
||||
import { SidebarInset, SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
|
||||
import { Toaster } from '@/components/ui/sonner';
|
||||
|
||||
import Response from '../../shared/components/response/response';
|
||||
import { ResponseProvider } from '../../shared/components/response/ResponseContext';
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: '--font-geist-sans',
|
||||
|
|
@ -37,46 +35,46 @@ export const metadata: Metadata = {
|
|||
},
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<html lang="en">
|
||||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
|
||||
<ThemeProvider>
|
||||
<SidebarProvider>
|
||||
<AppSidebar />
|
||||
|
||||
<SidebarInset>
|
||||
<header className="mb-4 flex h-16 shrink-0 items-center gap-2 border-b-1 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12">
|
||||
<div className="flex items-center gap-2 px-4">
|
||||
<SidebarTrigger className="-ml-1" />
|
||||
<Separator
|
||||
orientation="vertical"
|
||||
className="mr-2 data-[orientation=vertical]:h-4"
|
||||
/>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbList>
|
||||
<BreadcrumbItem className="hidden md:block">
|
||||
<BreadcrumbLink href="#">Building Your Application</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator className="hidden md:block" />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>Data Fetching</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
</BreadcrumbList>
|
||||
</Breadcrumb>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<ResponseProvider>
|
||||
<div className="flex flex-1 flex-col gap-4 p-4 pt-0">
|
||||
{children}
|
||||
<Toaster richColors position="top-center" />
|
||||
<Response />
|
||||
</div>
|
||||
</ResponseProvider>
|
||||
</SidebarInset>
|
||||
</SidebarProvider>
|
||||
</ThemeProvider>
|
||||
<SidebarProvider>
|
||||
<AppSidebar />
|
||||
<SidebarInset>
|
||||
<header className="mb-4 flex h-16 shrink-0 items-center gap-2 border-b-1 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12">
|
||||
<div className="flex items-center gap-2 px-4">
|
||||
<SidebarTrigger className="-ml-1" />
|
||||
<Separator
|
||||
orientation="vertical"
|
||||
className="mr-2 data-[orientation=vertical]:h-4"
|
||||
/>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbList>
|
||||
<BreadcrumbItem className="hidden md:block">
|
||||
<BreadcrumbLink href="#">Building Your Application</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator className="hidden md:block" />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>Data Fetching</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
</BreadcrumbList>
|
||||
</Breadcrumb>
|
||||
</div>
|
||||
</header>
|
||||
<ResponseProvider>
|
||||
<div className="flex flex-1 flex-col gap-4 p-4 pt-0">
|
||||
{children}
|
||||
<Toaster richColors position="top-center" />
|
||||
<Response />
|
||||
</div>
|
||||
</ResponseProvider>
|
||||
</SidebarInset>
|
||||
</SidebarProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export default function Page() {
|
||||
const { userAuthenticated } = useGUsuarioGetJWTHook();
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
import TAtoForm from '@/packages/servicos/components/TAto/TAtoForm';
|
||||
|
||||
export default function TAtoFormPage() {
|
||||
return <TAtoForm />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TAtoIndex from '@/packages/servicos/components/TAto/TAtoIndex';
|
||||
|
||||
export default function TServicoAToPag() {
|
||||
return <TAtoIndex />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TServicoPedidoDashboard from '@/packages/servicos/components/TServicoPedido/TServicoPedidoDashboard';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoDashboard />;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import TServicoPedidoDetails from '@/packages/servicos/components/TServicoPedido/TServicoPedidoDetails';
|
||||
|
||||
export default function TServicoPedidoDetailsPage() {
|
||||
const params = useParams();
|
||||
|
||||
return <TServicoPedidoDetails servico_pedido_id={Number(params.servicoPedidoId)} />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TServicoPedidoIndex from '@/packages/servicos/components/TServicoPedido/TServicoPedidoIndex';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoIndex />;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import TServicoPedidoForm from '@/packages/servicos/components/TServicoPedido/TServicoPedidoForm';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
const params = useParams();
|
||||
|
||||
return <TServicoPedidoForm servico_pedido_id={Number(params.servicoPedidoId)} />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TServicoPedidoForm from '@/packages/servicos/components/TServicoPedido/TServicoPedidoForm';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoForm />;
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogCancel,
|
||||
|
|
@ -12,6 +11,7 @@ import {
|
|||
AlertDialogTitle,
|
||||
AlertDialogAction,
|
||||
} from '@/components/ui/alert-dialog';
|
||||
|
||||
import { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/ui/input-otp';
|
||||
|
||||
interface ConfirmExclusionProps {
|
||||
|
|
|
|||
|
|
@ -3,194 +3,60 @@
|
|||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
:root {
|
||||
--background: oklch(0.9911 0 0);
|
||||
--foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--popover: oklch(0.9881 0 0);
|
||||
--popover-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--primary: oklch(0.721 0.1873 47.564);
|
||||
--primary-foreground: oklch(1 0 0);
|
||||
--secondary: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary-foreground: oklch(1 0 0);
|
||||
--muted: oklch(0.97 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.9551 0 0);
|
||||
--accent-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--border: oklch(0.922 0 0);
|
||||
--input: oklch(0.922 0 0);
|
||||
--ring: oklch(0.708 0 0);
|
||||
--chart-1: oklch(0.81 0.1 252);
|
||||
--chart-2: oklch(0.62 0.19 260);
|
||||
--chart-3: oklch(0.55 0.22 263);
|
||||
--chart-4: oklch(0.49 0.22 264);
|
||||
--chart-5: oklch(0.42 0.18 266);
|
||||
--sidebar: oklch(1 0 0);
|
||||
--sidebar-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--sidebar-primary: oklch(0.2364 0.0083 240.2365);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.97 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--radius: 0.625rem;
|
||||
--shadow-x: 0;
|
||||
--shadow-y: 1px;
|
||||
--shadow-blur: 3px;
|
||||
--shadow-spread: 0px;
|
||||
--shadow-opacity: 0.1;
|
||||
--shadow-color: oklch(0 0 0);
|
||||
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
||||
--tracking-normal: 0em;
|
||||
--spacing: 0.25rem;
|
||||
--shadow-offset-x: 0;
|
||||
--shadow-offset-y: 1px;
|
||||
--letter-spacing: 0em;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.1934 0.0062 236.9149);
|
||||
--foreground: oklch(0.9881 0 0);
|
||||
--card: oklch(0.2364 0.0083 240.2365);
|
||||
--card-foreground: oklch(0.9881 0 0);
|
||||
--popover: oklch(0.2988 0.0123 222.4429);
|
||||
--popover-foreground: oklch(0.9881 0 0);
|
||||
--primary: oklch(0.721 0.1873 47.564);
|
||||
--primary-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary-foreground: oklch(1 0 0);
|
||||
--muted: oklch(0.269 0 0);
|
||||
--muted-foreground: oklch(0.708 0 0);
|
||||
--accent: oklch(0.2988 0.0123 222.4429);
|
||||
--accent-foreground: oklch(1 0 0);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--destructive-foreground: oklch(0.985 0 0);
|
||||
--border: oklch(0.275 0 0);
|
||||
--input: oklch(0.325 0 0);
|
||||
--ring: oklch(0.556 0 0);
|
||||
--chart-1: oklch(0.81 0.1 252);
|
||||
--chart-2: oklch(0.62 0.19 260);
|
||||
--chart-3: oklch(0.55 0.22 263);
|
||||
--chart-4: oklch(0.49 0.22 264);
|
||||
--chart-5: oklch(0.42 0.18 266);
|
||||
--sidebar: oklch(0.2364 0.0083 240.2365);
|
||||
--sidebar-foreground: oklch(0.9881 0 0);
|
||||
--sidebar-primary: oklch(0.488 0.243 264.376);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.269 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.985 0 0);
|
||||
--sidebar-border: oklch(0.275 0 0);
|
||||
--sidebar-ring: oklch(0.439 0 0);
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--radius: 0.625rem;
|
||||
--shadow-x: 0;
|
||||
--shadow-y: 1px;
|
||||
--shadow-blur: 3px;
|
||||
--shadow-spread: 0px;
|
||||
--shadow-opacity: 0.1;
|
||||
--shadow-color: oklch(0 0 0);
|
||||
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
||||
--shadow-offset-x: 0;
|
||||
--shadow-offset-y: 1px;
|
||||
--letter-spacing: 0em;
|
||||
--spacing: 0.25rem;
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--color-card: var(--card);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-destructive-foreground: var(--destructive-foreground);
|
||||
--color-border: var(--border);
|
||||
--color-input: var(--input);
|
||||
--color-ring: var(--ring);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--font-sans: Inter, sans-serif;
|
||||
--font-mono: JetBrains Mono, monospace;
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-ring: var(--ring);
|
||||
--color-input: var(--input);
|
||||
--color-border: var(--border);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-card: var(--card);
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
--radius-xl: calc(var(--radius) + 4px);
|
||||
|
||||
--shadow-2xs: var(--shadow-2xs);
|
||||
--shadow-xs: var(--shadow-xs);
|
||||
--shadow-sm: var(--shadow-sm);
|
||||
--shadow: var(--shadow);
|
||||
--shadow-md: var(--shadow-md);
|
||||
--shadow-lg: var(--shadow-lg);
|
||||
--shadow-xl: var(--shadow-xl);
|
||||
--shadow-2xl: var(--shadow-2xl);
|
||||
--radius: 0.625rem;
|
||||
--font-serif: Source Serif 4, serif;
|
||||
--radius: 0.375rem;
|
||||
--tracking-tighter: calc(var(--tracking-normal) - 0.05em);
|
||||
--tracking-tight: calc(var(--tracking-normal) - 0.025em);
|
||||
--tracking-wide: calc(var(--tracking-normal) + 0.025em);
|
||||
--tracking-wider: calc(var(--tracking-normal) + 0.05em);
|
||||
--tracking-widest: calc(var(--tracking-normal) + 0.1em);
|
||||
--tracking-normal: var(--tracking-normal);
|
||||
--shadow-2xl: var(--shadow-2xl);
|
||||
--shadow-xl: var(--shadow-xl);
|
||||
--shadow-lg: var(--shadow-lg);
|
||||
--shadow-md: var(--shadow-md);
|
||||
--shadow: var(--shadow);
|
||||
--shadow-sm: var(--shadow-sm);
|
||||
--shadow-xs: var(--shadow-xs);
|
||||
--shadow-2xs: var(--shadow-2xs);
|
||||
--spacing: var(--spacing);
|
||||
--letter-spacing: var(--letter-spacing);
|
||||
--shadow-offset-y: var(--shadow-offset-y);
|
||||
|
|
@ -199,6 +65,118 @@
|
|||
--shadow-blur: var(--shadow-blur);
|
||||
--shadow-opacity: var(--shadow-opacity);
|
||||
--color-shadow-color: var(--shadow-color);
|
||||
--color-destructive-foreground: var(--destructive-foreground);
|
||||
}
|
||||
|
||||
:root {
|
||||
--radius: 0.375rem;
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.2686 0 0);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.2686 0 0);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.2686 0 0);
|
||||
--primary: oklch(0.7686 0.1647 70.0804);
|
||||
--primary-foreground: oklch(0 0 0);
|
||||
--secondary: oklch(0.967 0.0029 264.5419);
|
||||
--secondary-foreground: oklch(0.4461 0.0263 256.8018);
|
||||
--muted: oklch(0.9846 0.0017 247.8389);
|
||||
--muted-foreground: oklch(0.551 0.0234 264.3637);
|
||||
--accent: oklch(0.9869 0.0214 95.2774);
|
||||
--accent-foreground: oklch(0.4732 0.1247 46.2007);
|
||||
--destructive: oklch(0.6368 0.2078 25.3313);
|
||||
--border: oklch(0.9276 0.0058 264.5313);
|
||||
--input: oklch(0.9276 0.0058 264.5313);
|
||||
--ring: oklch(0.7686 0.1647 70.0804);
|
||||
--chart-1: oklch(0.7686 0.1647 70.0804);
|
||||
--chart-2: oklch(0.6658 0.1574 58.3183);
|
||||
--chart-3: oklch(0.5553 0.1455 48.9975);
|
||||
--chart-4: oklch(0.4732 0.1247 46.2007);
|
||||
--chart-5: oklch(0.4137 0.1054 45.9038);
|
||||
--sidebar: oklch(0.9846 0.0017 247.8389);
|
||||
--sidebar-foreground: oklch(0.2686 0 0);
|
||||
--sidebar-primary: oklch(0.7686 0.1647 70.0804);
|
||||
--sidebar-primary-foreground: oklch(1 0 0);
|
||||
--sidebar-accent: oklch(0.9869 0.0214 95.2774);
|
||||
--sidebar-accent-foreground: oklch(0.4732 0.1247 46.2007);
|
||||
--sidebar-border: oklch(0.9276 0.0058 264.5313);
|
||||
--sidebar-ring: oklch(0.7686 0.1647 70.0804);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--font-sans: Inter, sans-serif;
|
||||
--font-serif: Source Serif 4, serif;
|
||||
--font-mono: JetBrains Mono, monospace;
|
||||
--shadow-color: hsl(0 0% 0%);
|
||||
--shadow-opacity: 0.1;
|
||||
--shadow-blur: 8px;
|
||||
--shadow-spread: -1px;
|
||||
--shadow-offset-x: 0px;
|
||||
--shadow-offset-y: 4px;
|
||||
--letter-spacing: 0em;
|
||||
--spacing: 0.25rem;
|
||||
--shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 2px 4px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 4px 6px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 8px 10px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);
|
||||
--tracking-normal: 0em;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.2046 0 0);
|
||||
--foreground: oklch(0.9219 0 0);
|
||||
--card: oklch(0.2686 0 0);
|
||||
--card-foreground: oklch(0.9219 0 0);
|
||||
--popover: oklch(0.2686 0 0);
|
||||
--popover-foreground: oklch(0.9219 0 0);
|
||||
--primary: oklch(0.7686 0.1647 70.0804);
|
||||
--primary-foreground: oklch(0 0 0);
|
||||
--secondary: oklch(0.2686 0 0);
|
||||
--secondary-foreground: oklch(0.9219 0 0);
|
||||
--muted: oklch(0.2686 0 0);
|
||||
--muted-foreground: oklch(0.7155 0 0);
|
||||
--accent: oklch(0.4732 0.1247 46.2007);
|
||||
--accent-foreground: oklch(0.9243 0.1151 95.7459);
|
||||
--destructive: oklch(0.6368 0.2078 25.3313);
|
||||
--border: oklch(0.3715 0 0);
|
||||
--input: oklch(0.3715 0 0);
|
||||
--ring: oklch(0.7686 0.1647 70.0804);
|
||||
--chart-1: oklch(0.8369 0.1644 84.4286);
|
||||
--chart-2: oklch(0.6658 0.1574 58.3183);
|
||||
--chart-3: oklch(0.4732 0.1247 46.2007);
|
||||
--chart-4: oklch(0.5553 0.1455 48.9975);
|
||||
--chart-5: oklch(0.4732 0.1247 46.2007);
|
||||
--sidebar: oklch(0.1684 0 0);
|
||||
--sidebar-foreground: oklch(0.9219 0 0);
|
||||
--sidebar-primary: oklch(0.7686 0.1647 70.0804);
|
||||
--sidebar-primary-foreground: oklch(1 0 0);
|
||||
--sidebar-accent: oklch(0.4732 0.1247 46.2007);
|
||||
--sidebar-accent-foreground: oklch(0.9243 0.1151 95.7459);
|
||||
--sidebar-border: oklch(0.3715 0 0);
|
||||
--sidebar-ring: oklch(0.7686 0.1647 70.0804);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--radius: 0.375rem;
|
||||
--font-sans: Inter, sans-serif;
|
||||
--font-serif: Source Serif 4, serif;
|
||||
--font-mono: JetBrains Mono, monospace;
|
||||
--shadow-color: hsl(0 0% 0%);
|
||||
--shadow-opacity: 0.1;
|
||||
--shadow-blur: 8px;
|
||||
--shadow-spread: -1px;
|
||||
--shadow-offset-x: 0px;
|
||||
--shadow-offset-y: 4px;
|
||||
--letter-spacing: 0em;
|
||||
--spacing: 0.25rem;
|
||||
--shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 2px 4px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 4px 6px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 8px 10px -2px hsl(0 0% 0% / 0.1);
|
||||
--shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Editor } from '@tinymce/tinymce-react';
|
||||
import React from 'react';
|
||||
import { Editor } from '@tinymce/tinymce-react';
|
||||
|
||||
// 1. Define as propriedades que nosso componente vai receber
|
||||
interface MainEditorProps {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Bot,
|
||||
Frame,
|
||||
GalleryVerticalEnd,
|
||||
House,
|
||||
HouseIcon,
|
||||
SquareMousePointer,
|
||||
SquareTerminal,
|
||||
UsersIcon,
|
||||
} from 'lucide-react';
|
||||
import Image from 'next/image';
|
||||
import * as React from 'react';
|
||||
|
||||
import { NavMain } from '@/components/nav-main';
|
||||
import { NavProjects } from '@/components/nav-projects';
|
||||
|
|
@ -25,7 +24,9 @@ import {
|
|||
SidebarMenuItem,
|
||||
SidebarRail,
|
||||
} from '@/components/ui/sidebar';
|
||||
|
||||
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
||||
import Image from 'next/image';
|
||||
|
||||
// This is sample data.
|
||||
const data = {
|
||||
|
|
@ -43,36 +44,12 @@ const data = {
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Servicos',
|
||||
url: '#',
|
||||
icon: SquareMousePointer,
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: 'Dashboard',
|
||||
url: '/servicos/dashboard/',
|
||||
},
|
||||
{
|
||||
title: 'Pedidos',
|
||||
url: '/servicos/pedidos/',
|
||||
},
|
||||
{
|
||||
title: 'Atos',
|
||||
url: '/servicos/atos/',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Pessoas',
|
||||
url: '#',
|
||||
icon: UsersIcon,
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: 'Dashboard',
|
||||
url: '/administrativo/pessoas/dashboard',
|
||||
},
|
||||
{
|
||||
title: 'Físicas',
|
||||
url: '/administrativo/pessoas/fisicas',
|
||||
|
|
@ -89,10 +66,6 @@ const data = {
|
|||
icon: HouseIcon,
|
||||
isActive: false,
|
||||
items: [
|
||||
{
|
||||
title: 'Dashboard',
|
||||
url: '/administrativo/imoveis/dashboard',
|
||||
},
|
||||
{
|
||||
title: 'Urbanos',
|
||||
url: '/administrativo/imoveis/urbanos',
|
||||
|
|
@ -173,41 +146,13 @@ const data = {
|
|||
url: '/administrativo/centrais/censec/naturezas-litigios',
|
||||
},
|
||||
{
|
||||
title: 'Tipos/Serviços',
|
||||
url: '/administrativo/tipos-servicos',
|
||||
title: 'Serviços/Tipos',
|
||||
url: '/cadastros/servicos-tipo/',
|
||||
},
|
||||
{
|
||||
title: 'Atos/Partes Tipos',
|
||||
url: '/administrativo/atos/partes-tipos',
|
||||
},
|
||||
{
|
||||
title: 'Valores de Serviços',
|
||||
url: '/administrativo/valores-de-servicos',
|
||||
},
|
||||
{
|
||||
title: 'Gramatica',
|
||||
url: '/administrativo/gramatica',
|
||||
},
|
||||
{
|
||||
title: 'Cartório',
|
||||
url: '/administrativo/cartorio',
|
||||
},
|
||||
{
|
||||
title: 'Financeiro/Periodo',
|
||||
url: '/administrativo/financeiro/periodos',
|
||||
},
|
||||
{
|
||||
title: 'Financeiro/Emolumentos',
|
||||
url: '/administrativo/financeiro/emolumentos',
|
||||
},
|
||||
{
|
||||
title: 'Selos/Grupos',
|
||||
url: '/administrativo/selos/grupos',
|
||||
},
|
||||
{
|
||||
title: 'Financeiro/Cálculo Rápido',
|
||||
url: '/administrativo/financeiro/calculo-rapido',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
'use client';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import Image from 'next/image';
|
||||
import { useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import z from 'zod';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { GUsuarioLoginSchema } from '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
|
||||
import z from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import GUsuarioLoginService from '@/packages/administrativo/services/GUsuario/GUsuarioLogin';
|
||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||
|
||||
import { Button } from './ui/button';
|
||||
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 '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
|
||||
|
||||
type FormValues = z.infer<typeof GUsuarioLoginSchema>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { ChevronsUpDown, LogOut, Moon, Sparkles, Sun } from 'lucide-react';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { ChevronsUpDown, LogOut, Sparkles } from 'lucide-react';
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
||||
import {
|
||||
DropdownMenu,
|
||||
|
|
@ -20,9 +17,11 @@ import {
|
|||
SidebarMenuItem,
|
||||
useSidebar,
|
||||
} from '@/components/ui/sidebar';
|
||||
import { useGUsuarioLogoutHook } from '@/packages/administrativo/hooks/GUsuario/useGUsuarioLogoutHook';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
|
||||
import GUsuarioAuthenticatedInterface from '@/shared/interfaces/GUsuarioAuthenticatedInterface';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useGUsuarioLogoutHook } from '@/packages/administrativo/hooks/GUsuario/useGUsuarioLogoutHook';
|
||||
import { use, useCallback, useState } from 'react';
|
||||
|
||||
export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
||||
// Hook para encerrar sessão
|
||||
|
|
@ -33,25 +32,18 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
|
||||
const { isMobile } = useSidebar();
|
||||
|
||||
// Tema (claro/escuro) - next-themes
|
||||
const { theme, setTheme } = useTheme();
|
||||
const isDark = theme === 'dark';
|
||||
|
||||
const handleConfirmOpen = useCallback(() => {
|
||||
// Manipulação de formulário de confirmação
|
||||
const handleConfirmOpen = useCallback(async () => {
|
||||
setIsConfirmOpen(true);
|
||||
}, []);
|
||||
|
||||
const handleLogoutConfirm = useCallback(() => {
|
||||
const handleLogoutConfirm = useCallback(async () => {
|
||||
logoutUsuario();
|
||||
}, [logoutUsuario]);
|
||||
|
||||
const handleLogoutCancel = useCallback(() => {
|
||||
setIsConfirmOpen(false);
|
||||
}, []);
|
||||
|
||||
const handleToggleTheme = useCallback(() => {
|
||||
setTheme(isDark ? 'light' : 'dark');
|
||||
}, [isDark, setTheme]);
|
||||
const handleLogoutCancel = useCallback(async () => {
|
||||
setIsConfirmOpen(false);
|
||||
}, []);
|
||||
|
||||
if (!user) {
|
||||
return 'Carregando...';
|
||||
|
|
@ -69,11 +61,13 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
>
|
||||
<Avatar className="h-8 w-8 rounded-lg">
|
||||
<AvatarImage src={user.sigla} alt={user.nome} />
|
||||
|
||||
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
|
||||
</Avatar>
|
||||
|
||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||
<span className="truncate font-medium">{user.nome}</span>
|
||||
|
||||
<span className="truncate text-xs">{user.email}</span>
|
||||
</div>
|
||||
|
||||
|
|
@ -91,11 +85,13 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
||||
<Avatar className="h-8 w-8 rounded-lg">
|
||||
<AvatarImage src={user.sigla} alt={user.nome} />
|
||||
|
||||
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
|
||||
</Avatar>
|
||||
|
||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||
<span className="truncate font-medium">{user.nome}</span>
|
||||
|
||||
<span className="truncate text-xs">{user.email}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -104,22 +100,16 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuGroup>
|
||||
{/* Alternância de tema */}
|
||||
<DropdownMenuItem className="cursor-pointer" onClick={handleToggleTheme}>
|
||||
{isDark ? <Sun className="mr-2 h-4 w-4" /> : <Moon className="mr-2 h-4 w-4" />}
|
||||
{isDark ? 'Modo claro' : 'Modo escuro'}
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuItem className="cursor-pointer">
|
||||
<Sparkles className="mr-2 h-4 w-4" />
|
||||
<Sparkles />
|
||||
Configurações
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem className="cursor-pointer" onClick={handleConfirmOpen}>
|
||||
<LogOut className="mr-2 h-4 w-4" />
|
||||
<DropdownMenuItem className="cursor-pointer" onClick={() => handleConfirmOpen()}>
|
||||
<LogOut />
|
||||
Log out
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
|
|
@ -132,11 +122,11 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
isOpen={isConfirmOpen}
|
||||
title="Log-out"
|
||||
description="Atenção"
|
||||
message="Deseja realmente encerrar a sessão? Dados não salvos serão perdidos."
|
||||
message={`Deseja realmente encerrar a sessão ? Dados não salvos serão perdidos`}
|
||||
confirmText="Sim, sair"
|
||||
cancelText="Cancelar"
|
||||
onConfirm={handleLogoutConfirm}
|
||||
onCancel={handleLogoutCancel}
|
||||
onConfirm={() => handleLogoutConfirm()}
|
||||
onCancel={() => handleLogoutCancel()}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { ChevronsUpDown, Plus } from 'lucide-react';
|
||||
import * as React from 'react';
|
||||
import { ChevronsUpDown, Plus } from 'lucide-react';
|
||||
|
||||
import {
|
||||
DropdownMenu,
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { ThemeProvider as NextThemesProvider } from 'next-themes';
|
||||
import * as React from 'react';
|
||||
|
||||
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<NextThemesProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
{children}
|
||||
</NextThemesProvider>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
'use client';
|
||||
|
||||
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
||||
import * as React from 'react';
|
||||
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
||||
|
||||
import { buttonVariants } from '@/components/ui/button';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { buttonVariants } from '@/components/ui/button';
|
||||
|
||||
function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
||||
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
||||
import * as React from 'react';
|
||||
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
import { Slot } from '@radix-ui/react-slot';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
import * as React from 'react';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
const badgeVariants = cva(
|
||||
'inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden',
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
|
||||
secondary:
|
||||
'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
|
||||
destructive:
|
||||
'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
||||
outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
function Badge({
|
||||
className,
|
||||
variant,
|
||||
asChild = false,
|
||||
...props
|
||||
}: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
||||
const Comp = asChild ? Slot : 'span';
|
||||
|
||||
return (
|
||||
<Comp data-slot="badge" className={cn(badgeVariants({ variant }), className)} {...props} />
|
||||
);
|
||||
}
|
||||
|
||||
export { Badge, badgeVariants };
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue