fix(Deploy): Realiza ajustes diversos para realizar o build da aplicação
This commit is contained in:
parent
aa8553b3fe
commit
36dba45995
25 changed files with 76 additions and 95 deletions
12
package-lock.json
generated
12
package-lock.json
generated
|
|
@ -4937,6 +4937,16 @@
|
|||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/input-otp": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/input-otp/-/input-otp-1.4.2.tgz",
|
||||
"integrity": "sha512-l3jWwYNvrEa6NTCt7BECfCm48GvwuZzkoeG3gBL2w4CHeOXW3eKFmf9UNYkNfYc3mxMrthMnxjIE07MT0zLBQA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc"
|
||||
}
|
||||
},
|
||||
"node_modules/internal-slot": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz",
|
||||
|
|
@ -7960,4 +7970,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import { useTCensecTipoAtoRemoveHook } from "../../_hooks/t_censec_tipoato/useTC
|
|||
import { useTCensecReadHook } from "../../_hooks/t_censec/useTCensecReadHook";
|
||||
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import { SituacoesEnum } from "@/enums/SituacoesEnum";
|
||||
import { SituacoesEnum } from "@/shared/enums/SituacoesEnum";
|
||||
|
||||
// Estado inicial para criação
|
||||
const initialTCensecTipoAto: TCensecTipoAtoInterface = {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { useEffect } from "react";
|
|||
import { useForm, Controller } from "react-hook-form";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import LoadingButton from "@/app/_components/loadingButton/LoadingButton";
|
||||
import LoadingButton from "@/shared/components/loadingButton/LoadingButton";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
|
|
@ -30,7 +30,7 @@ import { Label } from "@/components/ui/label";
|
|||
import { TCensecTipoAtoSchema } from "../../_schemas/TCensecTipoAtoSchema";
|
||||
import { TCensecTipoAtoInterface } from "../../_interfaces/TCensecTipoAtoInterface";
|
||||
import TCensecInterface from "../../_interfaces/TCensecInterface";
|
||||
import { SituacoesEnum } from "@/enums/SituacoesEnum";
|
||||
import { SituacoesEnum } from "@/shared/enums/SituacoesEnum";
|
||||
|
||||
type FormValues = z.infer<typeof TCensecTipoAtoSchema>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { SituacoesEnum } from "@/enums/SituacoesEnum";
|
||||
import { SituacoesEnum } from "@/shared/enums/SituacoesEnum";
|
||||
|
||||
export interface TCensecTipoAtoInterface {
|
||||
censec_tipoato_id: number;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { z } from "zod";
|
||||
import { SituacoesEnum } from "@/enums/SituacoesEnum";
|
||||
import { SituacoesEnum } from "@/shared/enums/SituacoesEnum";
|
||||
|
||||
export const TCensecTipoAtoSchema = z.object({
|
||||
censec_tipoato_id: z.number().int(),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
import GCidadeRemoveData from '../../_data/GCidade/GCidadeRemoveData';
|
||||
import { GCidadeRemoveData } from '../../_data/GCidade/GCidadeRemoveData';
|
||||
// Função que remove os dados da cidade via API
|
||||
import GCidadeInterface from '../../_interfaces/GCidadeInterface';
|
||||
// Interface tipada da cidade
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ export default function TImovelForm({ isOpen, data, onClose, onSave, buttonIsLoa
|
|||
<FormItem>
|
||||
<FormLabel>CNS</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} type="number" placeholder="Digite o CNS" onChange={e => field.onChange(parseNumberInput(e))}/>
|
||||
<Input {...field} type="number" placeholder="Digite o CNS" onChange={e => field.onChange(parseNumberInput(e))} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
|
|
@ -334,7 +334,7 @@ export default function TImovelForm({ isOpen, data, onClose, onSave, buttonIsLoa
|
|||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<SelectTrigger className="w-full">
|
||||
{field.value
|
||||
? ImovelTipoClasseEnum[field.value as keyof typeof ImovelTipoClasseEnum]
|
||||
? ImovelTipoClasseEnum[Number(field.value) as keyof typeof ImovelTipoClasseEnum]
|
||||
: "Selecione"}
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
|
|
@ -356,7 +356,7 @@ export default function TImovelForm({ isOpen, data, onClose, onSave, buttonIsLoa
|
|||
{/* Unidades */}
|
||||
<TabsContent value="unidades" className="space-y-4">
|
||||
{/* Conteúdo das unidades */}
|
||||
{tipoClasse === 1 ? <TImovelUnidadeUrbanoPage imovel_id={data?.imovel_id}/> : null}
|
||||
{tipoClasse === 1 ? <TImovelUnidadeUrbanoPage imovel_id={data?.imovel_id} /> : null}
|
||||
{/* Conteúdo das unidades */}
|
||||
{tipoClasse === 3 ? <TImovelUnidadeRuralPage /> : null}
|
||||
</TabsContent>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default function TImovelUnidadePage() {
|
|||
const { deleteTImovelUnidadeRural } = useTImovelUnidadeRuralDeleteHook();
|
||||
|
||||
// Estados
|
||||
const [selectedAndamento, setSelectedAndamento] = useState<TImovelUnidadeRuralInterface | null>(null);
|
||||
const [selectedData, setSelectedData] = useState<TImovelUnidadeRuralInterface | null>(null);
|
||||
const [isFormOpen, setIsFormOpen] = useState(false);
|
||||
|
||||
// Estado para saber qual item será deletado
|
||||
|
|
@ -45,7 +45,7 @@ export default function TImovelUnidadePage() {
|
|||
* Abre o formulário no modo de edição ou criação
|
||||
*/
|
||||
const handleOpenForm = useCallback((data: TImovelUnidadeRuralInterface | null) => {
|
||||
setSelectedAndamento(data);
|
||||
setSelectedData(data);
|
||||
setIsFormOpen(true);
|
||||
}, []);
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ export default function TImovelUnidadePage() {
|
|||
* Fecha o formulário e limpa o andamento selecionado
|
||||
*/
|
||||
const handleCloseForm = useCallback(() => {
|
||||
setSelectedAndamento(null);
|
||||
setSelectedData(null);
|
||||
setIsFormOpen(false);
|
||||
}, []);
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ export default function TImovelUnidadePage() {
|
|||
{/* Formulário de criação/edição */}
|
||||
<TImovelUnidadeRuralForm
|
||||
isOpen={isFormOpen}
|
||||
data={selectedAndamento}
|
||||
data={selectedData}
|
||||
onClose={handleCloseForm}
|
||||
onSave={handleSave}
|
||||
buttonIsLoading={buttonIsLoading}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ export default function TImovelUnidadeUrbanoForm({ isOpen, data, onClose, onSave
|
|||
<FormItem>
|
||||
<FormLabel>Quadra</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
<Input {...field} type='text' />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
|
|
|
|||
|
|
@ -274,7 +274,6 @@ export default function TPessoaFisicaForm({
|
|||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Estado Civil */}
|
||||
<div className="col-span-12 sm:col-span-12 md:col-span-4">
|
||||
<FormField
|
||||
|
|
|
|||
|
|
@ -152,7 +152,6 @@ export default function TPessoaFisicaIndex() {
|
|||
onConfirm={handleDelete}
|
||||
onCancel={handleCancel}
|
||||
/>
|
||||
|
||||
{/* Formulário de criação/edição */}
|
||||
<TPessoaForm
|
||||
isOpen={isFormOpen}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ export default function TPessoaJuridicaForm({
|
|||
<div className="col-span-12 sm:col-span-12 md:col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="uf_residencia"
|
||||
name="estrangeiro_res_tb_pais_id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>País</FormLabel>
|
||||
|
|
@ -216,7 +216,7 @@ export default function TPessoaJuridicaForm({
|
|||
<div className="col-span-12 sm:col-span-12 md:col-span-2">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="uf_residencia"
|
||||
name="uf"
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>UF</FormLabel>
|
||||
|
|
@ -248,7 +248,7 @@ export default function TPessoaJuridicaForm({
|
|||
<div className="col-span-12 sm:col-span-12 md:col-span-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="cidade_nat_id"
|
||||
name="cidade"
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Cidade</FormLabel>
|
||||
|
|
@ -340,22 +340,6 @@ export default function TPessoaJuridicaForm({
|
|||
)}
|
||||
/>
|
||||
</div>
|
||||
{/* Cidade não encontrada */}
|
||||
<div className="col-span-12 sm:col-span-12 md:col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="uf_residencia"
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Cidade não encontrada</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} placeholder="Digite o nome" className="w-full" />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</TabsContent>
|
||||
{/* Documentos */}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,7 @@ export function useTImovelUnidadeRuralFormHook(defaults?: Partial<TImovelUnidade
|
|||
return useForm<TImovelUnidadeRuralFormValues>({
|
||||
resolver: zodResolver(TImovelUnidadeRuralSchema),
|
||||
defaultValues: {
|
||||
imovel_id: 0,
|
||||
imovel_unidade_id: 0,
|
||||
tipo_imovel: 0,
|
||||
tipo_construcao: 0,
|
||||
geo_referenciamento: '',
|
||||
reserva_florestal: ''
|
||||
...defaults,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -8,8 +8,7 @@ import { useState } from 'react';
|
|||
export const useTImovelUnidadeRuralIndexHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
const [tImovelUnidadeRural, setTImovelUnidadeRural] = useState<
|
||||
TImovelUnidadeRuralInterface[]>();
|
||||
const [tImovelUnidadeRural, setTImovelUnidadeRural] = useState<TImovelUnidadeRuralInterface[]>([]);
|
||||
|
||||
const indexTImovelUnidadeRural = async () => {
|
||||
const response = await TImovelUnidadeRuralIndexData();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export function useTImovelUnidadeUrbanoFormHook(defaults?: Partial<TImovelUnidad
|
|||
return useForm<TImovelUnidadeUrbanoFormValues>({
|
||||
resolver: zodResolver(TImovelUnidadeUrbanoSchema),
|
||||
defaultValues: {
|
||||
imovel_id: 1,
|
||||
...defaults,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -8,9 +8,7 @@ export function useTPessoaFisicaFormHook(defaults?: Partial<TPessoaFisicaFormVal
|
|||
return useForm<TPessoaFisicaFormValues>({
|
||||
resolver: zodResolver(TPessoaFisicaSchema),
|
||||
defaultValues: {
|
||||
nome: "",
|
||||
pessoa_id: 0,
|
||||
...defaults, // sobrescreve valores iniciais se forem passados
|
||||
...defaults,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -6,9 +6,7 @@ export function useTPessoaJuridicaFormHook(defaults?: Partial<TPessoaJuridicaFor
|
|||
return useForm<TPessoaJuridicaFormValues>({
|
||||
resolver: zodResolver(TPessoaJuridicaSchema),
|
||||
defaultValues: {
|
||||
nome: "",
|
||||
pessoa_id: 0,
|
||||
...defaults, // sobrescreve valores iniciais se forem passados
|
||||
...defaults,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -9,9 +9,7 @@ export function useTPessoaRepresentanteFormHook(defaults?: Partial<TPessoaRepres
|
|||
return useForm<TPessoaRepresentanteFormValues>({
|
||||
resolver: zodResolver(TPessoaRepresentanteSchema),
|
||||
defaultValues: {
|
||||
nome: "",
|
||||
pessoa_id: 0,
|
||||
...defaults, // sobrescreve valores iniciais se forem passados
|
||||
...defaults,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -3,10 +3,10 @@ import TImovelUnidadeInterface from "../TImovelUnidadeInterface";
|
|||
export interface TImovelUnidadeRuralInterface extends TImovelUnidadeInterface {
|
||||
galpao?: string;
|
||||
nao_se_aplica?: boolean;
|
||||
reserva_florestal?: string;
|
||||
geo_referenciamento?: string;
|
||||
reserva_florestal?: boolean;
|
||||
geo_referenciamento?: boolean;
|
||||
nome_identificacao?: string;
|
||||
ccir?: string; // CCIR - INCRA
|
||||
ccir?: string;
|
||||
denominacao?: string;
|
||||
nirf?: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
import TImovelUnidadeInterface from "../TImovelUnidadeInterface";
|
||||
|
||||
export interface TImovelUnidadeUrbanoInterface extends TImovelUnidadeInterface {
|
||||
quadra?: string | null;
|
||||
lote?: string | null;
|
||||
inscricao_municipal?: string | null;
|
||||
tb_tipologradouro_id?: number | null;
|
||||
quadra?: string;
|
||||
lote?: string;
|
||||
inscricao_municipal?: string;
|
||||
tb_tipologradouro_id?: number;
|
||||
logradouro: string;
|
||||
tipo_imovel?: number | null;
|
||||
tipo_construcao?: number | null;
|
||||
iptu?: string | null;
|
||||
numero_unidade?: string | null;
|
||||
torre?: string | null;
|
||||
nomecondominio?: string | null;
|
||||
nomeloteamento?: string | null;
|
||||
numero?: number | null;
|
||||
complemento?: string | null;
|
||||
numero_edificacao?: string | null;
|
||||
cnm_numero?: string | null;
|
||||
cib?: string | null;
|
||||
tipo_imovel?: number;
|
||||
tipo_construcao?: number;
|
||||
iptu?: string;
|
||||
numero_unidade?: string;
|
||||
torre?: string;
|
||||
nomecondominio?: string;
|
||||
nomeloteamento?: string;
|
||||
numero?: number;
|
||||
complemento?: string;
|
||||
numero_edificacao?: string;
|
||||
cnm_numero?: string;
|
||||
cib?: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import { TImovelUnidadeSchema } from "../TImovelUnidadeSchema";
|
|||
export const TImovelUnidadeRuralSchema = TImovelUnidadeSchema.extend({
|
||||
galpao: z.string().optional(),
|
||||
nao_se_aplica: z.boolean().optional(),
|
||||
reserva_florestal: z.string().optional(),
|
||||
geo_referenciamento: z.string().optional(),
|
||||
reserva_florestal: z.boolean().optional(),
|
||||
geo_referenciamento: z.boolean().optional(),
|
||||
nome_identificacao: z.string().optional(),
|
||||
ccir: z.string().optional(),
|
||||
denominacao: z.string().optional(),
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@ import { z } from "zod";
|
|||
import { TImovelUnidadeSchema } from "../TImovelUnidadeSchema";
|
||||
|
||||
export const TImovelUnidadeUrbanoSchema = TImovelUnidadeSchema.extend({
|
||||
quadra: z.string().nullable().optional(),
|
||||
lote: z.string().nullable().optional(),
|
||||
inscricao_municipal: z.string().nullable().optional(),
|
||||
tb_tipologradouro_id: z.number().nullable().optional(),
|
||||
quadra: z.string().optional(),
|
||||
lote: z.string().optional(),
|
||||
inscricao_municipal: z.string().optional(),
|
||||
tb_tipologradouro_id: z.number().optional(),
|
||||
logradouro: z.string().min(1, "O logradouro é obrigatório"),
|
||||
iptu: z.string().nullable().optional(),
|
||||
numero_unidade: z.string().nullable().optional(),
|
||||
torre: z.string().nullable().optional(),
|
||||
nomecondominio: z.string().nullable().optional(),
|
||||
nomeloteamento: z.string().nullable().optional(),
|
||||
numero: z.number().nullable().optional(),
|
||||
complemento: z.string().nullable().optional(),
|
||||
numero_edificacao: z.string().nullable().optional(),
|
||||
cnm_numero: z.string().nullable().optional(),
|
||||
cib: z.string().nullable().optional(),
|
||||
iptu: z.string().optional(),
|
||||
numero_unidade: z.string().optional(),
|
||||
torre: z.string().optional(),
|
||||
nomecondominio: z.string().optional(),
|
||||
nomeloteamento: z.string().optional(),
|
||||
numero: z.number().optional(),
|
||||
complemento: z.string().optional(),
|
||||
numero_edificacao: z.string().optional(),
|
||||
cnm_numero: z.string().optional(),
|
||||
cib: z.string().optional(),
|
||||
});
|
||||
|
||||
export type TImovelUnidadeUrbanoFormValues = z.infer<typeof TImovelUnidadeUrbanoSchema>;
|
||||
|
|
|
|||
|
|
@ -21,16 +21,13 @@ export const TPessoaFisicaSchema = TPessoaSchema.extend({
|
|||
cert_casamento_data: z.string().optional(),
|
||||
cert_casamento_lei: z.string().optional(),
|
||||
pessoa_conjuge_nome: z.string().optional(),
|
||||
estrangeiro_nat: z.string().optional(),
|
||||
estrangeiro_nat_tb_pais_id: z.number().optional(),
|
||||
estrangeiro_res_tb_pais_id: z.number().optional(),
|
||||
estrangeiro_res: z.string().optional(),
|
||||
documento_orgao: z.string().optional(),
|
||||
documento_uf: z.string().optional(),
|
||||
uf_residencia: z.string().optional(),
|
||||
deficiencias: z.string().optional(),
|
||||
grau_instrucao: z.string().optional(),
|
||||
cidade_nat_id: z.number().optional(),
|
||||
naturalidade: z.string().optional(),
|
||||
});
|
||||
|
||||
export type TPessoaFisicaFormValues = z.infer<typeof TPessoaFisicaSchema>;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import z from 'zod';
|
|||
export const TPessoaSchema = z.object({
|
||||
pessoa_id: z.number().optional(),
|
||||
pessoa_tipo: z.string().optional(),
|
||||
nome: z.string().min(1, 'O campo deve ser preenchido').max(120, 'O nome excede 120 caracteres'),
|
||||
nome: z.string().optional(),
|
||||
documento: z.string().optional(),
|
||||
data_cadastro: z.string().optional(),
|
||||
telefone: z.string().optional(),
|
||||
|
|
@ -30,4 +30,8 @@ export const TPessoaSchema = z.object({
|
|||
unidade: z.string().optional(),
|
||||
numero_end: z.string().optional(),
|
||||
foto: z.string().optional(),
|
||||
estrangeiro_nat: z.string().optional(),
|
||||
estrangeiro_nat_tb_pais_id: z.number().optional(),
|
||||
estrangeiro_res_tb_pais_id: z.number().optional(),
|
||||
estrangeiro_res: z.string().optional(),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const TPessoaRepresentanteSchema = z.object({
|
|||
representante_id: z.number().optional(),
|
||||
ato_partetipo_id: z.number().optional(),
|
||||
marcacao_tipo_id: z.number().optional(),
|
||||
assinatura_tipo: z.number().optional(),
|
||||
assinatura_tipo: z.string().optional(),
|
||||
pessoa_auxiliar_id: z.number().optional(),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue