@orbe-agro/client-core 5.3.112 → 5.3.113
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/models/commodities/pedidoVenda.d.ts +3 -0
- package/dist/@types/base/@types/models/commodities/pedidoVenda.d.ts.map +1 -1
- package/dist/@types/base/@types/models/racao/pedidoVenda.d.ts +4 -1
- package/dist/@types/base/@types/models/racao/pedidoVenda.d.ts.map +1 -1
- package/dist/@types/base/@types/store/dm/businessPartner/findAreasVendasCliente/index.d.ts +12 -0
- package/dist/@types/base/@types/store/dm/businessPartner/findAreasVendasCliente/index.d.ts.map +1 -0
- package/dist/@types/base/configs/endpoints.config/dm/config/businessPartner.d.ts +4 -0
- package/dist/@types/base/configs/endpoints.config/dm/config/businessPartner.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/dm/config/produto.d.ts +4 -0
- package/dist/@types/base/configs/endpoints.config/dm/config/produto.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/dm/dm.d.ts +8 -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 +8 -0
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts.map +1 -1
- package/dist/@types/base/hooks/dm/businessPartner/useFindSalesAreasByBusinessPartnerAndSetorAtividadeList.d.ts +12 -0
- package/dist/@types/base/hooks/dm/businessPartner/useFindSalesAreasByBusinessPartnerAndSetorAtividadeList.d.ts.map +1 -0
- package/dist/@types/base/hooks/dm/produto/useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList.d.ts +12 -0
- package/dist/@types/base/hooks/dm/produto/useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList.d.ts.map +1 -0
- package/dist/@types/base/hooks/index.d.ts +2 -0
- package/dist/@types/base/hooks/index.d.ts.map +1 -1
- package/dist/@types/base/services/modules/dm/businessPartner/BusinessPartnerService.d.ts +2 -1
- package/dist/@types/base/services/modules/dm/businessPartner/BusinessPartnerService.d.ts.map +1 -1
- package/dist/@types/base/services/modules/dm/produto/ProdutoService.d.ts +1 -0
- package/dist/@types/base/services/modules/dm/produto/ProdutoService.d.ts.map +1 -1
- package/dist/@types/base/store/dm/businesPartner/businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore.d.ts +4 -0
- package/dist/@types/base/store/dm/businesPartner/businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore.d.ts.map +1 -0
- package/dist/base/@types/models/commodities/pedidoVenda.js.map +1 -1
- package/dist/base/@types/models/racao/pedidoVenda.js.map +1 -1
- package/dist/base/@types/store/dm/businessPartner/findAreasVendasCliente/index.js +2 -0
- package/dist/base/@types/store/dm/businessPartner/findAreasVendasCliente/index.js.map +1 -0
- package/dist/base/configs/endpoints.config/dm/config/businessPartner.js +2 -1
- package/dist/base/configs/endpoints.config/dm/config/businessPartner.js.map +1 -1
- package/dist/base/configs/endpoints.config/dm/config/produto.js +2 -1
- package/dist/base/configs/endpoints.config/dm/config/produto.js.map +1 -1
- package/dist/base/hooks/dm/businessPartner/useFindSalesAreasByBusinessPartnerAndSetorAtividadeList.js +32 -0
- package/dist/base/hooks/dm/businessPartner/useFindSalesAreasByBusinessPartnerAndSetorAtividadeList.js.map +1 -0
- package/dist/base/hooks/dm/produto/useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList.js +32 -0
- package/dist/base/hooks/dm/produto/useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList.js.map +1 -0
- package/dist/base/hooks/index.js +78 -74
- package/dist/base/hooks/index.js.map +1 -1
- package/dist/base/index.js +475 -469
- package/dist/base/index.js.map +1 -1
- package/dist/base/services/index.js +363 -361
- package/dist/base/services/modules/dm/businessPartner/BusinessPartnerService.js +29 -22
- package/dist/base/services/modules/dm/businessPartner/BusinessPartnerService.js.map +1 -1
- package/dist/base/services/modules/dm/index.js +67 -65
- package/dist/base/services/modules/dm/produto/ProdutoService.js +19 -12
- package/dist/base/services/modules/dm/produto/ProdutoService.js.map +1 -1
- package/dist/base/services/modules/index.js +361 -359
- package/dist/base/store/dm/businesPartner/businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore.js +14 -0
- package/dist/base/store/dm/businesPartner/businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore.js.map +1 -0
- package/lib/base/@types/models/commodities/pedidoVenda.ts +3 -0
- package/lib/base/@types/models/racao/pedidoVenda.ts +4 -1
- package/lib/base/@types/store/dm/businessPartner/findAreasVendasCliente/index.ts +15 -0
- package/lib/base/configs/endpoints.config/dm/config/businessPartner.ts +1 -0
- package/lib/base/configs/endpoints.config/dm/config/produto.ts +2 -1
- package/lib/base/hooks/dm/businessPartner/useFindSalesAreasByBusinessPartnerAndSetorAtividadeList.tsx +43 -0
- package/lib/base/hooks/dm/produto/useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList.tsx +43 -0
- package/lib/base/hooks/index.ts +2 -0
- package/lib/base/services/modules/dm/businessPartner/BusinessPartnerService.ts +8 -1
- package/lib/base/services/modules/dm/produto/ProdutoService.ts +7 -0
- package/lib/base/store/dm/businesPartner/businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore.ts +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getBaseTableParams as s } from "../../../services/query.js";
|
|
2
|
+
import { create as r } from "zustand";
|
|
3
|
+
const t = s(), n = {
|
|
4
|
+
filterParamsAreasVendasCliente: {},
|
|
5
|
+
tableParamsAreasVendasCliente: t
|
|
6
|
+
}, m = r((a) => ({
|
|
7
|
+
...n,
|
|
8
|
+
setFilterParamsAreasVendasCliente: (e) => a(() => ({ filterParamsAreasVendasCliente: e })),
|
|
9
|
+
setTableParamsAreasVendasCliente: (e) => a(() => ({ tableParamsAreasVendasCliente: e }))
|
|
10
|
+
}));
|
|
11
|
+
export {
|
|
12
|
+
m as useBusinessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore.js","sources":["../../../../../lib/base/store/dm/businesPartner/businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore.ts"],"sourcesContent":["import { TBusinessPartner } from '@base/@types/models/dm/businessPartner'\nimport { IListStoreAction, IListStoreState } from '@base/@types/store/dm/businessPartner/findAreasVendasCliente'\nimport { getBaseTableParams } from '@base/services/query'\nimport { create } from 'zustand'\n\nconst baseTableParams = getBaseTableParams()\n\nconst initialState: IListStoreState<TBusinessPartner> = {\n filterParamsAreasVendasCliente: {},\n tableParamsAreasVendasCliente: baseTableParams,\n}\n\nexport const useBusinessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore = create<\n IListStoreState<TBusinessPartner> & IListStoreAction<TBusinessPartner>\n>((set) => ({\n ...initialState,\n setFilterParamsAreasVendasCliente: (payload) => set(() => ({ filterParamsAreasVendasCliente: payload })),\n setTableParamsAreasVendasCliente: (payload) => set(() => ({ tableParamsAreasVendasCliente: payload })),\n}))"],"names":["baseTableParams","getBaseTableParams","initialState","useBusinessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore","create","set","payload"],"mappings":";;AAKA,MAAMA,IAAkBC,EAAA,GAElBC,IAAkD;AAAA,EACpD,gCAAgC,CAAA;AAAA,EAChC,+BAA+BF;AACnC,GAEaG,IAA8EC,EAEzF,CAACC,OAAS;AAAA,EACR,GAAGH;AAAA,EACH,mCAAmC,CAACI,MAAYD,EAAI,OAAO,EAAE,gCAAgCC,IAAU;AAAA,EACvG,kCAAkC,CAACA,MAAYD,EAAI,OAAO,EAAE,+BAA+BC,IAAU;AACzG,EAAE;"}
|
|
@@ -42,12 +42,15 @@ export type TClientePedidoVenda = {
|
|
|
42
42
|
centroId: number
|
|
43
43
|
organizacaoVendaCodigo: string
|
|
44
44
|
canalDistribuicaoCodigo: string
|
|
45
|
+
setorAtividadeId: number
|
|
45
46
|
setorAtividadeCodigo: string
|
|
46
47
|
escritorioVendaCodigo?: string
|
|
47
48
|
equipeVendaCodigo?: string
|
|
48
49
|
vendedorId?: number
|
|
49
50
|
recebedorId?: number
|
|
50
51
|
emissorId?: number
|
|
52
|
+
emissorCodigo?: string
|
|
53
|
+
areasVendasClienteId: number
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
export type TCondicaoFretePedidoVenda = {
|
|
@@ -51,16 +51,19 @@ export type TPedidoVenda = {
|
|
|
51
51
|
|
|
52
52
|
export type TClientePedidoVenda = {
|
|
53
53
|
id?: number
|
|
54
|
-
tipoOrdemVendaId
|
|
54
|
+
tipoOrdemVendaId: number
|
|
55
55
|
centroId: number
|
|
56
56
|
organizacaoVendaCodigo: string
|
|
57
57
|
canalDistribuicaoCodigo: string
|
|
58
|
+
setorAtividadeId: number
|
|
58
59
|
setorAtividadeCodigo: string
|
|
59
60
|
escritorioVendaCodigo?: string
|
|
60
61
|
equipeVendaCodigo?: string
|
|
61
62
|
vendedorId?: number
|
|
62
63
|
recebedorId?: number
|
|
63
64
|
emissorId?: number
|
|
65
|
+
emissorCodigo?: string
|
|
66
|
+
areasVendasClienteId: number
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
export type TCondicaoFretePedidoVenda = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IFilterParams, ITableParams } from '../../../../api'
|
|
2
|
+
|
|
3
|
+
export interface IListStoreState<T> {
|
|
4
|
+
tableParamsAreasVendasCliente: ITableParams
|
|
5
|
+
filterParamsAreasVendasCliente: IFilterParams
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IListStoreAction<T> {
|
|
9
|
+
setFilterParamsAreasVendasCliente: (payload: IFilterParams) => void
|
|
10
|
+
setTableParamsAreasVendasCliente: (payload: ITableParams) => void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IListStore<T>
|
|
14
|
+
extends IListStoreState<T>,
|
|
15
|
+
IListStoreAction<T> {}
|
|
@@ -12,6 +12,7 @@ const businessPartner = {
|
|
|
12
12
|
findBusinessPartnerFuncoesParceirosClientes: { endpoint: `${BUSINESS_PARTNER_BASE_URL}/find-bp-vinculo-funcao-parceiros-clientes`, method: 'post' },
|
|
13
13
|
findBusinessPartnerFuncoesParceirosFornecedores: { endpoint: `${BUSINESS_PARTNER_BASE_URL}/find-bp-vinculo-funcao-parceiros-fornecedores`, method: 'post' },
|
|
14
14
|
findBusinessPartnerByClientOrSupplierFunction: { endpoint: `${BUSINESS_PARTNER_BASE_URL}/find-vendedores-aka-representantes-vendas`, method: 'get' },
|
|
15
|
+
findSalesAreasByBusinessPartnerAndSetorAtividade: { endpoint: `${BUSINESS_PARTNER_BASE_URL}/find-sales-areas-client-by-business-partner-and-setor-atividade/`, method: 'get' },
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export default businessPartner
|
|
@@ -6,7 +6,8 @@ const produto = {
|
|
|
6
6
|
findProdutosIsPrecificadoRacao: { endpoint: `${PRODUTO_BASE_URL}/find-produto-is-precificado-racao`, method: 'post' },
|
|
7
7
|
findProdutosByGrupoProduto: { endpoint: `${PRODUTO_BASE_URL}/find-produtos-by-grupo-produto`, method: 'post' },
|
|
8
8
|
findMonitor: { endpoint: `${PRODUTO_BASE_URL}/find-monitor`, httpMethod: 'post' },
|
|
9
|
-
validaProdutoByEmissorPedidoVenda: { endpoint: `${PRODUTO_BASE_URL}/valida-produto-by-emissor-pedido-venda/`, method: '
|
|
9
|
+
validaProdutoByEmissorPedidoVenda: { endpoint: `${PRODUTO_BASE_URL}/valida-produto-by-emissor-pedido-venda/`, method: 'get' },
|
|
10
|
+
findProdutosByCanalDistribuicaoAndOrganizacaoVenda: { endpoint: `${PRODUTO_BASE_URL}/find-produtos-by-canal-distribuicao-and-organizacao-venda/`, method: 'get' },
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export default produto
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { apiFindDmFindSalesAreasByBusinessPartnerAndSetorAtividade } from '@base/services/modules/dm/businessPartner/BusinessPartnerService'
|
|
2
|
+
import { useBusinessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore } from '@base/store/dm/businesPartner/businessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore'
|
|
3
|
+
import useSWR from 'swr'
|
|
4
|
+
|
|
5
|
+
export default function useFindSalesAreasByBusinessPartnerAndSetorAtividadeList() {
|
|
6
|
+
const { tableParamsAreasVendasCliente, filterParamsAreasVendasCliente, setTableParamsAreasVendasCliente, setFilterParamsAreasVendasCliente } =
|
|
7
|
+
useBusinessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore((state) => state)
|
|
8
|
+
|
|
9
|
+
const businessPartner = filterParamsAreasVendasCliente?.businessPartner
|
|
10
|
+
const setorAtividade = filterParamsAreasVendasCliente?.setorAtividade
|
|
11
|
+
|
|
12
|
+
const { data, error, isLoading, mutate } = useSWR(
|
|
13
|
+
businessPartner && setorAtividade
|
|
14
|
+
? [
|
|
15
|
+
`/api/dm/business-partner/find-sales-areas-client-by-business-partner-and-setor-atividade/${businessPartner}/${setorAtividade}`,
|
|
16
|
+
businessPartner,
|
|
17
|
+
setorAtividade,
|
|
18
|
+
]
|
|
19
|
+
: null,
|
|
20
|
+
([, businessPartner, setorAtividade]: [string, string, string]) =>
|
|
21
|
+
apiFindDmFindSalesAreasByBusinessPartnerAndSetorAtividade(
|
|
22
|
+
businessPartner,
|
|
23
|
+
setorAtividade,
|
|
24
|
+
),
|
|
25
|
+
{ revalidateOnFocus: false },
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
const salesAreasClientByBPAndSetorAtividadeList = data || []
|
|
29
|
+
|
|
30
|
+
const salesAreasClientByBPAndSetorAtividadeListTotal = data?.length || 0
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
salesAreasClientByBPAndSetorAtividadeList,
|
|
34
|
+
salesAreasClientByBPAndSetorAtividadeListTotal,
|
|
35
|
+
error,
|
|
36
|
+
isLoading,
|
|
37
|
+
tableParamsAreasVendasCliente,
|
|
38
|
+
filterParamsAreasVendasCliente,
|
|
39
|
+
mutate,
|
|
40
|
+
setTableParamsAreasVendasCliente,
|
|
41
|
+
setFilterParamsAreasVendasCliente,
|
|
42
|
+
}
|
|
43
|
+
}
|
package/lib/base/hooks/dm/produto/useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList.tsx
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { apiFindDmFindProdutosByCanalDistribuicaoAndOrganizacaoVenda } from '@base/services/modules/dm/produto/ProdutoService'
|
|
2
|
+
import { useProdutoListStoreUseMulti } from '@base/store/dm/produto/produtoListStoreUseMulti'
|
|
3
|
+
import useSWR from 'swr'
|
|
4
|
+
|
|
5
|
+
export default function useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList() {
|
|
6
|
+
const { tableParamsProduto, filterParamsProduto, setTableParamsProduto, setFilterParamsProduto } =
|
|
7
|
+
useProdutoListStoreUseMulti((state) => state)
|
|
8
|
+
|
|
9
|
+
const canalDistribuicao = filterParamsProduto?.canalDistribuicao
|
|
10
|
+
const organizacaoVenda = filterParamsProduto?.organizacaoVenda
|
|
11
|
+
|
|
12
|
+
const { data, error, isLoading, mutate } = useSWR(
|
|
13
|
+
canalDistribuicao && organizacaoVenda
|
|
14
|
+
? [
|
|
15
|
+
`/api/dm/produto/find-produtos-by-canal-distribuicao-and-organizacao-venda/${canalDistribuicao}/${organizacaoVenda}`,
|
|
16
|
+
canalDistribuicao,
|
|
17
|
+
organizacaoVenda
|
|
18
|
+
]
|
|
19
|
+
: null,
|
|
20
|
+
([, canalDistribuicao, organizacaoVenda]: [string, string, string]) =>
|
|
21
|
+
apiFindDmFindProdutosByCanalDistribuicaoAndOrganizacaoVenda(
|
|
22
|
+
canalDistribuicao,
|
|
23
|
+
organizacaoVenda
|
|
24
|
+
),
|
|
25
|
+
{ revalidateOnFocus: false },
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
const produtosByCanalDistribuicaoAndOrganizacaoVendaList = data || []
|
|
29
|
+
|
|
30
|
+
const produtosByCanalDistribuicaoAndOrganizacaoVendaListTotal = data?.length || 0
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
produtosByCanalDistribuicaoAndOrganizacaoVendaList,
|
|
34
|
+
produtosByCanalDistribuicaoAndOrganizacaoVendaListTotal,
|
|
35
|
+
error,
|
|
36
|
+
isLoading,
|
|
37
|
+
tableParamsProduto,
|
|
38
|
+
filterParamsProduto,
|
|
39
|
+
mutate,
|
|
40
|
+
setTableParamsProduto,
|
|
41
|
+
setFilterParamsProduto,
|
|
42
|
+
}
|
|
43
|
+
}
|
package/lib/base/hooks/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { default as useBusinessPartnerFuncoesParceirosFornecedoresList } from '.
|
|
|
10
10
|
export { default as useBusinessPartnerList } from './dm/businessPartner/useBusinessPartnerList';
|
|
11
11
|
export { default as useBusinessPartnerMatrizesList } from './dm/businessPartner/useBusinessPartnerMatrizesList';
|
|
12
12
|
export { default as useVendedoresAKARepresentantesVendasList } from './dm/businessPartner/useVendedoresAKARepresentantesVendasList';
|
|
13
|
+
export { default as useFindSalesAreasByBusinessPartnerAndSetorAtividadeList} from './dm/businessPartner/useFindSalesAreasByBusinessPartnerAndSetorAtividadeList';
|
|
13
14
|
export { default as useCanalDistribuicaoByCodigoList } from './dm/canalDistribuicao/useCanalDistribuicaoByCodigoList';
|
|
14
15
|
export { default as useCanalDistribuicaoList } from './dm/canalDistribuicao/useCanalDistribuicaoList';
|
|
15
16
|
export { default as useCentroByCodigoList } from './dm/centro/useCentroByCodigoList';
|
|
@@ -30,6 +31,7 @@ export { default as useGrupoVendaList } from './dm/grupoVenda/useGrupoVendaList'
|
|
|
30
31
|
export { default as useIncotermsList } from './dm/incoterms/useIncotermsList';
|
|
31
32
|
export { default as useMunicipioByCodigoList } from './dm/municipio/useMunicipioByCodigoList';
|
|
32
33
|
export { default as useMunicipioList } from './dm/municipio/useMunicipioList';
|
|
34
|
+
export { default as useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList } from './dm/produto/useFindProdutosByCanalDistribuicaoAndOrganizacaoVendaList';
|
|
33
35
|
export { default as useProdutoByCodigoList } from './dm/produto/useProdutoByCodigoList';
|
|
34
36
|
export { default as useProdutoByGrupoProdutoList } from './dm/produto/useProdutoByGrupoProdutoList';
|
|
35
37
|
export { default as useProdutoFindList } from './dm/produto/useProdutoFindList';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ApiService from "@/services/ApiService";
|
|
2
2
|
import { IFilterParams, TQueryResponse } from "@base/@types/api";
|
|
3
|
-
import { TBusinessPartner } from "@base/@types/models/dm/businessPartner";
|
|
3
|
+
import { TAreaVendaCliente, TBusinessPartner } from "@base/@types/models/dm/businessPartner";
|
|
4
4
|
import { endpointsConfig } from "@base/configs";
|
|
5
5
|
|
|
6
6
|
const BUSINESS_PARTNER_ENDPOINT = endpointsConfig.dm.businessPartner;
|
|
@@ -108,4 +108,11 @@ export async function apiFindDmVendedoresAKARepresentantesVendas(data = {}) {
|
|
|
108
108
|
method: BUSINESS_PARTNER_ENDPOINT.findBusinessPartnerByClientOrSupplierFunction.method,
|
|
109
109
|
data,
|
|
110
110
|
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export async function apiFindDmFindSalesAreasByBusinessPartnerAndSetorAtividade(businessPartner: string, setorAtividade: string) {
|
|
114
|
+
return ApiService.fetchDataWithAxios<TAreaVendaCliente[]>({
|
|
115
|
+
url: BUSINESS_PARTNER_ENDPOINT.findSalesAreasByBusinessPartnerAndSetorAtividade.endpoint + `${businessPartner}/` + `${setorAtividade}`,
|
|
116
|
+
method: BUSINESS_PARTNER_ENDPOINT.findSalesAreasByBusinessPartnerAndSetorAtividade.method,
|
|
117
|
+
})
|
|
111
118
|
}
|
|
@@ -68,4 +68,11 @@ export async function apiFindDmValidaProdutoByEmissorPedidoVenda(organizacaoVend
|
|
|
68
68
|
url: PRODUTO_ENDPOINT.validaProdutoByEmissorPedidoVenda.endpoint + `${organizacaoVenda}/` + `${canalDistribuicao}/` + `${produtoId}`,
|
|
69
69
|
method: PRODUTO_ENDPOINT.validaProdutoByEmissorPedidoVenda.method,
|
|
70
70
|
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export async function apiFindDmFindProdutosByCanalDistribuicaoAndOrganizacaoVenda(canalDistribuicao: string, organizacaoVenda: string) {
|
|
74
|
+
return ApiService.fetchDataWithAxios<TProduto[]>({
|
|
75
|
+
url: PRODUTO_ENDPOINT.findProdutosByCanalDistribuicaoAndOrganizacaoVenda.endpoint + `${canalDistribuicao}/` + `${organizacaoVenda}`,
|
|
76
|
+
method: PRODUTO_ENDPOINT.findProdutosByCanalDistribuicaoAndOrganizacaoVenda.method,
|
|
77
|
+
})
|
|
71
78
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TBusinessPartner } from '@base/@types/models/dm/businessPartner'
|
|
2
|
+
import { IListStoreAction, IListStoreState } from '@base/@types/store/dm/businessPartner/findAreasVendasCliente'
|
|
3
|
+
import { getBaseTableParams } from '@base/services/query'
|
|
4
|
+
import { create } from 'zustand'
|
|
5
|
+
|
|
6
|
+
const baseTableParams = getBaseTableParams()
|
|
7
|
+
|
|
8
|
+
const initialState: IListStoreState<TBusinessPartner> = {
|
|
9
|
+
filterParamsAreasVendasCliente: {},
|
|
10
|
+
tableParamsAreasVendasCliente: baseTableParams,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const useBusinessPartnerFindSalesAreasByBusinessPartnerAndSetorAtividadeListStore = create<
|
|
14
|
+
IListStoreState<TBusinessPartner> & IListStoreAction<TBusinessPartner>
|
|
15
|
+
>((set) => ({
|
|
16
|
+
...initialState,
|
|
17
|
+
setFilterParamsAreasVendasCliente: (payload) => set(() => ({ filterParamsAreasVendasCliente: payload })),
|
|
18
|
+
setTableParamsAreasVendasCliente: (payload) => set(() => ({ tableParamsAreasVendasCliente: payload })),
|
|
19
|
+
}))
|
package/package.json
CHANGED