@orbe-agro/client-core 5.3.193 → 5.3.194

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.
Files changed (25) hide show
  1. package/dist/@types/base/@types/models/user.d.ts +1 -0
  2. package/dist/@types/base/@types/models/user.d.ts.map +1 -1
  3. package/dist/@types/base/hooks/dm/centroCusto/useCentroCustoList.d.ts +13 -0
  4. package/dist/@types/base/hooks/dm/centroCusto/useCentroCustoList.d.ts.map +1 -0
  5. package/dist/@types/base/hooks/index.d.ts +1 -0
  6. package/dist/@types/base/hooks/index.d.ts.map +1 -1
  7. package/dist/@types/base/services/modules/dm/centroCusto/CentroCustoService.d.ts +1 -1
  8. package/dist/@types/base/services/modules/dm/centroCusto/CentroCustoService.d.ts.map +1 -1
  9. package/dist/@types/base/store/dm/centroCusto/centroCustoListStore.d.ts +4 -0
  10. package/dist/@types/base/store/dm/centroCusto/centroCustoListStore.d.ts.map +1 -0
  11. package/dist/base/hooks/dm/centroCusto/useCentroCustoList.js +26 -0
  12. package/dist/base/hooks/dm/centroCusto/useCentroCustoList.js.map +1 -0
  13. package/dist/base/hooks/index.js +6 -4
  14. package/dist/base/hooks/index.js.map +1 -1
  15. package/dist/base/index.js +423 -421
  16. package/dist/base/index.js.map +1 -1
  17. package/dist/base/services/modules/dm/centroCusto/CentroCustoService.js.map +1 -1
  18. package/dist/base/store/dm/centroCusto/centroCustoListStore.js +14 -0
  19. package/dist/base/store/dm/centroCusto/centroCustoListStore.js.map +1 -0
  20. package/lib/base/@types/models/user.ts +1 -0
  21. package/lib/base/hooks/dm/centroCusto/useCentroCustoList.tsx +33 -0
  22. package/lib/base/hooks/index.ts +1 -0
  23. package/lib/base/services/modules/dm/centroCusto/CentroCustoService.ts +6 -5
  24. package/lib/base/store/dm/centroCusto/centroCustoListStore.ts +19 -0
  25. 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CentroCustoService.js","sources":["../../../../../../lib/base/services/modules/dm/centroCusto/CentroCustoService.ts"],"sourcesContent":["import ApiService from \"@/services/ApiService\";\nimport { IFilterParams, TQueryResponse } from \"@base/@types/api\";\nimport { endpointsConfig } from \"@base/configs\";\n\nconst CENTRO_CUSTO_ENDPOINT = endpointsConfig.dm.centroCusto;\n\nexport async function apiFindMonitorCentroCusto(body?: IFilterParams) {\n return ApiService.fetchDataWithAxios<TQueryResponse<any>>({\n url: CENTRO_CUSTO_ENDPOINT.findMonitor.endpoint,\n method: CENTRO_CUSTO_ENDPOINT.findMonitor.httpMethod,\n data: body,\n })\n}"],"names":["CENTRO_CUSTO_ENDPOINT","endpointsConfig","apiFindMonitorCentroCusto","body","ApiService"],"mappings":";;;AAIA,MAAMA,IAAwBC,EAAgB,GAAG;AAEjD,eAAsBC,EAA0BC,GAAsB;AAClE,SAAOC,EAAW,mBAAwC;AAAA,IACtD,KAAKJ,EAAsB,YAAY;AAAA,IACvC,QAAQA,EAAsB,YAAY;AAAA,IAC1C,MAAMG;AAAA,EAAA,CACT;AACL;"}
1
+ {"version":3,"file":"CentroCustoService.js","sources":["../../../../../../lib/base/services/modules/dm/centroCusto/CentroCustoService.ts"],"sourcesContent":["import ApiService from '@/services/ApiService'\nimport { IFilterParams, TQueryResponse } from '@base/@types/api'\nimport { TCentroDeCusto } from '@base/@types/models/user'\nimport { endpointsConfig } from '@base/configs'\n\nconst CENTRO_CUSTO_ENDPOINT = endpointsConfig.dm.centroCusto\n\nexport async function apiFindMonitorCentroCusto(body?: IFilterParams) {\n return ApiService.fetchDataWithAxios<TQueryResponse<any>>({\n url: CENTRO_CUSTO_ENDPOINT.findMonitor.endpoint,\n method: CENTRO_CUSTO_ENDPOINT.findMonitor.httpMethod,\n data: body,\n })\n}\n"],"names":["CENTRO_CUSTO_ENDPOINT","endpointsConfig","apiFindMonitorCentroCusto","body","ApiService"],"mappings":";;;AAKA,MAAMA,IAAwBC,EAAgB,GAAG;AAEjD,eAAsBC,EAA0BC,GAAsB;AAClE,SAAOC,EAAW,mBAAwC;AAAA,IACtD,KAAKJ,EAAsB,YAAY;AAAA,IACvC,QAAQA,EAAsB,YAAY;AAAA,IAC1C,MAAMG;AAAA,EAAA,CACT;AACL;"}
@@ -0,0 +1,14 @@
1
+ import { getBaseTableParams as e } from "../../../services/query.js";
2
+ import { create as r } from "zustand";
3
+ const s = e(), m = {
4
+ filterParams: { filter: {} },
5
+ tableParams: s
6
+ }, l = r((t) => ({
7
+ ...m,
8
+ setFilterParams: (a) => t(() => ({ filterParams: a })),
9
+ setTableParams: (a) => t(() => ({ tableParams: a }))
10
+ }));
11
+ export {
12
+ l as useCentroCustoListStore
13
+ };
14
+ //# sourceMappingURL=centroCustoListStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"centroCustoListStore.js","sources":["../../../../../lib/base/store/dm/centroCusto/centroCustoListStore.ts"],"sourcesContent":["import { TCentroDeCusto } from '@base/@types/models/orcamento/CentroDeCusto'\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<TCentroDeCusto> = {\n filterParams: { filter: {} },\n tableParams: baseTableParams,\n}\n\nexport const useCentroCustoListStore = create<\n IListStoreState<TCentroDeCusto> & IListStoreAction<TCentroDeCusto>\n>((set) => ({\n ...initialState,\n setFilterParams: (payload) => set(() => ({ filterParams: payload })),\n setTableParams: (payload) => set(() => ({ tableParams: payload })),\n}))\n"],"names":["baseTableParams","getBaseTableParams","initialState","useCentroCustoListStore","create","set","payload"],"mappings":";;AAKA,MAAMA,IAAkBC,EAAmB,GAErCC,IAAgD;AAAA,EAClD,cAAc,EAAE,QAAQ,GAAG;AAAA,EAC3B,aAAaF;AACjB,GAEaG,IAA0BC,EAErC,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;"}
@@ -44,6 +44,7 @@ export type TRole = {
44
44
  export type TVinculosUsuario = {
45
45
  id?: number
46
46
  vendedorId?: number | null
47
+ centroCustoIds?: number[]
47
48
  }
48
49
 
49
50
  export type TCentroDeCusto = {
@@ -0,0 +1,33 @@
1
+ import { apiFindMonitorCentroCusto } from '@base/services/modules/dm/centroCusto/CentroCustoService'
2
+ import { useCentroCustoListStore } from '@base/store/dm/centroCusto/centroCustoListStore'
3
+ import useSWR from 'swr'
4
+
5
+ export default function useCentroCustoList() {
6
+ const { tableParams, filterParams, setTableParams, setFilterParams } =
7
+ useCentroCustoListStore((state) => state)
8
+
9
+ const swrKey = ['/api/dm/centro-custo/find-monitor', filterParams]
10
+
11
+ const { data, error, isLoading, mutate } = useSWR(
12
+ swrKey,
13
+ () => apiFindMonitorCentroCusto(filterParams),
14
+ { revalidateOnFocus: false },
15
+ )
16
+
17
+ const centrosCustosList = data || []
18
+
19
+ const centrosCustosListTotal = data?.totalElements || 0
20
+
21
+ return {
22
+ data,
23
+ centrosCustosList,
24
+ centrosCustosListTotal,
25
+ error,
26
+ isLoading,
27
+ tableParams,
28
+ filterParams,
29
+ mutate,
30
+ setTableParams,
31
+ setFilterParams,
32
+ }
33
+ }
@@ -53,4 +53,5 @@ export { default as useSapFindLimiteCreditoByBusinessPartnerUseMulti} from './sa
53
53
  export { default as useSapCountPartidasVencidasByBusinessPartner} from './sap/partidas/useSapCountPartidasVencidasByBusinessPartner'
54
54
  export { default as useSapCountPartidasVencidasByBusinessPartnerUseMulti} from './sap/partidas/useSapCountPartidasVencidasByBusinessPartnerUseMulti'
55
55
  export { default as useFreteByOrganizacaoVendasList } from './dm/frete/useEquipeVendaByOrganizacaoVendasList';
56
+ export { default as useCentroCustoList } from './dm/centroCusto/useCentroCustoList';
56
57
 
@@ -1,8 +1,9 @@
1
- import ApiService from "@/services/ApiService";
2
- import { IFilterParams, TQueryResponse } from "@base/@types/api";
3
- import { endpointsConfig } from "@base/configs";
1
+ import ApiService from '@/services/ApiService'
2
+ import { IFilterParams, TQueryResponse } from '@base/@types/api'
3
+ import { TCentroDeCusto } from '@base/@types/models/user'
4
+ import { endpointsConfig } from '@base/configs'
4
5
 
5
- const CENTRO_CUSTO_ENDPOINT = endpointsConfig.dm.centroCusto;
6
+ const CENTRO_CUSTO_ENDPOINT = endpointsConfig.dm.centroCusto
6
7
 
7
8
  export async function apiFindMonitorCentroCusto(body?: IFilterParams) {
8
9
  return ApiService.fetchDataWithAxios<TQueryResponse<any>>({
@@ -10,4 +11,4 @@ export async function apiFindMonitorCentroCusto(body?: IFilterParams) {
10
11
  method: CENTRO_CUSTO_ENDPOINT.findMonitor.httpMethod,
11
12
  data: body,
12
13
  })
13
- }
14
+ }
@@ -0,0 +1,19 @@
1
+ import { TCentroDeCusto } from '@base/@types/models/orcamento/CentroDeCusto'
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<TCentroDeCusto> = {
9
+ filterParams: { filter: {} },
10
+ tableParams: baseTableParams,
11
+ }
12
+
13
+ export const useCentroCustoListStore = create<
14
+ IListStoreState<TCentroDeCusto> & IListStoreAction<TCentroDeCusto>
15
+ >((set) => ({
16
+ ...initialState,
17
+ setFilterParams: (payload) => set(() => ({ filterParams: payload })),
18
+ setTableParams: (payload) => set(() => ({ tableParams: payload })),
19
+ }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbe-agro/client-core",
3
- "version": "5.3.193",
3
+ "version": "5.3.194",
4
4
  "description": "Biblioteca principal de componentes e utilidades para os microfrontends do Orbe Agro.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",