Compare commits
172 commits
homologaca
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b664221d5d | ||
|
|
c3511a7065 | ||
|
|
5ef46780a5 | ||
|
|
fd79837fdc | ||
|
|
b5ea5a75a8 | ||
|
|
4561194b6b | ||
|
|
c8863e573f | ||
|
|
fca1d0c293 | ||
|
|
32937c9501 | ||
|
|
790dbe2df3 | ||
|
|
4770c42596 | ||
|
|
aceb17b235 | ||
|
|
21d5d94197 | ||
|
|
8f9659ea5b | ||
|
|
e39970587b | ||
|
|
bcbcc8557b | ||
|
|
f6f4892d09 | ||
|
|
1e9627e924 | ||
|
|
f23decf071 | ||
|
|
43d0863342 | ||
|
|
e24a35709b | ||
|
|
3eb0bd6f0e | ||
|
|
c6217b0520 | ||
|
|
7a2305c918 | ||
|
|
26f0016813 | ||
|
|
0ec57bd6f8 | ||
|
|
50814c9b14 | ||
|
|
2f891ffc38 | ||
|
|
52d16a1548 | ||
|
|
26df474611 | ||
|
|
cdc5e953a5 | ||
|
|
f1abddb383 | ||
|
|
824ac5da24 | ||
|
|
386b8b0307 | ||
|
|
a400bd233e | ||
|
|
60dce3876a | ||
|
|
7745961ff6 | ||
|
|
69d34c713e | ||
|
|
91346bfb19 | ||
|
|
d2494f20b7 | ||
|
|
4ef0517cb7 | ||
|
|
714a0e1f97 | ||
|
|
df46a60b81 | ||
|
|
0dc065d9bb | ||
|
|
99791bd06f | ||
|
|
5f8d2cf670 | ||
|
|
369dfcdfc3 | ||
|
|
f4b0118b36 | ||
|
|
053b86ee69 | ||
|
|
f7b13648a1 | ||
|
|
744e51d215 | ||
|
|
41f31ed2f1 | ||
|
|
0e3cb35309 | ||
|
|
24e259fc16 | ||
|
|
6fc76254c0 | ||
|
|
1c4d52ebe9 | ||
|
|
6e4646c96b | ||
|
|
f09b152192 | ||
|
|
ff3ff6c2e0 | ||
|
|
dfee9eb752 | ||
|
|
e01fa690a3 | ||
|
|
f9df3cd8a3 | ||
|
|
e98a293286 | ||
|
|
4c16b19184 | ||
|
|
de3a022800 | ||
|
|
4da16c3fe2 | ||
|
|
d1732558ff | ||
|
|
58630f8602 | ||
|
|
6b6f2e4fc8 | ||
|
|
2d37d4d421 | ||
|
|
fdd4cf7cfc | ||
|
|
bc2c2ef3dd | ||
|
|
b2e0d50dd6 | ||
|
|
97c958cb00 | ||
|
|
6fe6c86b5d | ||
|
|
b85cd6aeb9 | ||
|
|
88cb6f67c8 | ||
|
|
790c79ede6 | ||
|
|
06d55ec125 | ||
| e50818e52a | |||
| 79f2092882 | |||
| 8d44686717 | |||
| 7162a20d1f | |||
| b362968a4f | |||
| 23604033fe | |||
| 4b7afd6a8f | |||
| feab092f6e | |||
| e39422776e | |||
| 8e035546e9 | |||
| 6051afc3e0 | |||
| 9b9f8b9454 | |||
| 2340cee82a | |||
| 0e21ebfe5b | |||
| 3faf0ebe5e | |||
| b9318f1059 | |||
| 64b897e7e9 | |||
| 77ea800aaa | |||
| 2810abecf5 | |||
| 325ca69317 | |||
| d5b8aad221 | |||
| d3d8ac4a28 | |||
| 8d5e786f74 | |||
| 5297d6ab2e | |||
| 56bca3ba41 | |||
| ab45ac32bf | |||
| 36cbd43ee4 | |||
| b48ffc4bd5 | |||
| 3bd3134d33 | |||
| aaaa04975e | |||
| 519dbf969a | |||
| 4559de0187 | |||
| 6c7967587a | |||
| 742c9bc38f | |||
| a26fc881b2 | |||
| d3f8bebe1d | |||
| 11578438bf | |||
| cbaf19af0b | |||
| ff28fe1f58 | |||
| 9e37520615 | |||
| 79370f83f1 | |||
| cb3f1ffcba | |||
| 37f0f8713d | |||
| 0d5ee71975 | |||
| 27d0b7e2de | |||
| 3b38337358 | |||
| 36dba45995 | |||
|
|
7db6d27035 | ||
| aa8553b3fe | |||
| 75086c6103 | |||
| 3e68efe7ec | |||
| 847a1f0758 | |||
| 67453f1f99 | |||
| ae382f5399 | |||
| 4b0c7e651d | |||
| f2b2181136 | |||
| 8cb0de2928 | |||
| 89d12b26b5 | |||
| 8d9eed3c48 | |||
|
|
32924cd8da | ||
|
|
46d51e3316 | ||
|
|
66f285ba74 | ||
| 3633628bc5 | |||
| 8c5b847d37 | |||
| b3dc6c87f2 | |||
| f5ffe5739c | |||
| f6faae900d | |||
| 7f9b7944db | |||
| eed113590c | |||
| 3aa4c73453 | |||
| 1fcc5e442d | |||
| 7af4c82dd1 | |||
| 4eabe19ee3 | |||
| 1f8892e639 | |||
| 6f07d8493c | |||
| 8579387c53 | |||
| b91ce54475 | |||
|
|
727e665db4 | ||
|
|
ce6f6e3c59 | ||
| fb35c19a84 | |||
| 175dff5ded | |||
| 426a74f6f6 | |||
| 9b34ef16ac | |||
|
|
3df00e38bc | ||
|
|
7fe725bdeb | ||
| b7f35889a6 | |||
| 3fe6ed8c08 | |||
| a045b3ca72 | |||
| 920b9d8aa6 | |||
| 2fd7af509f | |||
| f7ac0eb9df | |||
| 4ec2799fdc | |||
| af51c1b8d8 |
1100 changed files with 38766 additions and 5679 deletions
117
.code-workspace
Normal file
117
.code-workspace
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
"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",
|
||||
],
|
||||
},
|
||||
}
|
||||
9
.prettierrc
Normal file
9
.prettierrc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"semi": true,
|
||||
"trailingComma": "all",
|
||||
"singleQuote": true,
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"arrowParens": "always",
|
||||
"plugins": ["prettier-plugin-tailwindcss"]
|
||||
}
|
||||
65
Dockerfile
65
Dockerfile
|
|
@ -1,22 +1,59 @@
|
|||
# Use uma imagem Node.js completa para o desenvolvimento
|
||||
FROM node:20-alpine
|
||||
# ============================
|
||||
# STAGE 1 – Build
|
||||
# ============================
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
# Define o diretório de trabalho no container
|
||||
WORKDIR /app
|
||||
|
||||
# Copia os arquivos de configuração do projeto
|
||||
COPY package.json package-lock.json ./
|
||||
# Copia pacotes e instala dependências
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
# 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
|
||||
# Copia o restante do código
|
||||
COPY . .
|
||||
|
||||
# Expõe a porta de desenvolvimento padrão do Next.js
|
||||
# ---------- 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
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
# 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"]
|
||||
# ---------- Executa o servidor ----------
|
||||
CMD ["node", "server.js"]
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
# 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 +1,58 @@
|
|||
# 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,23 +0,0 @@
|
|||
import next from "eslint-config-next";
|
||||
import importPlugin from "eslint-plugin-import";
|
||||
|
||||
export default [
|
||||
next,
|
||||
{
|
||||
plugins: {
|
||||
import: importPlugin
|
||||
},
|
||||
rules: {
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
groups: ["builtin", "external", "internal", ["parent", "sibling", "index"]],
|
||||
"newlines-between": "always",
|
||||
alphabetize: { order: "asc", caseInsensitive: true }
|
||||
}
|
||||
],
|
||||
"semi": ["error", "always"],
|
||||
"quotes": ["error", "double"]
|
||||
}
|
||||
}
|
||||
];
|
||||
70
eslint.config.mjs
Normal file
70
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
import js from '@eslint/js';
|
||||
import reactPlugin from 'eslint-plugin-react';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
files: ['**/*.ts', '**/*.tsx'],
|
||||
ignores: ['node_modules/**', '.next/**', 'out/**', 'dist/**'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
globals: {
|
||||
React: true,
|
||||
JSX: true,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
react: reactPlugin,
|
||||
'react-hooks': reactHooks,
|
||||
'jsx-a11y': jsxA11y,
|
||||
import: importPlugin,
|
||||
},
|
||||
settings: {
|
||||
react: { version: 'detect' },
|
||||
'import/resolver': {
|
||||
typescript: {
|
||||
alwaysTryTypes: true,
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
node: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
},
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/jsx-uses-react': 'off',
|
||||
'react/jsx-uses-vars': 'warn',
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: [['builtin', 'external'], ['internal'], ['parent', 'sibling', 'index']],
|
||||
pathGroups: [
|
||||
{
|
||||
pattern: '@/**',
|
||||
group: 'internal',
|
||||
position: 'after',
|
||||
},
|
||||
],
|
||||
alphabetize: { order: 'asc', caseInsensitive: true },
|
||||
'newlines-between': 'always',
|
||||
},
|
||||
],
|
||||
'import/no-duplicates': 'error',
|
||||
'import/newline-after-import': ['error', { count: 1 }],
|
||||
'no-unused-vars': 'warn',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
@ -1,8 +1,17 @@
|
|||
import type { NextConfig } from "next";
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// Gera build autônomo para rodar com "node server.js"
|
||||
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 },
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// Isso gera um diretório otimizado que inclui tudo o que a aplicação precisa para rodar
|
||||
output: "standalone",
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
module.exports = nextConfig;
|
||||
|
|
|
|||
2893
package-lock.json
generated
2893
package-lock.json
generated
File diff suppressed because it is too large
Load diff
43
package.json
43
package.json
|
|
@ -4,14 +4,17 @@
|
|||
"version": "25.9.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"dev": "next dev",
|
||||
"dev:debug": "cross-env NEXT_USE_TURBOPACK=0 NODE_OPTIONS=\"--inspect=9230\" next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
"lint": "next lint",
|
||||
"postinstall": "shx mkdir -p public/libs && shx cp -r node_modules/tinymce public/libs/tinymce"
|
||||
},
|
||||
"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",
|
||||
|
|
@ -20,15 +23,25 @@
|
|||
"@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.7",
|
||||
"@radix-ui/react-slot": "^1.2.3",
|
||||
"@radix-ui/react-separator": "^1.1.8",
|
||||
"@radix-ui/react-slot": "^1.2.4",
|
||||
"@radix-ui/react-switch": "^1.2.6",
|
||||
"@radix-ui/react-tabs": "^1.1.13",
|
||||
"@radix-ui/react-tooltip": "^1.2.8",
|
||||
"@tanstack/react-table": "^8.21.3",
|
||||
"@tinymce/tinymce-react": "^6.3.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"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",
|
||||
"jwt-decode": "^4.0.0",
|
||||
|
|
@ -38,23 +51,39 @@
|
|||
"react": "19.1.0",
|
||||
"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",
|
||||
"zod": "^4.0.17"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.12.0",
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/date-fns": "^2.5.3",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/jsonwebtoken": "^9.0.10",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"eslint-config-next": "^15.5.4",
|
||||
"@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",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.0",
|
||||
"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"
|
||||
"typescript": "5.9.3",
|
||||
"typescript-eslint": "^8.46.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const config = {
|
||||
plugins: ["@tailwindcss/postcss"],
|
||||
plugins: ['@tailwindcss/postcss'],
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
|
|
|||
BIN
public/images/favicon.ico
Normal file
BIN
public/images/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
BIN
public/images/logo-abb.png
Normal file
BIN
public/images/logo-abb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
public/modelo.docx
Normal file
BIN
public/modelo.docx
Normal file
Binary file not shown.
BIN
public/sounds/success.mp3
Normal file
BIN
public/sounds/success.mp3
Normal file
Binary file not shown.
|
|
@ -1,7 +0,0 @@
|
|||
export default function empty(data: any) {
|
||||
if (!data || !data === null || !data === undefined) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useParams } from "next/navigation";
|
||||
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { useGUsuarioReadHooks } from "@/app/(protected)/(administrativo)/_hooks/g_usuario/useGUsuarioReadHooks";
|
||||
import Usuario from "@/app/(protected)/(administrativo)/_interfaces/GUsuarioInterface";
|
||||
import Loading from "@/app/_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);
|
||||
}
|
||||
console.log("pagina", usuario);
|
||||
}, []);
|
||||
|
||||
if (!usuario) return <Loading type={1} />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<div className="mb-4 grid gap-4 grid-cols-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>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
"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 "../../../_schemas/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 "../../../_hooks/g_usuario/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>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
|
||||
import Usuario from "../../_interfaces/GUsuarioInterface";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import Link from "next/link";
|
||||
import { useGUsuarioIndexHook } from "../../_hooks/g_usuario/useGUsuarioIndexHook";
|
||||
import { useEffect } from "react";
|
||||
import Loading from "@/app/_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="font-semibold text-xs">
|
||||
{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,15 +0,0 @@
|
|||
"use server";
|
||||
|
||||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
export default async function GUsuarioIndexData() {
|
||||
const api = new API();
|
||||
|
||||
const response = await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/g_usuario/`,
|
||||
});
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import Usuario from "../../_interfaces/GUsuarioInterface";
|
||||
import GUsuarioIndex from "../../_services/g_usuario/GUsuarioIndex";
|
||||
import { useResponse } from "@/app/_response/ResponseContext";
|
||||
|
||||
export const useGUsuarioIndexHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
const [usuarios, setUsuarios] = useState<Usuario[] | null>(null);
|
||||
|
||||
const fetchUsuarios = async () => {
|
||||
const response = await GUsuarioIndex();
|
||||
|
||||
setUsuarios(response.data);
|
||||
|
||||
// Define os dados do componente de resposta (toast, modal, etc)
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
return { usuarios, fetchUsuarios };
|
||||
};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import GUsuarioLogoutService from "../../_services/g_usuario/GUsuarioLogoutService";
|
||||
|
||||
export const useGUsuarioLogoutHook = () => {
|
||||
const logoutUsuario = async () => {
|
||||
await GUsuarioLogoutService("access_token");
|
||||
};
|
||||
|
||||
return { logoutUsuario };
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
import { z } from "zod";
|
||||
|
||||
export const GUsuarioLoginSchema = z.object({
|
||||
login: z.string().min(1, "O campo deve ser preenchido"),
|
||||
senha_api: z.string().min(1, "O campo deve ser preenchido"),
|
||||
});
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
"use server";
|
||||
|
||||
import GUsuarioIndexData from "../../_data/g_usuario/GUsuarioIndexData";
|
||||
|
||||
export default async function GUsuarioIndex() {
|
||||
const response = await GUsuarioIndexData();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
"use server";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import GUsuarioLoginData from "../../_data/g_usuario/GUsuarioLoginData";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function GUsuarioLoginService(form: any) {
|
||||
// Obtem a resposta da requisição
|
||||
const response = await GUsuarioLoginData(form);
|
||||
|
||||
// Verifica se localizou o usuário
|
||||
if (response.data.usuario_id <= 0) {
|
||||
return {
|
||||
code: 404,
|
||||
message: "Não foi localizado o usuário",
|
||||
};
|
||||
}
|
||||
|
||||
// Importação do manipulador de cookies
|
||||
const cookieStore = await cookies();
|
||||
|
||||
// Cria um novo cookie
|
||||
cookieStore.set("access_token", response.data.token, {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
sameSite: "strict",
|
||||
path: "/",
|
||||
maxAge: 60 * 60 * 24,
|
||||
});
|
||||
|
||||
// Redireciona para a págian desejada
|
||||
redirect("/servicos");
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
"use server";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function GUsuarioLogoutService(token: string) {
|
||||
const cookieStore = await cookies();
|
||||
cookieStore.set(token, "", {
|
||||
expires: new Date(0),
|
||||
path: "/",
|
||||
});
|
||||
|
||||
redirect("/login");
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
"use server";
|
||||
|
||||
import GUsuarioReadData from "../../_data/g_usuario/GUsuarioReadData";
|
||||
|
||||
export default async function GUsuarioRead(usuarioId: number) {
|
||||
// Verifica se o id informado é válido
|
||||
if (usuarioId <= 0) {
|
||||
return {
|
||||
code: 400,
|
||||
message: "Usuário informado inválido",
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await GUsuarioReadData(usuarioId);
|
||||
console.log("service", response);
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
"use server";
|
||||
|
||||
import GUsuarioSaveData from "../../_data/g_usuario/GUsuarioSaveData";
|
||||
|
||||
export default async function GUsuarioSave(form: any) {
|
||||
return await GUsuarioSaveData(form);
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import TTBAndamentoServicoIndex from '@/packages/administrativo/components/TTBAndamentoServico/TTBAndamentoServicoIndex';
|
||||
|
||||
export default function TAtoParteTipo() {
|
||||
return <TTBAndamentoServicoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import TAtoParteTipoIndex from '@/packages/administrativo/components/TAtoParteTipo/TAtoParteTipoIndex';
|
||||
|
||||
export default function TAtoParteTipo() {
|
||||
return <TAtoParteTipoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBBairroIndex from '@/packages/administrativo/components/GTBBairro/GTBBairroIndex';
|
||||
|
||||
export default function GCidadePage() {
|
||||
return <GTBBairroIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GCartorioIndex from '@/packages/administrativo/components/GCartorio/GCartorioIndex';
|
||||
|
||||
export default function GCartorioPage() {
|
||||
return <GCartorioIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecTipoNaturezaIndex from '@/packages/administrativo/components/TCensecTipoNatureza/TCensecTipoNaturezaIndex';
|
||||
|
||||
export default function TCensecTipoNaturezaPage() {
|
||||
return <TCensecTipoNaturezaIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default function TCensecPage() {
|
||||
return <div></div>;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecQualidadeIndex from '@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex';
|
||||
|
||||
export default function TCensecQualidadePage() {
|
||||
return <TCensecQualidadeIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecIndex from '@/packages/administrativo/components/TCensec/TCensecIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <TCensecIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecNaturezaLitigioIndex from '@/packages/administrativo/components/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndex';
|
||||
|
||||
export default function GCidadePage() {
|
||||
return <TCensecNaturezaLitigioIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecQualidadeIndex from '@/packages/administrativo/components/TCensecQualidade/TCensecQualidadeIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <TCensecQualidadeIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TCensecTipoAtoIndex from '@/packages/administrativo/components/TCensecTipoAto/TCensecTipoAtoIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <TCensecTipoAtoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GCidadeIndex from '@/packages/administrativo/components/GCidade/GCidadeIndex';
|
||||
|
||||
export default function GCidadePage() {
|
||||
return <GCidadeIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GCalculoIndex from '@/packages/administrativo/components/GCalculo/GCalculoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GCalculoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
'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)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GEmolumentoIndex from '@/packages/administrativo/components/GEmolumento/GEmolumentoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GEmolumentoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GEmolumentoPeriodoIndex from '@/packages/administrativo/components/GEmolumentoPeriodo/GEmolumentoPeriodoIndex';
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GEmolumentoPeriodoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GGramaticaIndex from '@/packages/administrativo/components/GGramatica/GGramaticaIndex';
|
||||
|
||||
export default function GGramaticaPage() {
|
||||
return <GGramaticaIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TImovelDashboard from '@/packages/administrativo/components/TImovel/TImovelDashboard';
|
||||
|
||||
export default function TImovelDashboardPage() {
|
||||
return <TImovelDashboard />;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
'use client';
|
||||
|
||||
import TImovelIndex from '@/packages/administrativo/components/TImovel/TImovelIndex';
|
||||
|
||||
export default function TImovelRuralPage() {
|
||||
return (
|
||||
<TImovelIndex
|
||||
pageTitle="Imóveis Rurais"
|
||||
pageDescription="Gerenciamento de imóveis rurais"
|
||||
tipoClasse={3}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBTipoLogradouroIndex from '@/packages/administrativo/components/GTBTipoLogradouro/GTBTipoLogradouroIndex';
|
||||
|
||||
export default function GMedidaTipoPage() {
|
||||
return <GTBTipoLogradouroIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
'use client';
|
||||
|
||||
import TImovelIndex from '@/packages/administrativo/components/TImovel/TImovelIndex';
|
||||
|
||||
export default function TImovelUrbanoPage() {
|
||||
return (
|
||||
<TImovelIndex
|
||||
pageTitle="Imóveis Urbanos"
|
||||
pageDescription="Gerenciamento de imóveis urbanos"
|
||||
tipoClasse={1}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GMedidaTipoIndex from '@/packages/administrativo/components/GMedidaTipo/GMedidaTipoIndex';
|
||||
|
||||
export default function GMedidaTipoPage() {
|
||||
return <GMedidaTipoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GNaturezaIndex from '@/packages/administrativo/components/GNatureza/GNaturezaIndex';
|
||||
|
||||
export default function GNaturezaPage() {
|
||||
return <GNaturezaIndex sistema_id={2} />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TPessoaDashboard from '@/packages/administrativo/components/TPessoa/TPessoaDashboard';
|
||||
|
||||
export default function TPessoaDashboardPage() {
|
||||
return <TPessoaDashboard />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBEstadoCivilIndex from '@/packages/administrativo/components/GTBEstadoCivil/GTBEstadoCivilIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <GTBEstadoCivilIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TPessoaFisicaIndex from '@/packages/administrativo/components/TPessoa/TPessoaFisica/TPessoaFisicaIndex';
|
||||
|
||||
export default function TPessoaFisica() {
|
||||
return <TPessoaFisicaIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import TPessoaJuridicaIndex from '@/packages/administrativo/components/TPessoa/TPessoaJuridica/TPessoaJuridicaIndex';
|
||||
|
||||
export default function TPessoaFisica() {
|
||||
return <TPessoaJuridicaIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBProfissaoIndex from '@/packages/administrativo/components/GTBProfissao/GTBProfissaoIndex';
|
||||
|
||||
export default function GTBEstadoCivilPage() {
|
||||
return <GTBProfissaoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBRegimeBensIndex from '@/packages/administrativo/components/GTBRegimeBens/GTBRegimeBensIndex';
|
||||
|
||||
export default function GTBRegimeBensPage() {
|
||||
return <GTBRegimeBensIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import GTBRegimeComunhaoIndex from '@/packages/administrativo/components/GTBRegimeComunhao/GTBRegimeComunhaoIndex';
|
||||
|
||||
export default function GTBRegimeBensPage() {
|
||||
return <GTBRegimeComunhaoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import TTBReconhecimentoTipoIndex from '@/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndex';
|
||||
|
||||
export default function TAtoParteTipo() {
|
||||
return <TTBReconhecimentoTipoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GSeloGrupoIndex from '@/packages/administrativo/components/GSeloGrupo/GSeloGrupoIndex';
|
||||
|
||||
export default function GSeloGrupoPage() {
|
||||
return <GSeloGrupoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import TServicoTipoIndex from '@/packages/administrativo/components/TServicoTipo/TServicoTipoIndex';
|
||||
|
||||
export default function TServicoTipoPage() {
|
||||
return <TServicoTipoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import GNaturezaTituloIndex from '@/packages/administrativo/components/GNaturezaTitulo/GNaturezaTituloIndex';
|
||||
|
||||
export default function GNaturezaPage() {
|
||||
return <GNaturezaTituloIndex sistema_id={2} />;
|
||||
}
|
||||
|
|
@ -1,14 +1,13 @@
|
|||
"use client";
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useParams } from 'next/navigation';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import MainEditor from "@/components/MainEditor";
|
||||
|
||||
import Loading from "@/app/_components/loading/loading";
|
||||
import { useTMinutaReadHook } from "../../../../_hooks/t_minuta/useTMinutaReadHook";
|
||||
import { TMinutaInterface } from "../../../../_interfaces/TMinutaInterface";
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
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();
|
||||
|
|
@ -42,16 +41,14 @@ export default function TMinutaDetalhes() {
|
|||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<div className="mb-4 grid gap-4 grid-cols-2">
|
||||
<div className="mb-4 grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Descrição</div>
|
||||
<div className="text-xl">{tMinuta.descricao}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Situação</div>
|
||||
<div className="text-xl">
|
||||
{tMinuta.situacao === "A" ? "Ativo" : "Inativo"}
|
||||
</div>
|
||||
<div className="text-xl">{tMinuta.situacao === 'A' ? 'Ativo' : 'Inativo'}</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<div className="text-2xl font-semibold">Texto</div>
|
||||
|
|
@ -59,10 +56,10 @@ export default function TMinutaDetalhes() {
|
|||
initialValue={editorContent} // Passa o conteúdo do editor
|
||||
onEditorChange={handleEditorChange} // Função que atualiza o estado
|
||||
margins={{
|
||||
top: "2",
|
||||
bottom: "2",
|
||||
left: "2",
|
||||
right: "2",
|
||||
top: '2',
|
||||
bottom: '2',
|
||||
left: '2',
|
||||
right: '2',
|
||||
}}
|
||||
size={{ width: 794, height: 1123 }} // Você pode ajustar o tamanho aqui
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
"use client";
|
||||
'use client';
|
||||
|
||||
import z from "zod";
|
||||
import { useEffect } from "react";
|
||||
import { useForm, Controller } from "react-hook-form";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useEffect } from 'react';
|
||||
import { useForm, Controller } from 'react-hook-form';
|
||||
import z from 'zod';
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
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,
|
||||
FormControl,
|
||||
|
|
@ -14,14 +16,11 @@ import {
|
|||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
|
||||
import MainEditor from "@/components/MainEditor";
|
||||
import { TMinutaSchema } from "../../../_schemas/TMinutaSchema";
|
||||
import { useTMinutaSaveHook } from "../../../_hooks/t_minuta/useTMinutaSaveHook";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
} 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 { TMinutaSchema } from '@/packages/administrativo/schemas/TMinuta/TMinutaSchema';
|
||||
|
||||
type FormValues = z.infer<typeof TMinutaSchema>;
|
||||
|
||||
|
|
@ -32,9 +31,9 @@ export default function TMinutaForm() {
|
|||
resolver: zodResolver(TMinutaSchema),
|
||||
defaultValues: {
|
||||
natureza_id: undefined,
|
||||
descricao: "",
|
||||
situacao: "A",
|
||||
texto: "",
|
||||
descricao: '',
|
||||
situacao: 'A',
|
||||
texto: '',
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -56,10 +55,7 @@ export default function TMinutaForm() {
|
|||
<FormItem>
|
||||
<FormLabel>Descrição</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
{...field}
|
||||
placeholder="Digite a descrição da minuta"
|
||||
/>
|
||||
<Input {...field} placeholder="Digite a descrição da minuta" />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
|
|
@ -73,12 +69,10 @@ export default function TMinutaForm() {
|
|||
render={({ field }) => (
|
||||
<div className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
checked={field.value === "A"}
|
||||
onCheckedChange={(checked) =>
|
||||
field.onChange(checked ? "A" : "I")
|
||||
}
|
||||
checked={field.value === 'A'}
|
||||
onCheckedChange={(checked) => field.onChange(checked ? 'A' : 'I')}
|
||||
/>
|
||||
<Label>{field.value === "A" ? "Ativo" : "Inativo"}</Label>
|
||||
<Label>{field.value === 'A' ? 'Ativo' : 'Inativo'}</Label>
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
|
|
@ -90,13 +84,13 @@ export default function TMinutaForm() {
|
|||
render={({ field }) => (
|
||||
<div>
|
||||
<MainEditor
|
||||
initialValue={field.value || ""}
|
||||
initialValue={field.value || ''}
|
||||
onEditorChange={field.onChange}
|
||||
margins={{ top: "0", bottom: "0", left: "0", right: "0" }}
|
||||
margins={{ top: '0', bottom: '0', left: '0', right: '0' }}
|
||||
size={{ width: 794, height: 1123 }}
|
||||
/>
|
||||
{form.formState.errors.texto && (
|
||||
<p className="text-sm text-red-500 mt-2">
|
||||
<p className="mt-2 text-sm text-red-500">
|
||||
{form.formState.errors.texto.message}
|
||||
</p>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,19 @@
|
|||
"use client";
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from "react";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { useConfirmDialog } from "@/app/_components/confirm_dialog/useConfirmDialog";
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
|
||||
import Header from "@/app/_components/structure/Header";
|
||||
import ConfirmDialog from "@/app/_components/confirm_dialog/ConfirmDialog";
|
||||
import Loading from "@/app/_components/loading/loading";
|
||||
|
||||
import TMinutaTable from "../../_components/t_minuta/TMinutaTable";
|
||||
import TMinutaForm from "../../_components/t_minuta/TMinutaForm";
|
||||
|
||||
import { useTMinutaReadHook } from "../../_hooks/t_minuta/useTMinutaReadHook";
|
||||
import { useTMinutaSaveHook } from "../../_hooks/t_minuta/useTMinutaSaveHook";
|
||||
import { useTMinutaRemoveHook } from "../../_hooks/t_minuta/useTMinutaRemoveHook";
|
||||
|
||||
import { TMinutaInterface } from "../../_interfaces/TMinutaInterface";
|
||||
import { useTMinutaIndexHook } from "../../_hooks/t_minuta/useTMinutaIndexHook";
|
||||
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';
|
||||
|
||||
export default function TMinutaPage() {
|
||||
// Hooks de leitura e escrita
|
||||
|
|
@ -25,13 +22,9 @@ export default function TMinutaPage() {
|
|||
const { removeTMinuta } = useTMinutaRemoveHook();
|
||||
|
||||
// Estados
|
||||
const [selectedMinuta, setSelectedMinuta] = useState<TMinutaInterface | null>(
|
||||
null,
|
||||
);
|
||||
const [selectedMinuta, setSelectedMinuta] = useState<TMinutaInterface | null>(null);
|
||||
const [isFormOpen, setIsFormOpen] = useState(false);
|
||||
const [itemToDelete, setItemToDelete] = useState<TMinutaInterface | null>(
|
||||
null,
|
||||
);
|
||||
const [itemToDelete, setItemToDelete] = useState<TMinutaInterface | null>(null);
|
||||
|
||||
// Hook de confirmação
|
||||
const {
|
||||
|
|
@ -89,11 +82,7 @@ export default function TMinutaPage() {
|
|||
{/* Tabela */}
|
||||
<Card>
|
||||
<CardContent>
|
||||
<TMinutaTable
|
||||
data={tMinuta}
|
||||
onEdit={handleOpenForm}
|
||||
onDelete={handleConfirmDelete}
|
||||
/>
|
||||
<TMinutaTable data={tMinuta} onEdit={handleOpenForm} onDelete={handleConfirmDelete} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,81 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
export default async function GCidadeIndexData() {
|
||||
return Promise.resolve({
|
||||
status: 200,
|
||||
message: "Dados localizados",
|
||||
data: [
|
||||
{
|
||||
cidade_id: 1,
|
||||
uf: "AC",
|
||||
cidade_nome: "Acrelândia",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 2,
|
||||
uf: "AC",
|
||||
cidade_nome: "Assis Brasil",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 3,
|
||||
uf: "AC",
|
||||
cidade_nome: "Brasiléia",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 4,
|
||||
uf: "AC",
|
||||
cidade_nome: "Bujari",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 5,
|
||||
uf: "AC",
|
||||
cidade_nome: "Capixaba",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 6,
|
||||
uf: "AC",
|
||||
cidade_nome: "Cruzeiro do Sul",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 7,
|
||||
uf: "AC",
|
||||
cidade_nome: "Epitaciolândia",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 8,
|
||||
uf: "AC",
|
||||
cidade_nome: "Feijó",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 9,
|
||||
uf: "AC",
|
||||
cidade_nome: "Jordão",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
{
|
||||
cidade_id: 10,
|
||||
uf: "AC",
|
||||
cidade_nome: "Mâncio Lima",
|
||||
codigo_ibge: null,
|
||||
codigo_gyn: null,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import GCidadeInterface from "../../_interfaces/GCidadeInterface";
|
||||
|
||||
export default async function GCidadeRemoveData(data: GCidadeInterface) {
|
||||
return Promise.resolve({
|
||||
status: 200,
|
||||
message: "Dados removidos",
|
||||
data: null,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import API from "@/services/api/Api"; // Importa o serviço de API (ainda não utilizado aqui)
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum"; // Importa enum de métodos HTTP (também não usado neste trecho)
|
||||
import GCidadeInterface from "../../_interfaces/GCidadeInterface";
|
||||
|
||||
// Função assíncrona responsável por salvar dados de cidades
|
||||
export default async function GCidadeSaveData(data: GCidadeInterface) {
|
||||
// Log para indicar que a função foi chamada
|
||||
console.log("chegou");
|
||||
|
||||
// Retorna uma Promise resolvida simulando resposta da API
|
||||
return Promise.resolve({
|
||||
status: 200, // Código de status fictício
|
||||
message: "Dados salvos", // Mensagem de sucesso
|
||||
});
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
async function executeGMedidaTipoIndexData() {
|
||||
const api = new API();
|
||||
return await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/g_medida_tipo/`,
|
||||
});
|
||||
}
|
||||
|
||||
export const GMedidaTipoIndexData = withClientErrorHandler(
|
||||
executeGMedidaTipoIndexData,
|
||||
);
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { GMedidaTipoInterface } from "../../_interfaces/GMedidaTipoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGMedidaTipoRemoveData(data: GMedidaTipoInterface) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/g_medida_tipo/${data.medida_tipo_id}`,
|
||||
});
|
||||
}
|
||||
|
||||
export const GMedidaTipoRemoveData = withClientErrorHandler(
|
||||
executeGMedidaTipoRemoveData,
|
||||
);
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { GMedidaTipoInterface } from "../../_interfaces/GMedidaTipoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGMedidaTipoSaveData(data: GMedidaTipoInterface) {
|
||||
const isUpdate = Boolean(data.medida_tipo_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/g_medida_tipo/${data.medida_tipo_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
||||
export const GMedidaTipoSaveData = withClientErrorHandler(
|
||||
executeGMedidaTipoSaveData,
|
||||
);
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
async function executeGTBBairroIndexData() {
|
||||
const api = new API();
|
||||
|
||||
const dados = await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/g_tb_bairro/`,
|
||||
});
|
||||
|
||||
return dados;
|
||||
}
|
||||
|
||||
export const GTBBairroIndexData = withClientErrorHandler(
|
||||
executeGTBBairroIndexData,
|
||||
);
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { GTBBairroInterface } from "../../_interfaces/GTBBairroInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGTBBairroRemoveData(data: GTBBairroInterface) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/g_tb_bairro/${data.tb_bairro_id}`,
|
||||
});
|
||||
}
|
||||
|
||||
export const GTBBairroRemoveData = withClientErrorHandler(
|
||||
executeGTBBairroRemoveData,
|
||||
);
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { GTBBairroInterface } from "../../_interfaces/GTBBairroInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGTBBairroSaveData(data: GTBBairroInterface) {
|
||||
const isUpdate = Boolean(data.tb_bairro_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/g_tb_bairro/${data.tb_bairro_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
||||
export const GTBBairroSaveData = withClientErrorHandler(
|
||||
executeGTBBairroSaveData,
|
||||
);
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
async function executeGTBEstadoCivilIndexData() {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/g_tb_estado_civil/`,
|
||||
});
|
||||
}
|
||||
|
||||
export const GTBEstadoCivilIndexData = withClientErrorHandler(
|
||||
executeGTBEstadoCivilIndexData,
|
||||
);
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { GTBEstadoCivilInterface } from "../../_interfaces/GTBEstadoCivilInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGTBEstadoCivilRemoveData(data: GTBEstadoCivilInterface) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/g_tb_bairro/${data.tb_estadocivil_id}`,
|
||||
});
|
||||
}
|
||||
|
||||
export const GTBEstadoCivilRemoveData = withClientErrorHandler(
|
||||
executeGTBEstadoCivilRemoveData,
|
||||
);
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { GTBEstadoCivilInterface } from "../../_interfaces/GTBEstadoCivilInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGTBEstadoCivilSaveData(data: GTBEstadoCivilInterface) {
|
||||
const isUpdate = Boolean(data.tb_estadocivil_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/g_tb_bairro/${data.tb_estadocivil_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
||||
export const GTBEstadoCivilSaveData = withClientErrorHandler(
|
||||
executeGTBEstadoCivilSaveData,
|
||||
);
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
export default async function GTBProfissaoRemoveData(
|
||||
data: GTBProfissaoInterface,
|
||||
) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/g_tb_profissao/${data.tb_profissao_id}`,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
export default async function GTBProfissaoSaveData(
|
||||
data: GTBProfissaoInterface,
|
||||
) {
|
||||
const isUpdate = Boolean(data.tb_profissao_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/g_tb_profissao/${data.tb_profissao_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import GTBRegimeBensInterface from "../../_interfaces/GTBRegimeBensInterface";
|
||||
|
||||
export default async function GTBRegimeBensRemoveData(
|
||||
data: GTBRegimeBensInterface,
|
||||
) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/g_tb_regimebens/${data.tb_regimebens_id}`,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import GTBRegimeBensInterface from "../../_interfaces/GTBRegimeBensInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGTBRegimeBensSaveData(data: GTBRegimeBensInterface) {
|
||||
throw new Error("Nome e email são obrigatórios");
|
||||
|
||||
const isUpdate = Boolean(data.tb_regimebens_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/g_tb_regimebens/${data.tb_regimebens_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
||||
export const GTBRegimeBensSaveData = withClientErrorHandler(
|
||||
executeGTBRegimeBensSaveData,
|
||||
);
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { GTBTipoLogradouroInterface } from "../../_interfaces/GTBTipoLogradouroInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGTBTipoLogradouroRemoveData(
|
||||
data: GTBTipoLogradouroInterface,
|
||||
) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/g_tb_tipologradouro/${data.tb_tipologradouro_id}`,
|
||||
});
|
||||
}
|
||||
|
||||
export const GTBTipoLogradouroRemoveData = withClientErrorHandler(
|
||||
executeGTBTipoLogradouroRemoveData,
|
||||
);
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { GTBTipoLogradouroInterface } from "../../_interfaces/GTBTipoLogradouroInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeGTBTipoLogradouroSaveData(
|
||||
data: GTBTipoLogradouroInterface,
|
||||
) {
|
||||
const isUpdate = Boolean(data.tb_tipologradouro_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/g_tb_tipologradouro/${data.tb_tipologradouro_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
||||
export const GTBTipoLogradouroSaveData = withClientErrorHandler(
|
||||
executeGTBTipoLogradouroSaveData,
|
||||
);
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import GTBRegimeComunhaoInterface from "../../_interfaces/GTBRegimeComunhaoInterface";
|
||||
|
||||
export default async function GTBRegimeComunhaoRemoveData(
|
||||
data: GTBRegimeComunhaoInterface,
|
||||
) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/g_tb_regimecomunhao/${data.tb_regimecomunhao_id}`,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import GTBRegimeComunhaoInterface from "../../_interfaces/GTBRegimeComunhaoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
export default async function GTBRegimeComunhaoSaveData(
|
||||
data: GTBRegimeComunhaoInterface,
|
||||
) {
|
||||
const isUpdate = Boolean(data.tb_regimecomunhao_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/g_tb_regimecomunhao/${data.tb_regimecomunhao_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import TCensecInterface from "../../_interfaces/TCensecInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeTCensecDeleteData(data: TCensecInterface) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/t_censec/${data.censec_id}`,
|
||||
});
|
||||
}
|
||||
|
||||
export const TCensecDeleteData = withClientErrorHandler(
|
||||
executeTCensecDeleteData,
|
||||
);
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import TCensecInterface from "../../_interfaces/TCensecInterface";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeTCensecSaveData(data: TCensecInterface) {
|
||||
const isUpdate = Boolean(data.censec_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/t_censec/${data.censec_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
||||
export const TCensecSaveData = withClientErrorHandler(executeTCensecSaveData);
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { TCensecNaturezaLitigioInterface } from "../../_interfaces/TCensecNaturezaLitigioInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeTCensecNaturezaLitigioRemoveData(
|
||||
data: TCensecNaturezaLitigioInterface,
|
||||
) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: Methods.DELETE,
|
||||
endpoint: `administrativo/t_censec_naturezalitigio/${data.censec_naturezalitigio_id}`,
|
||||
});
|
||||
}
|
||||
|
||||
export const TCensecNaturezaLitigioRemoveData = withClientErrorHandler(
|
||||
executeTCensecNaturezaLitigioRemoveData,
|
||||
);
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { TCensecNaturezaLitigioInterface } from "../../_interfaces/TCensecNaturezaLitigioInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeTCensecNaturezaLitigioSaveData(
|
||||
data: TCensecNaturezaLitigioInterface,
|
||||
) {
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: data.censec_naturezalitigio_id ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/t_censec_naturezalitigio/${data.censec_naturezalitigio_id ? data.censec_naturezalitigio_id : ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
||||
export const TCensecNaturezaLitigioSaveData = withClientErrorHandler(
|
||||
executeTCensecNaturezaLitigioSaveData,
|
||||
);
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { MinutaMockDeDadosPorId } from "./mockMinuta";
|
||||
|
||||
const useMock = true;
|
||||
|
||||
export default async function TMinutaIndex(t_minuta_id: number) {
|
||||
if (useMock) {
|
||||
console.log(await MinutaMockDeDadosPorId(t_minuta_id)); // Retorna o dado específico do mock
|
||||
return await MinutaMockDeDadosPorId(t_minuta_id); // Retorna o dado específico do mock
|
||||
}
|
||||
|
||||
const api = new API();
|
||||
try {
|
||||
const dados = await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/t_minuta/${t_minuta_id}`,
|
||||
});
|
||||
return dados;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import MinutaMockDeDados from "./mockMinuta";
|
||||
|
||||
const useMock = true;
|
||||
|
||||
export default async function TMinutaIndexData() {
|
||||
if (useMock) {
|
||||
return await MinutaMockDeDados(); // Retorna todos os dados mockados
|
||||
}
|
||||
|
||||
const api = new API();
|
||||
try {
|
||||
const dados = await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/t_minuta/`,
|
||||
});
|
||||
return dados;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { TMinutaInterface } from "../../_interfaces/TMinutaInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
export default async function TMinutaSaveData(data: TMinutaInterface) {
|
||||
const isUpdate = Boolean(data.t_minuta_id);
|
||||
|
||||
const api = new API();
|
||||
|
||||
return await api.send({
|
||||
method: isUpdate ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/t_minuta/${data.t_minuta_id || ""}`,
|
||||
body: data,
|
||||
});
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
"use server";
|
||||
|
||||
import API from "@/services/api/Api";
|
||||
import TTBAndamentoServicoInteface from "../../_interfaces/TTBAndamentoServicoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
async function executeTTBAndamentoServicoSaveData(
|
||||
data: TTBAndamentoServicoInteface,
|
||||
) {
|
||||
const api = new API();
|
||||
|
||||
const response = await api.send({
|
||||
method: data.tb_andamentoservico_id ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/t_tb_andamentoservico/${data.tb_andamentoservico_id ? data.tb_andamentoservico_id : ""}`,
|
||||
body: data,
|
||||
});
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
// Encapsula a execução da função
|
||||
export const TTBAndamentoServicoSaveData = withClientErrorHandler(
|
||||
executeTTBAndamentoServicoSaveData,
|
||||
);
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import TTBReconhecimentoTipoInterface from "../../_interfaces/TTBReconhecimentoTipoInterface";
|
||||
|
||||
export default async function TTBReconhecimentoTipoSaveData(
|
||||
data: TTBReconhecimentoTipoInterface,
|
||||
) {
|
||||
const api = new API();
|
||||
|
||||
const response = await api.send({
|
||||
method: data.tb_reconhecimentotipo_id ? Methods.PUT : Methods.POST,
|
||||
endpoint: `administrativo/t_tb_reconhecimentotipo/${data.tb_reconhecimentotipo_id ? data.tb_reconhecimentotipo_id : ""}`,
|
||||
body: data,
|
||||
});
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import { useState } from "react";
|
||||
import { useResponse } from "@/app/_response/ResponseContext";
|
||||
import GCidadeInterface from "../../_interfaces/GCidadeInterface";
|
||||
import { GCidadeSaveService } from "../../_services/g_cidade/GCidadeSaveService";
|
||||
|
||||
export const useGCidadeSaveHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
const [gCidade, setGCidade] = useState<GCidadeInterface | null>(null);
|
||||
|
||||
// controla se o formulário está aberto ou fechado
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const saveGCidade = async (data: GCidadeInterface) => {
|
||||
const response = await GCidadeSaveService(data);
|
||||
|
||||
// Guardar os dados localizados
|
||||
setGCidade(response.data);
|
||||
|
||||
// Manda a resposta para o verificador de resposta
|
||||
setResponse(response);
|
||||
|
||||
// Fecha o formulário automaticamente após salvar
|
||||
setIsOpen(false);
|
||||
|
||||
// Retorna os dados imediatamente
|
||||
return response;
|
||||
};
|
||||
|
||||
return { gCidade, saveGCidade };
|
||||
};
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext";
|
||||
import { useState } from "react";
|
||||
import { GMedidaTipoInterface } from "../../_interfaces/GMedidaTipoInterface";
|
||||
import { GMedidaTipoIndexService } from "../../_services/g_medidatipo/GMedidaTipoIndexService";
|
||||
|
||||
export const useGMedidaTipoReadHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
const [gMedidaTipo, setGMedidaTipo] = useState<GMedidaTipoInterface[]>([]);
|
||||
|
||||
const fetchGMedidaTipo = async () => {
|
||||
try {
|
||||
const response = await GMedidaTipoIndexService();
|
||||
|
||||
setGMedidaTipo(response.data);
|
||||
|
||||
setResponse(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
return { gMedidaTipo, fetchGMedidaTipo };
|
||||
};
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext";
|
||||
import { GMedidaTipoInterface } from "../../_interfaces/GMedidaTipoInterface";
|
||||
import { GMedidaTipoRemoveService } from "../../_services/g_medidatipo/GMedidaTipoRemoveService";
|
||||
|
||||
export const useGMedidaTipoRemoveHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
const removeGMedidaTipo = async (data: GMedidaTipoInterface) => {
|
||||
const response = await GMedidaTipoRemoveService(data);
|
||||
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
return { removeGMedidaTipo };
|
||||
};
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext";
|
||||
import { GTBBairroInterface } from "../../_interfaces/GTBBairroInterface";
|
||||
import { GTBBairroRemoveService } from "../../_services/g_tb_bairro/GTBBairroRemoveService";
|
||||
|
||||
export const useGTBBairroRemoveHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
const removeGTBBairro = async (data: GTBBairroInterface) => {
|
||||
const response = await GTBBairroRemoveService(data);
|
||||
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
return { removeGTBBairro };
|
||||
};
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext";
|
||||
import { useState } from "react";
|
||||
import { GTBEstadoCivilInterface } from "../../_interfaces/GTBEstadoCivilInterface";
|
||||
import { GTBEstadoCivilIndexService } from "../../_services/g_tb_estadocivil/GTBEstadoCivilIndexService";
|
||||
|
||||
export const useGTBEstadoCivilReadHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
const [gTBEstadoCivil, setGTBEstadoCivil] = useState<
|
||||
GTBEstadoCivilInterface[]
|
||||
>([]);
|
||||
|
||||
const fetchGTBEstadoCivil = async () => {
|
||||
try {
|
||||
const response = await GTBEstadoCivilIndexService();
|
||||
|
||||
setGTBEstadoCivil(response.data);
|
||||
|
||||
setResponse(response);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
return { gTBEstadoCivil, fetchGTBEstadoCivil };
|
||||
};
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext";
|
||||
import { GTBEstadoCivilInterface } from "../../_interfaces/GTBEstadoCivilInterface";
|
||||
import { GTBEstadoCivilRemoveService } from "../../_services/g_tb_estadocivil/GTBEstadoCivilRemoveService";
|
||||
|
||||
export const useGTBEstadoCivilRemoveHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
const removeGTBEstadoCivil = async (data: GTBEstadoCivilInterface) => {
|
||||
const response = await GTBEstadoCivilRemoveService(data);
|
||||
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
return { removeGTBEstadoCivil };
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue