@orbe-agro/client-core-prod 5.6.33 → 5.6.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@ecme/components/index.js +62 -60
- package/dist/@ecme/components/index.js.map +1 -1
- package/dist/@ecme/components/shared/MetricCard.js +39 -0
- package/dist/@ecme/components/shared/MetricCard.js.map +1 -0
- package/dist/@ecme/components/shared/index.js +30 -28
- package/dist/@ecme/components/shared/index.js.map +1 -1
- package/dist/@ecme/index.js +150 -148
- package/dist/@ecme/index.js.map +1 -1
- package/dist/@types/@ecme/components/shared/MetricCard.d.ts +13 -0
- package/dist/@types/@ecme/components/shared/MetricCard.d.ts.map +1 -0
- package/dist/@types/@ecme/components/shared/index.d.ts +1 -0
- package/dist/@types/@ecme/components/shared/index.d.ts.map +1 -1
- package/dist/@types/base/@types/api/response/bayer/TFindAllMetricsEntregaBayerResponse.d.ts +9 -0
- package/dist/@types/base/@types/api/response/bayer/TFindAllMetricsEntregaBayerResponse.d.ts.map +1 -0
- package/dist/@types/base/@types/api/response/bayer/TFindAllRetencaoResponse.d.ts +2 -0
- package/dist/@types/base/@types/api/response/bayer/TFindAllRetencaoResponse.d.ts.map +1 -1
- package/dist/@types/base/@types/api/response/bayer/types.d.ts +14 -0
- package/dist/@types/base/@types/api/response/bayer/types.d.ts.map +1 -1
- package/dist/@types/base/@types/enums/bayer/StatusOrbe.d.ts +6 -0
- package/dist/@types/base/@types/enums/bayer/StatusOrbe.d.ts.map +1 -0
- package/dist/@types/base/@types/enums/bayer/StatusRetencao.d.ts +6 -0
- package/dist/@types/base/@types/enums/bayer/StatusRetencao.d.ts.map +1 -0
- package/dist/@types/base/configs/endpoints.config/bayer/bayer.d.ts +2 -0
- package/dist/@types/base/configs/endpoints.config/bayer/bayer.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/bayer/config/entregaBayer.d.ts +2 -0
- package/dist/@types/base/configs/endpoints.config/bayer/config/entregaBayer.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts +2 -0
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts.map +1 -1
- package/dist/@types/base/hooks/crm/dadosUnificados/useDadosUnificadosList.d.ts +13 -0
- package/dist/@types/base/hooks/crm/dadosUnificados/useDadosUnificadosList.d.ts.map +1 -0
- package/dist/@types/base/hooks/index.d.ts +1 -0
- package/dist/@types/base/hooks/index.d.ts.map +1 -1
- package/dist/@types/base/services/modules/bayer/entregaBayerService.d.ts +4 -1
- package/dist/@types/base/services/modules/bayer/entregaBayerService.d.ts.map +1 -1
- package/dist/@types/base/store/crm/dadosUnificados/dadosUnificadosListStore.d.ts +4 -0
- package/dist/@types/base/store/crm/dadosUnificados/dadosUnificadosListStore.d.ts.map +1 -0
- package/dist/base/@types/api/response/bayer/TFindAllMetricsEntregaBayerResponse.js +2 -0
- package/dist/base/@types/api/response/bayer/TFindAllMetricsEntregaBayerResponse.js.map +1 -0
- package/dist/base/@types/api/response/bayer/types.js +8 -1
- package/dist/base/@types/api/response/bayer/types.js.map +1 -1
- package/dist/base/@types/enums/bayer/StatusOrbe.js +10 -0
- package/dist/base/@types/enums/bayer/StatusOrbe.js.map +1 -0
- package/dist/base/@types/enums/bayer/StatusRetencao.js +10 -0
- package/dist/base/@types/enums/bayer/StatusRetencao.js.map +1 -0
- package/dist/base/configs/endpoints.config/bayer/config/entregaBayer.js +3 -1
- package/dist/base/configs/endpoints.config/bayer/config/entregaBayer.js.map +1 -1
- package/dist/base/hooks/crm/dadosUnificados/useDadosUnificadosList.js +33 -0
- package/dist/base/hooks/crm/dadosUnificados/useDadosUnificadosList.js.map +1 -0
- package/dist/base/hooks/index.js +2 -0
- package/dist/base/hooks/index.js.map +1 -1
- package/dist/base/index.js +115 -111
- package/dist/base/index.js.map +1 -1
- package/dist/base/services/index.js +3 -1
- package/dist/base/services/modules/bayer/entregaBayerService.js +14 -0
- package/dist/base/services/modules/bayer/entregaBayerService.js.map +1 -1
- package/dist/base/services/modules/bayer/index.js +3 -1
- package/dist/base/store/crm/dadosUnificados/dadosUnificadosListStore.js +16 -0
- package/dist/base/store/crm/dadosUnificados/dadosUnificadosListStore.js.map +1 -0
- package/lib/@ecme/components/shared/MetricCard.tsx +44 -0
- package/lib/@ecme/components/shared/index.tsx +1 -0
- package/lib/base/@types/api/response/bayer/TFindAllMetricsEntregaBayerResponse.ts +8 -0
- package/lib/base/@types/api/response/bayer/TFindAllRetencaoResponse.ts +2 -0
- package/lib/base/@types/api/response/bayer/types.ts +16 -0
- package/lib/base/@types/enums/bayer/StatusOrbe.ts +5 -0
- package/lib/base/@types/enums/bayer/StatusRetencao.ts +5 -0
- package/lib/base/configs/endpoints.config/bayer/config/entregaBayer.ts +2 -0
- package/lib/base/hooks/crm/dadosUnificados/useDadosUnificadosList.tsx +37 -0
- package/lib/base/hooks/index.ts +2 -1
- package/lib/base/services/modules/bayer/entregaBayerService.ts +17 -1
- package/lib/base/store/crm/dadosUnificados/dadosUnificadosListStore.tsx +19 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { apiBuscarEntradaGraos } from "./registroEntradaBayerService.js";
|
|
2
|
-
import { apiAplicarRetencao, apiAtualizarQuantidadesEntrega, apiBuscarRetornoEntregas, apiCalcularRetencao, apiCancelarEntregaBayer, apiCreateEntrega, apiEnviarEntregaBayer, apiEnviarEntregaBayerLote, apiFindAllEntregaBayer, apiFindEntrega, apiSomatorioEntrega } from "./entregaBayerService.js";
|
|
2
|
+
import { apiAplicarRetencao, apiAtualizarQuantidadesEntrega, apiBuscarRetornoEntregas, apiCalcularRetencao, apiCancelarEntregaBayer, apiCreateEntrega, apiEnviarEntregaBayer, apiEnviarEntregaBayerLote, apiFindAllEntregaBayer, apiFindEntrega, apiFindEntregaBayerMetrics, apiGetTransacoesEntrega, apiSomatorioEntrega } from "./entregaBayerService.js";
|
|
3
3
|
import { apiCreateRoyaltiesBusinessPartner, apiGetRoyaltiesBusinessPartner } from "./royaltiesBayerService.js";
|
|
4
4
|
import { apiBuscarPendencias, apiBuscarPendenciasBayer, apiBuscarStatusConsumo, apiBuscarStatusFixacao } from "./pendenciaBayerService.js";
|
|
5
5
|
import { apiFindAllRetencao } from "./retencaoBayerService.js";
|
|
@@ -23,7 +23,9 @@ export {
|
|
|
23
23
|
apiFindAllEntregaBayer,
|
|
24
24
|
apiFindAllRetencao,
|
|
25
25
|
apiFindEntrega,
|
|
26
|
+
apiFindEntregaBayerMetrics,
|
|
26
27
|
apiGetRoyaltiesBusinessPartner,
|
|
28
|
+
apiGetTransacoesEntrega,
|
|
27
29
|
apiSomatorioEntrega
|
|
28
30
|
};
|
|
29
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getBaseTableParams } from "../../../services/query.js";
|
|
2
|
+
import { create } from "zustand";
|
|
3
|
+
const baseTableParams = getBaseTableParams();
|
|
4
|
+
const initialState = {
|
|
5
|
+
filterParams: {},
|
|
6
|
+
tableParams: baseTableParams
|
|
7
|
+
};
|
|
8
|
+
const useDadosUnificadosListStore = create((set) => ({
|
|
9
|
+
...initialState,
|
|
10
|
+
setFilterParams: (payload) => set(() => ({ filterParams: payload })),
|
|
11
|
+
setTableParams: (payload) => set(() => ({ tableParams: payload }))
|
|
12
|
+
}));
|
|
13
|
+
export {
|
|
14
|
+
useDadosUnificadosListStore
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=dadosUnificadosListStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dadosUnificadosListStore.js","sources":["../../../../../lib/base/store/crm/dadosUnificados/dadosUnificadosListStore.tsx"],"sourcesContent":["import { TDadosUnificados } from '@base/@types/models/crm/DadosUnificados'\nimport { IListStoreAction, IListStoreState } from '@base/@types/store'\nimport { getBaseTableParams } from '@base/services/query'\nimport { create } from 'zustand'\n\nconst baseTableParams = getBaseTableParams()\n\nconst initialState: IListStoreState<TDadosUnificados> = {\n filterParams: {},\n tableParams: baseTableParams,\n}\n\nexport const useDadosUnificadosListStore = create<\n IListStoreState<TDadosUnificados> & IListStoreAction<TDadosUnificados>\n>((set) => ({\n ...initialState,\n setFilterParams: (payload) => set(() => ({ filterParams: payload })),\n setTableParams: (payload) => set(() => ({ tableParams: payload })),\n}))"],"names":[],"mappings":";;AAKA,MAAM,kBAAkB,mBAAA;AAExB,MAAM,eAAkD;AAAA,EACpD,cAAc,CAAA;AAAA,EACd,aAAa;AACjB;AAEO,MAAM,8BAA8B,OAEzC,CAAC,SAAS;AAAA,EACR,GAAG;AAAA,EACH,iBAAiB,CAAC,YAAY,IAAI,OAAO,EAAE,cAAc,UAAU;AAAA,EACnE,gBAAgB,CAAC,YAAY,IAAI,OAAO,EAAE,aAAa,UAAU;AACrE,EAAE;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { IconType } from 'react-icons'
|
|
2
|
+
|
|
3
|
+
export interface MetricCardProps {
|
|
4
|
+
title: string
|
|
5
|
+
value: string | number
|
|
6
|
+
color: string
|
|
7
|
+
icon: IconType
|
|
8
|
+
iconSize?: number
|
|
9
|
+
iconBgClass?: string
|
|
10
|
+
className?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const MetricCard = ({
|
|
14
|
+
title,
|
|
15
|
+
value,
|
|
16
|
+
color,
|
|
17
|
+
icon: Icon,
|
|
18
|
+
iconSize = 24,
|
|
19
|
+
iconBgClass = 'bg-gray-900 text-white',
|
|
20
|
+
className = '',
|
|
21
|
+
}: MetricCardProps) => (
|
|
22
|
+
<div
|
|
23
|
+
className={`p-4 rounded-2xl flex flex-col justify-center ${color} min-w-[200px] flex-1 text-left overflow-hidden ${className}`}
|
|
24
|
+
>
|
|
25
|
+
<div className="mb-4 text-gray-900 font-bold text-left">{title}</div>
|
|
26
|
+
<div className="flex justify-between items-center relative gap-2">
|
|
27
|
+
<div className="min-w-0 flex-1">
|
|
28
|
+
<span
|
|
29
|
+
className="text-2xl font-bold text-gray-900 block truncate"
|
|
30
|
+
title={String(value)}
|
|
31
|
+
>
|
|
32
|
+
{value}
|
|
33
|
+
</span>
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
className={`flex items-center justify-center min-h-12 min-w-12 max-h-12 max-w-12 rounded-full text-2xl ${iconBgClass}`}
|
|
37
|
+
>
|
|
38
|
+
<Icon size={iconSize} />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
export default MetricCard
|
|
@@ -18,6 +18,7 @@ export { default as GrowShrinkValue } from './GrowShrinkValue'
|
|
|
18
18
|
export { default as IconText } from './IconText'
|
|
19
19
|
export { default as ImageGallery } from './ImageGallery'
|
|
20
20
|
export { default as Masonry } from './Masonry'
|
|
21
|
+
export { default as MetricCard } from './MetricCard'
|
|
21
22
|
export { default as NavToggle } from './NavToggle'
|
|
22
23
|
export { default as NumericInput } from './NumericInput'
|
|
23
24
|
export { default as OtpInput } from './OtpInput'
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export interface TFindAllRetencaoResponse {
|
|
2
2
|
id: number;
|
|
3
3
|
entregaId: number;
|
|
4
|
+
liquidacaoId: number;
|
|
4
5
|
fixacaoId: string;
|
|
5
6
|
cnpjFilial: string;
|
|
6
7
|
documentoProdutor: string;
|
|
7
8
|
quantidadeRetida: number;
|
|
8
9
|
status: 'SUCCEEDED' | 'REGISTERED' | 'ERROR';
|
|
10
|
+
statusOrbe: 'CONCLUIDO' | 'CANCELADO' | 'ERRO';
|
|
9
11
|
dataCriacao: string;
|
|
10
12
|
}
|
|
@@ -87,3 +87,19 @@ export interface AtualizarQuantidadesEntregaRequest {
|
|
|
87
87
|
quantidadeRetida: number;
|
|
88
88
|
quantidadeBaixadaConsumida: number;
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
export enum StatusTransacaoEntrega {
|
|
92
|
+
CONSUMO = 'CONSUMO',
|
|
93
|
+
ESTORNO = 'ESTORNO',
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface TTransacaoEntregaResponse {
|
|
97
|
+
id: number;
|
|
98
|
+
entregaId: number;
|
|
99
|
+
saldoEntradaGraosId: number;
|
|
100
|
+
liquidacaoId: number;
|
|
101
|
+
quantidadeBaixadaConsumida: number;
|
|
102
|
+
quantidadeRetida: number;
|
|
103
|
+
statusTransacaoEntrega: StatusTransacaoEntrega;
|
|
104
|
+
dataTransacao: string;
|
|
105
|
+
}
|
|
@@ -10,6 +10,8 @@ const entregaBayer = {
|
|
|
10
10
|
aplicarRetencao: () => '/bayer/api/entregas/aplicar-retencao',
|
|
11
11
|
cancelarEntrega: (id: number) => `/bayer/api/entregas/${id}/cancelar`,
|
|
12
12
|
atualizarQuantidades: (id: number) => `/bayer/api/entregas/${id}/quantidades`,
|
|
13
|
+
transacoes: (id: number) => `/bayer/api/entregas/${id}/transacoes`,
|
|
14
|
+
metrics: (params?: string) => `/bayer/api/entregas/metrics?${params ?? ''}`,
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export default entregaBayer
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { findByCpfCnpj } from '@base/services/modules/crm/DadosUnificadosService'
|
|
2
|
+
import { useDadosUnificadosListStore } from '@base/store/crm/dadosUnificados/dadosUnificadosListStore'
|
|
3
|
+
import useSWR from 'swr'
|
|
4
|
+
|
|
5
|
+
export default function useDadosUnificadosList() {
|
|
6
|
+
const { tableParams, filterParams, setTableParams, setFilterParams } =
|
|
7
|
+
useDadosUnificadosListStore((state) => state);
|
|
8
|
+
|
|
9
|
+
// Extrai o CPF/CNPJ dos filterParams para usar na busca
|
|
10
|
+
const cpfCnpj = filterParams.cpfCnpj as number;
|
|
11
|
+
|
|
12
|
+
const { data, error, isLoading, mutate } = useSWR(
|
|
13
|
+
cpfCnpj ? ['/api/crm/dados-unificados/{cpfCnpj}', cpfCnpj] : null,
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
([_, cpfCnpjParam]) => findByCpfCnpj(cpfCnpjParam),
|
|
16
|
+
{
|
|
17
|
+
revalidateOnFocus: false,
|
|
18
|
+
},
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
const dadosUnificadosList = data || [];
|
|
22
|
+
|
|
23
|
+
const dadosUnificadosListTotal = (data as any)?.length || 0;
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
data,
|
|
27
|
+
dadosUnificadosList,
|
|
28
|
+
dadosUnificadosListTotal,
|
|
29
|
+
error,
|
|
30
|
+
isLoading,
|
|
31
|
+
tableParams,
|
|
32
|
+
filterParams,
|
|
33
|
+
mutate,
|
|
34
|
+
setTableParams,
|
|
35
|
+
setFilterParams,
|
|
36
|
+
};
|
|
37
|
+
}
|
package/lib/base/hooks/index.ts
CHANGED
|
@@ -73,4 +73,5 @@ export { default as useIdleTimeout } from './useIdleTimeout';
|
|
|
73
73
|
export { default as useFindProdutosByDepositoList } from './dm/produto/useFindProdutosByDepositoList';
|
|
74
74
|
export { default as useFindPrecoMedioProdutosList } from './insumos/itemCompra/useFindPrecoMedioProdutosList';
|
|
75
75
|
export { default as useBusinessPartnerFindMonitorTransportadoraList } from './dm/businessPartner/useBusinessPartnerFindMonitorTransportadoraList';
|
|
76
|
-
export { default as useSapFindUniaoUtilizacaoLimiteCreditoByBusinessPartner } from './sap/uniaoUtilizacaoLimiteCredito/useSapFindUniaoUtilizacaoLimiteCreditoByCliente';
|
|
76
|
+
export { default as useSapFindUniaoUtilizacaoLimiteCreditoByBusinessPartner } from './sap/uniaoUtilizacaoLimiteCredito/useSapFindUniaoUtilizacaoLimiteCreditoByCliente';
|
|
77
|
+
export { default as useDadosUnificadosList } from './crm/dadosUnificados/useDadosUnificadosList';
|
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
QuantidadeConsumidaPorSaldoEntradaGraosRequest,
|
|
11
11
|
QuantidadeASerRetidaPorSaldoResponse,
|
|
12
12
|
AplicarRetencaoResponse,
|
|
13
|
-
AtualizarQuantidadesEntregaRequest
|
|
13
|
+
AtualizarQuantidadesEntregaRequest,
|
|
14
|
+
TTransacaoEntregaResponse
|
|
14
15
|
} from "@base/@types/api/response/bayer/types";
|
|
16
|
+
import { TFindAllMetricsEntregaBayerResponse } from "@base/@types/api/response/bayer/TFindAllMetricsEntregaBayerResponse";
|
|
15
17
|
|
|
16
18
|
const ENTREGA_BAYER_ENDPOINT = endpointNavigationConfig.bayer.entregaBayer;
|
|
17
19
|
|
|
@@ -96,3 +98,17 @@ export async function apiAtualizarQuantidadesEntrega(id: number, data: Atualizar
|
|
|
96
98
|
data,
|
|
97
99
|
});
|
|
98
100
|
}
|
|
101
|
+
|
|
102
|
+
export async function apiFindEntregaBayerMetrics(params?: string) {
|
|
103
|
+
return ApiService.fetchDataWithAxios<TFindAllMetricsEntregaBayerResponse>({
|
|
104
|
+
url: ENTREGA_BAYER_ENDPOINT.metrics(params),
|
|
105
|
+
method: 'get',
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export async function apiGetTransacoesEntrega(id: number) {
|
|
110
|
+
return ApiService.fetchDataWithAxios<TTransacaoEntregaResponse[]>({
|
|
111
|
+
url: ENTREGA_BAYER_ENDPOINT.transacoes(id),
|
|
112
|
+
method: 'get',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TDadosUnificados } from '@base/@types/models/crm/DadosUnificados'
|
|
2
|
+
import { IListStoreAction, IListStoreState } from '@base/@types/store'
|
|
3
|
+
import { getBaseTableParams } from '@base/services/query'
|
|
4
|
+
import { create } from 'zustand'
|
|
5
|
+
|
|
6
|
+
const baseTableParams = getBaseTableParams()
|
|
7
|
+
|
|
8
|
+
const initialState: IListStoreState<TDadosUnificados> = {
|
|
9
|
+
filterParams: {},
|
|
10
|
+
tableParams: baseTableParams,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const useDadosUnificadosListStore = create<
|
|
14
|
+
IListStoreState<TDadosUnificados> & IListStoreAction<TDadosUnificados>
|
|
15
|
+
>((set) => ({
|
|
16
|
+
...initialState,
|
|
17
|
+
setFilterParams: (payload) => set(() => ({ filterParams: payload })),
|
|
18
|
+
setTableParams: (payload) => set(() => ({ tableParams: payload })),
|
|
19
|
+
}))
|
package/package.json
CHANGED