@orbe-agro/client-core 5.3.174 → 5.3.176
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/@types/base/@types/api/response/bayer/TFindAllEntregaBayerResponse.d.ts +1 -1
- package/dist/@types/base/@types/api/response/bayer/TRetornoEntregaResponse.d.ts +2 -1
- package/dist/@types/base/@types/api/response/bayer/TRetornoEntregaResponse.d.ts.map +1 -1
- package/dist/@types/base/@types/models/dm/frete.d.ts +14 -0
- package/dist/@types/base/@types/models/dm/frete.d.ts.map +1 -0
- package/dist/@types/base/configs/endpoints.config/dm/config/frete.d.ts +12 -0
- package/dist/@types/base/configs/endpoints.config/dm/config/frete.d.ts.map +1 -0
- package/dist/@types/base/configs/endpoints.config/dm/dm.d.ts +10 -0
- package/dist/@types/base/configs/endpoints.config/dm/dm.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts +10 -0
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts.map +1 -1
- package/dist/@types/base/hooks/dm/frete/useEquipeVendaByOrganizacaoVendasList.d.ts +12 -0
- package/dist/@types/base/hooks/dm/frete/useEquipeVendaByOrganizacaoVendasList.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/dm/frete/FreteService.d.ts +4 -0
- package/dist/@types/base/services/modules/dm/frete/FreteService.d.ts.map +1 -0
- package/dist/@types/base/services/modules/dm/index.d.ts +1 -0
- package/dist/@types/base/services/modules/dm/index.d.ts.map +1 -1
- package/dist/@types/base/store/dm/frete/freteListStore.d.ts +4 -0
- package/dist/@types/base/store/dm/frete/freteListStore.d.ts.map +1 -0
- package/dist/base/@types/models/dm/frete.js +2 -0
- package/dist/base/@types/models/dm/frete.js.map +1 -0
- package/dist/base/configs/api.config.js +11 -11
- package/dist/base/configs/api.config.js.map +1 -1
- package/dist/base/configs/endpoints.config/dm/config/frete.js +8 -0
- package/dist/base/configs/endpoints.config/dm/config/frete.js.map +1 -0
- package/dist/base/configs/endpoints.config/dm/dm.js +13 -11
- package/dist/base/configs/endpoints.config/dm/dm.js.map +1 -1
- package/dist/base/hooks/dm/frete/useEquipeVendaByOrganizacaoVendasList.js +28 -0
- package/dist/base/hooks/dm/frete/useEquipeVendaByOrganizacaoVendasList.js.map +1 -0
- package/dist/base/hooks/index.js +22 -20
- package/dist/base/hooks/index.js.map +1 -1
- package/dist/base/index.js +427 -422
- package/dist/base/index.js.map +1 -1
- package/dist/base/services/index.js +306 -303
- package/dist/base/services/index.js.map +1 -1
- package/dist/base/services/modules/dm/frete/FreteService.js +22 -0
- package/dist/base/services/modules/dm/frete/FreteService.js.map +1 -0
- package/dist/base/services/modules/dm/index.js +9 -6
- package/dist/base/services/modules/dm/index.js.map +1 -1
- package/dist/base/services/modules/index.js +310 -307
- package/dist/base/services/modules/index.js.map +1 -1
- package/dist/base/store/dm/frete/freteListStore.js +14 -0
- package/dist/base/store/dm/frete/freteListStore.js.map +1 -0
- package/lib/base/@types/api/response/bayer/TFindAllEntregaBayerResponse.ts +1 -1
- package/lib/base/@types/api/response/bayer/TRetornoEntregaResponse.ts +2 -1
- package/lib/base/@types/models/dm/frete.ts +14 -0
- package/lib/base/configs/api.config.ts +1 -1
- package/lib/base/configs/endpoints.config/dm/config/frete.ts +8 -0
- package/lib/base/configs/endpoints.config/dm/dm.ts +3 -1
- package/lib/base/hooks/dm/frete/useEquipeVendaByOrganizacaoVendasList.tsx +33 -0
- package/lib/base/hooks/index.ts +1 -0
- package/lib/base/services/modules/dm/frete/FreteService.ts +20 -0
- package/lib/base/services/modules/dm/index.ts +2 -1
- package/lib/base/store/dm/frete/freteListStore.ts +19 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getBaseTableParams as t } from "../../../services/query.js";
|
|
2
|
+
import { create as r } from "zustand";
|
|
3
|
+
const s = t(), m = {
|
|
4
|
+
filterParams: {},
|
|
5
|
+
tableParams: s
|
|
6
|
+
}, o = r((e) => ({
|
|
7
|
+
...m,
|
|
8
|
+
setFilterParams: (a) => e(() => ({ filterParams: a })),
|
|
9
|
+
setTableParams: (a) => e(() => ({ tableParams: a }))
|
|
10
|
+
}));
|
|
11
|
+
export {
|
|
12
|
+
o as useFreteListStore
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=freteListStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freteListStore.js","sources":["../../../../../lib/base/store/dm/frete/freteListStore.ts"],"sourcesContent":["import { TFrete } from '@base/@types/models/dm/frete'\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<TFrete> = {\n filterParams: {},\n tableParams: baseTableParams,\n}\n\nexport const useFreteListStore = create<\n IListStoreState<TFrete> & IListStoreAction<TFrete>\n>((set) => ({\n ...initialState,\n setFilterParams: (payload) => set(() => ({ filterParams: payload })),\n setTableParams: (payload) => set(() => ({ tableParams: payload })),\n}))"],"names":["baseTableParams","getBaseTableParams","initialState","useFreteListStore","create","set","payload"],"mappings":";;AAKA,MAAMA,IAAkBC,EAAmB,GAErCC,IAAwC;AAAA,EAC1C,cAAc,CAAC;AAAA,EACf,aAAaF;AACjB,GAEaG,IAAoBC,EAE/B,CAACC,OAAS;AAAA,EACR,GAAGH;AAAA,EACH,iBAAiB,CAACI,MAAYD,EAAI,OAAO,EAAE,cAAcC,IAAU;AAAA,EACnE,gBAAgB,CAACA,MAAYD,EAAI,OAAO,EAAE,aAAaC,IAAU;AACrE,EAAE;"}
|
|
@@ -10,7 +10,7 @@ export type TFindAllEntregaBayerResponse = {
|
|
|
10
10
|
produtoId?: number | null;
|
|
11
11
|
safraId?: number | null;
|
|
12
12
|
produtorId?: number | null;
|
|
13
|
-
volume?:
|
|
13
|
+
volume?: number | null;
|
|
14
14
|
dataEntrega?: string | null;
|
|
15
15
|
status?: StatusTesteCarga | null;
|
|
16
16
|
retornoEntrega?: TRetornoEntregaResponse | null;
|
|
@@ -6,7 +6,8 @@ export type TRetornoEntregaResponse = {
|
|
|
6
6
|
deliveryId?: string | null;
|
|
7
7
|
bid?: string | null;
|
|
8
8
|
creationDate?: string | null;
|
|
9
|
+
updateDate?: string | null;
|
|
9
10
|
status?: StatusRetornoEntrega | null;
|
|
10
|
-
quantity?:
|
|
11
|
+
quantity?: number | null;
|
|
11
12
|
errors?: TRetornoEntregaErrorResponse[] | null;
|
|
12
13
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type TFrete = {
|
|
2
|
+
id: number;
|
|
3
|
+
organizacaoVendas: string;
|
|
4
|
+
incoterms: string;
|
|
5
|
+
itinerario: string;
|
|
6
|
+
dataValidadeInicio: string; // ISO string
|
|
7
|
+
dataValidadeFim: string; // ISO string
|
|
8
|
+
valor: number;
|
|
9
|
+
moeda: string;
|
|
10
|
+
unidadePreco: string;
|
|
11
|
+
unidadeMedida: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type TFreteFormSchema = TFrete;
|
|
@@ -40,7 +40,7 @@ const getApiUrl = (): string => {
|
|
|
40
40
|
return DEV_API_URL
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const origin = globalThis?.location?.origin
|
|
43
|
+
const origin = globalThis?.location?.origin ?? document?.referrer
|
|
44
44
|
if (origin && (origin.includes(':5173') || origin.includes(':31000'))) {
|
|
45
45
|
const modifiedOrigin = origin
|
|
46
46
|
.replace(':5173', ':8081')
|
|
@@ -21,6 +21,7 @@ import iva from "./config/iva";
|
|
|
21
21
|
import grupoComprador from "./config/grupoComprador";
|
|
22
22
|
import tipoVeiculo from "./config/tipoVeiculo";
|
|
23
23
|
import municipio from "./config/municipio";
|
|
24
|
+
import frete from "./config/frete";
|
|
24
25
|
|
|
25
26
|
const dm = {
|
|
26
27
|
businessPartner,
|
|
@@ -45,7 +46,8 @@ const dm = {
|
|
|
45
46
|
iva,
|
|
46
47
|
grupoComprador,
|
|
47
48
|
tipoVeiculo,
|
|
48
|
-
municipio
|
|
49
|
+
municipio,
|
|
50
|
+
frete
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
export default dm;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { apiFindDmFreteByOrganizacaoVendas } from '@base/services'
|
|
2
|
+
import { useFreteListStore } from '@base/store/dm/frete/freteListStore'
|
|
3
|
+
import useSWR from 'swr'
|
|
4
|
+
|
|
5
|
+
export default function useFreteByOrganizacaoVendasList() {
|
|
6
|
+
const { tableParams, filterParams, setTableParams, setFilterParams } = useFreteListStore((state) => state)
|
|
7
|
+
|
|
8
|
+
const organizacaoVendas = filterParams?.organizacaoVendas
|
|
9
|
+
const incoterms = filterParams?.incoterms
|
|
10
|
+
|
|
11
|
+
const { data, error, isLoading, mutate } = useSWR(
|
|
12
|
+
organizacaoVendas && incoterms ? [`/api/dm/frete/find/${organizacaoVendas}/${incoterms}`, organizacaoVendas, incoterms] : null,
|
|
13
|
+
|
|
14
|
+
([, organizacaoVendas, incoterms]: [string, string, string]) => apiFindDmFreteByOrganizacaoVendas(organizacaoVendas, incoterms),
|
|
15
|
+
{
|
|
16
|
+
revalidateOnFocus: false,
|
|
17
|
+
},
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
const fretesByOrganizacaoVendasList = data || []
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
data,
|
|
24
|
+
fretesByOrganizacaoVendasList,
|
|
25
|
+
error,
|
|
26
|
+
isLoading,
|
|
27
|
+
tableParams,
|
|
28
|
+
filterParams,
|
|
29
|
+
mutate,
|
|
30
|
+
setTableParams,
|
|
31
|
+
setFilterParams,
|
|
32
|
+
}
|
|
33
|
+
}
|
package/lib/base/hooks/index.ts
CHANGED
|
@@ -52,4 +52,5 @@ export { default as useSapFindLimiteCreditoByBusinessPartner} from './sap/limite
|
|
|
52
52
|
export { default as useSapFindLimiteCreditoByBusinessPartnerUseMulti} from './sap/limiteCredito/useSapFindLimiteCreditoByBusinessPartnerUseMulti'
|
|
53
53
|
export { default as useSapCountPartidasVencidasByBusinessPartner} from './sap/partidas/useSapCountPartidasVencidasByBusinessPartner'
|
|
54
54
|
export { default as useSapCountPartidasVencidasByBusinessPartnerUseMulti} from './sap/partidas/useSapCountPartidasVencidasByBusinessPartnerUseMulti'
|
|
55
|
+
export { default as useFreteByOrganizacaoVendasList } from './dm/frete/useEquipeVendaByOrganizacaoVendasList';
|
|
55
56
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ApiService from "@/services/ApiService";
|
|
2
|
+
import { TFrete } from "@base/@types/models/dm/frete";
|
|
3
|
+
import { endpointsConfig } from "@base/configs";
|
|
4
|
+
|
|
5
|
+
const FRETE_ENDPOINT = endpointsConfig.dm.frete;
|
|
6
|
+
|
|
7
|
+
export async function apiFindDmFrete(data = {}) {
|
|
8
|
+
return ApiService.fetchDataWithAxios<TFrete[]>({
|
|
9
|
+
url: FRETE_ENDPOINT.find.endpoint,
|
|
10
|
+
method: FRETE_ENDPOINT.find.method,
|
|
11
|
+
data,
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function apiFindDmFreteByOrganizacaoVendas(organizacaoVendas: string, incoterms: string) {
|
|
16
|
+
return ApiService.fetchDataWithAxios<TFrete>({
|
|
17
|
+
url: FRETE_ENDPOINT.findFreteByOrganizacaoVendas.endpoint + `${organizacaoVendas}/` + `${incoterms}`,
|
|
18
|
+
method: FRETE_ENDPOINT.findFreteByOrganizacaoVendas.method,
|
|
19
|
+
})
|
|
20
|
+
}
|
|
@@ -20,4 +20,5 @@ export * from './iva/IvaService';
|
|
|
20
20
|
export * from './grupoComprador/GrupoCompradorService';
|
|
21
21
|
export * from './tipoOrdemVenda/TipoOrdemVendaService';
|
|
22
22
|
export * from './tipoVeiculo/TipoVeiculoService';
|
|
23
|
-
export * from './municipio/MunicipioService';
|
|
23
|
+
export * from './municipio/MunicipioService';
|
|
24
|
+
export * from './frete/FreteService';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TFrete } from '@base/@types/models/dm/frete'
|
|
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<TFrete> = {
|
|
9
|
+
filterParams: {},
|
|
10
|
+
tableParams: baseTableParams,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const useFreteListStore = create<
|
|
14
|
+
IListStoreState<TFrete> & IListStoreAction<TFrete>
|
|
15
|
+
>((set) => ({
|
|
16
|
+
...initialState,
|
|
17
|
+
setFilterParams: (payload) => set(() => ({ filterParams: payload })),
|
|
18
|
+
setTableParams: (payload) => set(() => ({ tableParams: payload })),
|
|
19
|
+
}))
|
package/package.json
CHANGED