@dative-gpi/foundation-core-services 0.0.229 → 0.1.68

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 (54) hide show
  1. package/composables/app/index.ts +2 -1
  2. package/composables/app/useEntityId.ts +19 -0
  3. package/composables/index.ts +2 -1
  4. package/composables/services/index.ts +1 -1
  5. package/composables/services/useActions.ts +3 -4
  6. package/composables/services/useAlerts.ts +1 -1
  7. package/composables/services/useArticles.ts +4 -5
  8. package/composables/services/useChartCategories.ts +1 -2
  9. package/composables/services/useChartOrganisationTypes.ts +10 -12
  10. package/composables/services/useChartOrganisations.ts +10 -12
  11. package/composables/services/useCharts.ts +1 -3
  12. package/composables/services/useComments.ts +2 -3
  13. package/composables/services/useConnectivityAlerts.ts +33 -34
  14. package/composables/services/useConnectivityScenarios.ts +1 -2
  15. package/composables/services/useCustomProperties.ts +3 -4
  16. package/composables/services/useCustomPropertyValues.ts +3 -3
  17. package/composables/services/useDashboardOrganisationTypes.ts +25 -28
  18. package/composables/services/useDashboardOrganisations.ts +20 -22
  19. package/composables/services/useDashboardShallows.ts +15 -17
  20. package/composables/services/useDashboards.ts +2 -4
  21. package/composables/services/useDataCategories.ts +4 -5
  22. package/composables/services/useDataDefinitions.ts +4 -5
  23. package/composables/services/useDataTables.ts +10 -6
  24. package/composables/services/useDeviceConnectivities.ts +15 -16
  25. package/composables/services/useDeviceOrganisations.ts +23 -26
  26. package/composables/services/useDeviceStatuses.ts +14 -15
  27. package/composables/services/useFolders.ts +10 -13
  28. package/composables/services/useGroups.ts +1 -2
  29. package/composables/services/useLocations.ts +1 -1
  30. package/composables/services/useManufacturers.ts +4 -5
  31. package/composables/services/useModels.ts +3 -3
  32. package/composables/services/useOrganisationTypes.ts +4 -5
  33. package/composables/services/useOrganisations.ts +9 -10
  34. package/composables/services/usePermissionCategories.ts +3 -4
  35. package/composables/services/useRoleOrganisationTypes.ts +4 -5
  36. package/composables/services/useRoleOrganisations.ts +1 -2
  37. package/composables/services/useScenarioDeviceOrganisations.ts +9 -3
  38. package/composables/services/useScenarioOrganisationTypes.ts +21 -22
  39. package/composables/services/useScenarioOrganisations.ts +11 -13
  40. package/composables/services/useServiceAccountOrganisationAuthTokens.ts +8 -13
  41. package/composables/services/useServiceAccountOrganisations.ts +2 -3
  42. package/composables/services/useServiceAccountRoleOrganisations.ts +13 -0
  43. package/composables/services/useUserOrganisationTables.ts +4 -6
  44. package/composables/services/useUserOrganisations.ts +25 -25
  45. package/composables/services/useWidgetTemplates.ts +4 -5
  46. package/composables/useRouteOrganisation.ts +24 -0
  47. package/config/literals/index.ts +1 -3
  48. package/config/urls/index.ts +1 -1
  49. package/config/urls/serviceAccountOrganisationAuthTokens.ts +3 -4
  50. package/config/urls/serviceAccountRoleOrganisations.ts +4 -0
  51. package/package.json +3 -3
  52. package/composables/services/useNotifications.ts +0 -48
  53. package/config/literals/hubs.ts +0 -16
  54. package/config/urls/notifications.ts +0 -6
@@ -1 +1,2 @@
1
- export * from "./useAppOrganisationId";
1
+ export * from "./useAppOrganisationId";
2
+ export * from "./useEntityId";
@@ -0,0 +1,19 @@
1
+ import { ref, watch } from "vue";
2
+ import { useRouter } from "vue-router";
3
+
4
+ import { ENTITY_ID } from "../../config";
5
+
6
+ export const useEntityId = () => {
7
+ const entityId = ref<string | null>(null);
8
+
9
+ const router = useRouter();
10
+
11
+ watch(router.currentRoute, () => {
12
+ const id = router.currentRoute.value.params[ENTITY_ID] as string | null;
13
+ if(id) {
14
+ entityId.value = id;
15
+ }
16
+ }, { immediate: true })
17
+
18
+ return { entityId }
19
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./app";
2
2
  export * from "./services";
3
- export * from "./useFoundationCore";
3
+ export * from "./useFoundationCore";
4
+ export * from "./useRouteOrganisation";
@@ -25,7 +25,6 @@ export * from "./useGroups";
25
25
  export * from "./useLocations";
26
26
  export * from "./useManufacturers";
27
27
  export * from "./useModels";
28
- export * from "./useNotifications";
29
28
  export * from "./useOrganisations";
30
29
  export * from "./useOrganisationTypes";
31
30
  export * from "./usePermissionCategories";
@@ -36,6 +35,7 @@ export * from "./useScenarioOrganisations";
36
35
  export * from "./useScenarioOrganisationTypes";
37
36
  export * from "./useServiceAccountOrganisationAuthTokens";
38
37
  export * from "./useServiceAccountOrganisations";
38
+ export * from "./useServiceAccountRoleOrganisations";
39
39
  export * from "./useUserOrganisations";
40
40
  export * from "./useUserOrganisationTables";
41
41
  export * from "./useWidgetTemplates";
@@ -1,12 +1,11 @@
1
- import type { ActionDetailsDTO, ActionFilters, ActionInfosDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { ActionDetails, ActionInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { ActionDetails, type ActionDetailsDTO, type ActionFilters, ActionInfos, type ActionInfosDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
4
3
 
5
4
  import { ACTIONS_URL } from "../../config/urls";
6
5
 
7
6
  const ActionServiceFactory = new ServiceFactory<ActionDetailsDTO, ActionDetails>("action", ActionDetails).create(factory => factory.build(
8
- factory.addGetMany<ActionInfosDTO, ActionInfos, ActionFilters>(ACTIONS_URL, ActionInfos),
9
- factory.addNotify()
7
+ factory.addGetMany<ActionInfosDTO, ActionInfos, ActionFilters>(ACTIONS_URL, ActionInfos),
8
+ factory.addNotify()
10
9
  ));
11
10
 
12
11
  export const useActions = ComposableFactory.getMany(ActionServiceFactory);
@@ -1,9 +1,9 @@
1
1
  import { AlertDetails, type AlertDetailsDTO, type AlertFilters, AlertInfos, type AlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
2
2
  import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
3
3
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
+ import { HUBS } from "@dative-gpi/foundation-shared-services/config";
4
5
 
5
6
  import { ALERTS_HUB_URL, ALERTS_URL, ALERT_URL } from "../../config/urls";
6
- import { HUBS } from "../../config/literals";
7
7
 
8
8
  const AlertServiceFactory = new ServiceFactory<AlertDetailsDTO, AlertDetails>("alert", AlertDetails).create(factory => factory.build(
9
9
  factory.addGet(ALERT_URL),
@@ -1,13 +1,12 @@
1
- import type { ArticleDetailsDTO, ArticleFilters, ArticleInfosDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { ArticleDetails, ArticleInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { ArticleDetails, type ArticleDetailsDTO, type ArticleFilters, ArticleInfos, type ArticleInfosDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { ARTICLES_URL, ARTICLE_URL } from "../../config/urls";
6
5
 
7
6
  const ArticleServiceFactory = new ServiceFactory<ArticleDetailsDTO, ArticleDetails>("article", ArticleDetails).create(factory => factory.build(
8
- factory.addGet(ARTICLE_URL),
9
- factory.addGetMany<ArticleInfosDTO, ArticleInfos, ArticleFilters>(ARTICLES_URL, ArticleInfos),
10
- factory.addNotify()
7
+ factory.addGet(ARTICLE_URL),
8
+ factory.addGetMany<ArticleInfosDTO, ArticleInfos, ArticleFilters>(ARTICLES_URL, ArticleInfos),
9
+ factory.addNotify()
11
10
  ));
12
11
 
13
12
  export const useArticle = ComposableFactory.get(ArticleServiceFactory);
@@ -1,5 +1,4 @@
1
- import type { CreateChartCategoryDTO, ChartCategoryDetailsDTO, ChartCategoryFilters, ChartCategoryInfosDTO, UpdateChartCategoryDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { ChartCategoryDetails, ChartCategoryInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { ChartCategoryDetails, type ChartCategoryDetailsDTO, type ChartCategoryFilters, ChartCategoryInfos, type ChartCategoryInfosDTO, type CreateChartCategoryDTO, type UpdateChartCategoryDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { CHART_CATEGORIES_URL, CHART_CATEGORY_URL } from "../../config/urls";
@@ -1,5 +1,4 @@
1
- import type { ChartOrganisationTypeDetailsDTO, ChartOrganisationTypeFilters, ChartOrganisationTypeInfosDTO, CreateChartOrganisationTypeDTO, UpdateChartOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { ChartOrganisationTypeDetails, ChartOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { ChartOrganisationTypeDetails, type ChartOrganisationTypeDetailsDTO, type ChartOrganisationTypeFilters, ChartOrganisationTypeInfos, type ChartOrganisationTypeInfosDTO, type CreateChartOrganisationTypeDTO, type UpdateChartOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { CHART_ORGANISATION_TYPE_URL, CHART_ORGANISATION_TYPES_URL } from "../../config/urls";
@@ -7,16 +6,15 @@ import { CHART_ORGANISATION_TYPE_URL, CHART_ORGANISATION_TYPES_URL } from "../..
7
6
  const ChartOrganisationTypeServiceFactory = new ServiceFactory<ChartOrganisationTypeDetailsDTO, ChartOrganisationTypeDetails>("chartOrganisationType", ChartOrganisationTypeDetails)
8
7
  .createComplete<ChartOrganisationTypeInfos, ChartOrganisationTypeInfosDTO, CreateChartOrganisationTypeDTO, UpdateChartOrganisationTypeDTO, ChartOrganisationTypeFilters>(CHART_ORGANISATION_TYPES_URL, CHART_ORGANISATION_TYPE_URL, ChartOrganisationTypeInfos);
9
8
 
10
- const ChartOrganisationTypeServiceFactoryIncomplete = new ServiceFactory("chartOrganisationType", ChartOrganisationTypeDetails)
11
- .create(factory => factory.build(
12
- factory.addNotify(notifyService => ({
13
- ...ServiceFactory.addCustom("duplicate", (axios, charOrganisationTypeId: string) => axios.patch(CHART_ORGANISATION_TYPE_URL(charOrganisationTypeId)), (dto: ChartOrganisationTypeDetailsDTO) => {
14
- const result = new ChartOrganisationTypeDetails(dto);
15
- notifyService.notify("update", result);
16
- return result;
17
- })
18
- }))
19
- ));
9
+ const ChartOrganisationTypeServiceFactoryIncomplete = new ServiceFactory("chartOrganisationType", ChartOrganisationTypeDetails).create(factory => factory.build(
10
+ factory.addNotify(notifyService => ({
11
+ ...ServiceFactory.addCustom("duplicate", (axios, charOrganisationTypeId: string) => axios.patch(CHART_ORGANISATION_TYPE_URL(charOrganisationTypeId)), (dto: ChartOrganisationTypeDetailsDTO) => {
12
+ const result = new ChartOrganisationTypeDetails(dto);
13
+ notifyService.notify("update", result);
14
+ return result;
15
+ })
16
+ }))
17
+ ));
20
18
 
21
19
  export const useChartOrganisationType = ComposableFactory.get(ChartOrganisationTypeServiceFactory);
22
20
  export const useChartOrganisationTypes = ComposableFactory.getMany(ChartOrganisationTypeServiceFactory);
@@ -1,5 +1,4 @@
1
- import type { ChartOrganisationDetailsDTO, ChartOrganisationFilters, ChartOrganisationInfosDTO, CreateChartOrganisationDTO, UpdateChartOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { ChartOrganisationDetails, ChartOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { ChartOrganisationDetails, type ChartOrganisationDetailsDTO, type ChartOrganisationFilters, ChartOrganisationInfos, type ChartOrganisationInfosDTO, type CreateChartOrganisationDTO, type UpdateChartOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { CHART_ORGANISATION_URL, CHART_ORGANISATIONS_URL } from "../../config/urls";
@@ -7,16 +6,15 @@ import { CHART_ORGANISATION_URL, CHART_ORGANISATIONS_URL } from "../../config/ur
7
6
  const ChartOrganisationServiceFactory = new ServiceFactory<ChartOrganisationDetailsDTO, ChartOrganisationDetails>("chartOrganisation", ChartOrganisationDetails)
8
7
  .createComplete<ChartOrganisationInfos, ChartOrganisationInfosDTO, CreateChartOrganisationDTO, UpdateChartOrganisationDTO, ChartOrganisationFilters>(CHART_ORGANISATIONS_URL, CHART_ORGANISATION_URL, ChartOrganisationInfos);
9
8
 
10
- const ChartOrganisationServiceFactoryIncomplete = new ServiceFactory("chartOrganisation", ChartOrganisationDetails)
11
- .create(factory => factory.build(
12
- factory.addNotify(notifyService => ({
13
- ...ServiceFactory.addCustom("duplicate", (axios, chartOrganisationId: string) => axios.patch(CHART_ORGANISATION_URL(chartOrganisationId)), (dto: ChartOrganisationDetailsDTO) => {
14
- const result = new ChartOrganisationDetails(dto);
15
- notifyService.notify("update", result);
16
- return result;
17
- })
18
- }))
19
- ));
9
+ const ChartOrganisationServiceFactoryIncomplete = new ServiceFactory("chartOrganisation", ChartOrganisationDetails).create(factory => factory.build(
10
+ factory.addNotify(notifyService => ({
11
+ ...ServiceFactory.addCustom("duplicate", (axios, chartOrganisationId: string) => axios.patch(CHART_ORGANISATION_URL(chartOrganisationId)), (dto: ChartOrganisationDetailsDTO) => {
12
+ const result = new ChartOrganisationDetails(dto);
13
+ notifyService.notify("update", result);
14
+ return result;
15
+ })
16
+ }))
17
+ ));
20
18
 
21
19
  export const useChartOrganisation = ComposableFactory.get(ChartOrganisationServiceFactory);
22
20
  export const useChartOrganisations = ComposableFactory.getMany(ChartOrganisationServiceFactory);
@@ -1,6 +1,4 @@
1
-
2
- import type { ChartDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
3
- import { ChartDetails } from "@dative-gpi/foundation-core-domain/models";
1
+ import { ChartDetails, type ChartDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
4
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
5
3
 
6
4
  import { CHART_URL } from "../../config/urls";
@@ -1,11 +1,10 @@
1
- import type { CreateCommentDTO, CommentDetailsDTO, CommentFilters, CommentInfosDTO, UpdateCommentDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { CommentDetails, CommentInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { CommentDetails, type CommentDetailsDTO, type CommentFilters, CommentInfos, type CommentInfosDTO, type CreateCommentDTO, type UpdateCommentDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { COMMENTS_URL, COMMENT_URL } from "../../config/urls";
6
5
 
7
6
  const CommentServiceFactory = new ServiceFactory<CommentDetailsDTO, CommentDetails>("comment", CommentDetails)
8
- .createComplete<CommentInfos, CommentInfosDTO, CreateCommentDTO, UpdateCommentDTO, CommentFilters>(COMMENTS_URL, COMMENT_URL, CommentInfos);
7
+ .createComplete<CommentInfos, CommentInfosDTO, CreateCommentDTO, UpdateCommentDTO, CommentFilters>(COMMENTS_URL, COMMENT_URL, CommentInfos);
9
8
 
10
9
  export const useComment = ComposableFactory.get(CommentServiceFactory);
11
10
  export const useComments = ComposableFactory.getMany(CommentServiceFactory);
@@ -1,53 +1,52 @@
1
- import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
2
- import type { ConnectivityAlertDetailsDTO, ConnectivityAlertFilters, ConnectivityAlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
3
- import { ConnectivityAlertDetails, ConnectivityAlertInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { ConnectivityAlertDetails, type ConnectivityAlertDetailsDTO, type ConnectivityAlertFilters, ConnectivityAlertInfos, type ConnectivityAlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
4
2
  import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
3
+ import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
+ import { HUBS } from "@dative-gpi/foundation-shared-services/config";
5
5
 
6
6
  import { CONNECTIVITY_ALERTS_HUB_URL, CONNECTIVITY_ALERTS_URL, CONNECTIVITY_ALERT_URL } from "../../config/urls";
7
- import { HUBS } from "../../config/literals";
8
7
 
9
8
  const ConnectivityAlertServiceFactory = new ServiceFactory<ConnectivityAlertDetailsDTO, ConnectivityAlertDetails>("connectivityAlert", ConnectivityAlertDetails).create(factory => factory.build(
10
- factory.addGet(CONNECTIVITY_ALERT_URL),
11
- factory.addGetMany<ConnectivityAlertInfosDTO, ConnectivityAlertInfos, ConnectivityAlertFilters>(CONNECTIVITY_ALERTS_URL, ConnectivityAlertInfos),
12
- factory.addRemove(CONNECTIVITY_ALERT_URL),
13
- factory.addNotify(notify => ({
14
- notifyCreate: (alert: ConnectivityAlertDetails) => notify.notify("add", alert),
15
- notifyUpdate: (alert: ConnectivityAlertDetails) => notify.notify("update", alert),
16
- notifyRemove: (alertId: string) => notify.notify("delete", alertId),
17
- }))
9
+ factory.addGet(CONNECTIVITY_ALERT_URL),
10
+ factory.addGetMany<ConnectivityAlertInfosDTO, ConnectivityAlertInfos, ConnectivityAlertFilters>(CONNECTIVITY_ALERTS_URL, ConnectivityAlertInfos),
11
+ factory.addRemove(CONNECTIVITY_ALERT_URL),
12
+ factory.addNotify(notify => ({
13
+ notifyCreate: (connectivityAlert: ConnectivityAlertDetails) => notify.notify("add", connectivityAlert),
14
+ notifyUpdate: (connectivityAlert: ConnectivityAlertDetails) => notify.notify("update", connectivityAlert),
15
+ notifyRemove: (connectivityAlertId: string) => notify.notify("delete", connectivityAlertId),
16
+ }))
18
17
  ));
19
18
 
20
19
  const useConnectivityAlertsHub = HubFactory.create(CONNECTIVITY_ALERTS_HUB_URL,
21
- (connection, { isWatched, hasWatchers }) => {
22
- connection.on(HUBS.CREATE_CONNECTIVITY_ALERT, (alertId: string) => hasWatchers()
23
- ? ConnectivityAlertServiceFactory.get(alertId).then(ConnectivityAlertServiceFactory.notifyCreate)
24
- : null);
25
- connection.on(HUBS.UPDATE_CONNECTIVITY_ALERT, (alertId: string) => isWatched(alertId) || hasWatchers()
26
- ? ConnectivityAlertServiceFactory.get(alertId).then(ConnectivityAlertServiceFactory.notifyCreate)
27
- : null);
28
- connection.on(HUBS.REMOVE_CONNECTIVITY_ALERT, (alertId: string) => hasWatchers()
29
- ? ConnectivityAlertServiceFactory.notifyRemove(alertId)
30
- : null);
31
- },
32
- async (connection) => {
33
- await connection.invoke(HUBS.SUBSCRIBE);
34
- }
20
+ (connection, { isWatched, hasWatchers }) => {
21
+ connection.on(HUBS.CREATE_CONNECTIVITY_ALERT, (connectivityAlertId: string) => hasWatchers()
22
+ ? ConnectivityAlertServiceFactory.get(connectivityAlertId).then(ConnectivityAlertServiceFactory.notifyCreate)
23
+ : null);
24
+ connection.on(HUBS.UPDATE_CONNECTIVITY_ALERT, (connectivityAlertId: string) => isWatched(connectivityAlertId) || hasWatchers()
25
+ ? ConnectivityAlertServiceFactory.get(connectivityAlertId).then(ConnectivityAlertServiceFactory.notifyCreate)
26
+ : null);
27
+ connection.on(HUBS.REMOVE_CONNECTIVITY_ALERT, (connectivityAlertId: string) => hasWatchers()
28
+ ? ConnectivityAlertServiceFactory.notifyRemove(connectivityAlertId)
29
+ : null);
30
+ },
31
+ async (connection) => {
32
+ await connection.invoke(HUBS.SUBSCRIBE);
33
+ }
35
34
  );
36
35
 
37
36
  const useWatchConnectivityAlerts = HubFactory.createWatcher(useConnectivityAlertsHub);
38
37
 
39
38
  export const useConnectivityAlert = ComposableFactory.get(ConnectivityAlertServiceFactory, () => {
40
- const { watchOne } = useWatchConnectivityAlerts();
41
- return (alert) => {
42
- watchOne(alert.value.id)
43
- }
39
+ const { watchOne } = useWatchConnectivityAlerts();
40
+ return (connectivityAlert) => {
41
+ watchOne(connectivityAlert.value.id)
42
+ }
44
43
  });
45
44
 
46
45
  export const useConnectivityAlerts = ComposableFactory.getMany(ConnectivityAlertServiceFactory, () => {
47
- const { watchMany } = useWatchConnectivityAlerts();
48
- return () => {
49
- watchMany();
50
- }
46
+ const { watchMany } = useWatchConnectivityAlerts();
47
+ return () => {
48
+ watchMany();
49
+ }
51
50
  });
52
51
 
53
52
  export const useRemoveConnectivityAlert = ComposableFactory.remove(ConnectivityAlertServiceFactory);
@@ -1,6 +1,5 @@
1
+ import { ConnectivityScenarioDetails, type ConnectivityScenarioDetailsDTO, type ConnectivityScenarioFilters, ConnectivityScenarioInfos, type ConnectivityScenarioInfosDTO, type CreateConnectivityScenarioDTO, type UpdateConnectivityScenarioDTO } from "@dative-gpi/foundation-core-domain/models";
1
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
2
- import type { CreateConnectivityScenarioDTO, ConnectivityScenarioDetailsDTO, ConnectivityScenarioFilters, ConnectivityScenarioInfosDTO, UpdateConnectivityScenarioDTO } from "@dative-gpi/foundation-core-domain/models";
3
- import { ConnectivityScenarioDetails, ConnectivityScenarioInfos } from "@dative-gpi/foundation-core-domain/models";
4
3
 
5
4
  import { CONNECTIVITY_SCENARIOS_URL, CONNECTIVITY_SCENARIO_URL } from "../../config";
6
5
 
@@ -1,12 +1,11 @@
1
- import type { CustomPropertyDetailsDTO, CustomPropertyFilters, CustomPropertyInfosDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { CustomPropertyDetails, CustomPropertyInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { CustomPropertyDetails, type CustomPropertyDetailsDTO, type CustomPropertyFilters, CustomPropertyInfos, type CustomPropertyInfosDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { CUSTOM_PROPERTIES_URL } from "../../config/urls";
6
5
 
7
6
  const CustomPropertyServiceFactory = new ServiceFactory<CustomPropertyDetailsDTO, CustomPropertyDetails>("customProperty", CustomPropertyDetails).create(factory => factory.build(
8
- factory.addGetMany<CustomPropertyInfosDTO, CustomPropertyInfos, CustomPropertyFilters>(CUSTOM_PROPERTIES_URL, CustomPropertyInfos),
9
- factory.addNotify()
7
+ factory.addGetMany<CustomPropertyInfosDTO, CustomPropertyInfos, CustomPropertyFilters>(CUSTOM_PROPERTIES_URL, CustomPropertyInfos),
8
+ factory.addNotify()
10
9
  ));
11
10
 
12
11
  export const useCustomProperties = ComposableFactory.getMany(CustomPropertyServiceFactory);
@@ -1,11 +1,11 @@
1
- import type { CustomPropertyValueInfosDTO, PropertyEntity } from "@dative-gpi/foundation-core-domain/models";
2
- import { CustomPropertyValueInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { CustomPropertyValueInfos, type CustomPropertyValueInfosDTO } from "@dative-gpi/foundation-core-domain/models";
2
+ import { type PropertyEntity } from "@dative-gpi/foundation-shared-domain/enums";
3
3
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
4
 
5
5
  import { CUSTOM_PROPERTY_VALUES_URL } from "../../config/urls";
6
6
 
7
7
  const CustomPropertyValueServiceFactory = {
8
- ...ServiceFactory.addCustom("getMany", (axios, entity: PropertyEntity, entityId: string, code: string) => axios.get(CUSTOM_PROPERTY_VALUES_URL(entity, entityId, code)), (dtos: CustomPropertyValueInfosDTO[]) => dtos.map((dto: CustomPropertyValueInfosDTO) => new CustomPropertyValueInfos(dto))),
8
+ ...ServiceFactory.addCustom("getMany", (axios, entity: PropertyEntity, entityId: string, code: string) => axios.get(CUSTOM_PROPERTY_VALUES_URL(entity, entityId, code)), (dtos: CustomPropertyValueInfosDTO[]) => dtos.map((dto: CustomPropertyValueInfosDTO) => new CustomPropertyValueInfos(dto))),
9
9
  };
10
10
 
11
11
  export const useCustomPropertyValues = ComposableFactory.custom(CustomPropertyValueServiceFactory.getMany);
@@ -1,33 +1,31 @@
1
- import type { DashboardOrganisationTypeDetailsDTO, DashboardOrganisationTypeFilters, DashboardOrganisationTypeInfosDTO, LockDashboardOrganisationTypeDTO, PublishDashboardOrganisationTypeDTO, UpdateDashboardOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { DashboardOrganisationTypeDetails, DashboardOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { DashboardOrganisationTypeDetails, type DashboardOrganisationTypeDetailsDTO, type DashboardOrganisationTypeFilters, DashboardOrganisationTypeInfos, type DashboardOrganisationTypeInfosDTO, type LockDashboardOrganisationTypeDTO, type PublishDashboardOrganisationTypeDTO, type UpdateDashboardOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { DASHBOARD_ORGANISATION_TYPE_LOCK_URL, DASHBOARD_ORGANISATION_TYPE_URL, DASHBOARD_ORGANISATION_TYPES_URL } from "../../config";
6
5
 
7
- const DashboardOrganisationTypeServiceFactory = new ServiceFactory<DashboardOrganisationTypeDetailsDTO, DashboardOrganisationTypeDetails>("dashboardOrganisationType", DashboardOrganisationTypeDetails)
8
- .create(factory => factory.build(
9
- factory.addGet(DASHBOARD_ORGANISATION_TYPE_URL),
10
- factory.addGetMany<DashboardOrganisationTypeInfosDTO, DashboardOrganisationTypeInfos, DashboardOrganisationTypeFilters>(DASHBOARD_ORGANISATION_TYPES_URL, DashboardOrganisationTypeInfos),
11
- factory.addUpdate<UpdateDashboardOrganisationTypeDTO>(DASHBOARD_ORGANISATION_TYPE_URL),
12
- factory.addRemove(DASHBOARD_ORGANISATION_TYPE_URL),
13
- factory.addNotify(notifyService => ({
14
- ...ServiceFactory.addCustom("publish", (axios, payload: PublishDashboardOrganisationTypeDTO) => axios.post(DASHBOARD_ORGANISATION_TYPES_URL(), payload), (dto: DashboardOrganisationTypeDetailsDTO) => {
15
- const result = new DashboardOrganisationTypeDetails(dto);
16
- notifyService.notify("update", result);
17
- return result;
18
- }),
19
- ...ServiceFactory.addCustom("duplicate", (axios, dashboardOrganisationTypeId: string) => axios.patch(DASHBOARD_ORGANISATION_TYPE_URL(dashboardOrganisationTypeId)), (dto: DashboardOrganisationTypeDetailsDTO) => {
20
- const result = new DashboardOrganisationTypeDetails(dto);
21
- notifyService.notify("update", result);
22
- return result;
23
- }),
24
- ...ServiceFactory.addCustom("lock", (axios, dashboardOrganisationTypeId: string, payload: LockDashboardOrganisationTypeDTO) => axios.put(DASHBOARD_ORGANISATION_TYPE_LOCK_URL(dashboardOrganisationTypeId), payload), (dto: DashboardOrganisationTypeDetailsDTO) => {
25
- const result = new DashboardOrganisationTypeDetails(dto);
26
- notifyService.notify("update", result);
27
- return result;
28
- })
29
- }))
30
- ));
6
+ const DashboardOrganisationTypeServiceFactory = new ServiceFactory<DashboardOrganisationTypeDetailsDTO, DashboardOrganisationTypeDetails>("dashboardOrganisationType", DashboardOrganisationTypeDetails).create(factory => factory.build(
7
+ factory.addGet(DASHBOARD_ORGANISATION_TYPE_URL),
8
+ factory.addGetMany<DashboardOrganisationTypeInfosDTO, DashboardOrganisationTypeInfos, DashboardOrganisationTypeFilters>(DASHBOARD_ORGANISATION_TYPES_URL, DashboardOrganisationTypeInfos),
9
+ factory.addUpdate<UpdateDashboardOrganisationTypeDTO>(DASHBOARD_ORGANISATION_TYPE_URL),
10
+ factory.addRemove(DASHBOARD_ORGANISATION_TYPE_URL),
11
+ factory.addNotify(notifyService => ({
12
+ ...ServiceFactory.addCustom("publish", (axios, payload: PublishDashboardOrganisationTypeDTO) => axios.post(DASHBOARD_ORGANISATION_TYPES_URL(), payload), (dto: DashboardOrganisationTypeDetailsDTO) => {
13
+ const result = new DashboardOrganisationTypeDetails(dto);
14
+ notifyService.notify("update", result);
15
+ return result;
16
+ }),
17
+ ...ServiceFactory.addCustom("duplicate", (axios, dashboardOrganisationTypeId: string) => axios.patch(DASHBOARD_ORGANISATION_TYPE_URL(dashboardOrganisationTypeId)), (dto: DashboardOrganisationTypeDetailsDTO) => {
18
+ const result = new DashboardOrganisationTypeDetails(dto);
19
+ notifyService.notify("update", result);
20
+ return result;
21
+ }),
22
+ ...ServiceFactory.addCustom("lock", (axios, dashboardOrganisationTypeId: string, payload: LockDashboardOrganisationTypeDTO) => axios.put(DASHBOARD_ORGANISATION_TYPE_LOCK_URL(dashboardOrganisationTypeId), payload), (dto: DashboardOrganisationTypeDetailsDTO) => {
23
+ const result = new DashboardOrganisationTypeDetails(dto);
24
+ notifyService.notify("update", result);
25
+ return result;
26
+ })
27
+ }))
28
+ ));
31
29
 
32
30
  export const useDashboardOrganisationType = ComposableFactory.get(DashboardOrganisationTypeServiceFactory);
33
31
  export const useDashboardOrganisationTypes = ComposableFactory.getMany(DashboardOrganisationTypeServiceFactory);
@@ -35,5 +33,4 @@ export const useUpdateDashboardOrganisationType = ComposableFactory.update(Dashb
35
33
  export const useRemoveDashboardOrganisationType = ComposableFactory.remove(DashboardOrganisationTypeServiceFactory);
36
34
  export const usePublishDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.publish);
37
35
  export const useDuplicateDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.duplicate);
38
- export const useLockDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.lock);
39
-
36
+ export const useLockDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.lock);
@@ -1,5 +1,4 @@
1
- import type { DashboardOrganisationDetailsDTO, DashboardOrganisationFilters, DashboardOrganisationInfosDTO, CreateDashboardOrganisationDTO, UpdateDashboardOrganisationDTO, LockDashboardOrganisationDTO, ChangeDashboardOrganisationFolderDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { DashboardOrganisationDetails, DashboardOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { type ChangeDashboardOrganisationFolderDTO, type CreateDashboardOrganisationDTO, DashboardOrganisationDetails, type DashboardOrganisationDetailsDTO, type DashboardOrganisationFilters, DashboardOrganisationInfos, type DashboardOrganisationInfosDTO, type LockDashboardOrganisationDTO, type UpdateDashboardOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { DASHBOARD_ORGANISATION_FOLDER_URL, DASHBOARD_ORGANISATION_LOCK_URL, DASHBOARD_ORGANISATION_URL, DASHBOARD_ORGANISATIONS_URL } from "../../config/urls";
@@ -7,26 +6,25 @@ import { DASHBOARD_ORGANISATION_FOLDER_URL, DASHBOARD_ORGANISATION_LOCK_URL, DAS
7
6
  const DashboardOrganisationServiceFactory = new ServiceFactory<DashboardOrganisationDetailsDTO, DashboardOrganisationDetails>("dashboardOrganisation", DashboardOrganisationDetails)
8
7
  .createComplete<DashboardOrganisationInfos, DashboardOrganisationInfosDTO, CreateDashboardOrganisationDTO, UpdateDashboardOrganisationDTO, DashboardOrganisationFilters>(DASHBOARD_ORGANISATIONS_URL, DASHBOARD_ORGANISATION_URL, DashboardOrganisationInfos);
9
8
 
10
- const DashboardOrganisationServiceFactoryIncomplete = new ServiceFactory("dashboardOrganisation", DashboardOrganisationDetails)
11
- .create(factory => factory.build(
12
- factory.addNotify(notifyService => ({
13
- ...ServiceFactory.addCustom("duplicate", (axios, dashboardOrganisationId: string) => axios.patch(DASHBOARD_ORGANISATION_URL(dashboardOrganisationId)), (dto: DashboardOrganisationDetailsDTO) => {
14
- const result = new DashboardOrganisationDetails(dto);
15
- notifyService.notify("update", result);
16
- return result;
17
- }),
18
- ...ServiceFactory.addCustom("lock", (axios, dashboardOrganisationId: string, payload: LockDashboardOrganisationDTO) => axios.put(DASHBOARD_ORGANISATION_LOCK_URL(dashboardOrganisationId), payload), (dto: DashboardOrganisationDetailsDTO) => {
19
- const result = new DashboardOrganisationDetails(dto);
20
- notifyService.notify("update", result);
21
- return result;
22
- }),
23
- ...ServiceFactory.addCustom("changeFolder", (axios, dashboardOrganisationId: string, payload: ChangeDashboardOrganisationFolderDTO) => axios.put(DASHBOARD_ORGANISATION_FOLDER_URL(dashboardOrganisationId), payload), (dto: DashboardOrganisationDetailsDTO) => {
24
- const result = new DashboardOrganisationDetails(dto);
25
- notifyService.notify("update", result);
26
- return result;
27
- })
28
- }))
29
- ));
9
+ const DashboardOrganisationServiceFactoryIncomplete = new ServiceFactory("dashboardOrganisation", DashboardOrganisationDetails).create(factory => factory.build(
10
+ factory.addNotify(notifyService => ({
11
+ ...ServiceFactory.addCustom("duplicate", (axios, dashboardOrganisationId: string) => axios.patch(DASHBOARD_ORGANISATION_URL(dashboardOrganisationId)), (dto: DashboardOrganisationDetailsDTO) => {
12
+ const result = new DashboardOrganisationDetails(dto);
13
+ notifyService.notify("update", result);
14
+ return result;
15
+ }),
16
+ ...ServiceFactory.addCustom("lock", (axios, dashboardOrganisationId: string, payload: LockDashboardOrganisationDTO) => axios.put(DASHBOARD_ORGANISATION_LOCK_URL(dashboardOrganisationId), payload), (dto: DashboardOrganisationDetailsDTO) => {
17
+ const result = new DashboardOrganisationDetails(dto);
18
+ notifyService.notify("update", result);
19
+ return result;
20
+ }),
21
+ ...ServiceFactory.addCustom("changeFolder", (axios, dashboardOrganisationId: string, payload: ChangeDashboardOrganisationFolderDTO) => axios.put(DASHBOARD_ORGANISATION_FOLDER_URL(dashboardOrganisationId), payload), (dto: DashboardOrganisationDetailsDTO) => {
22
+ const result = new DashboardOrganisationDetails(dto);
23
+ notifyService.notify("update", result);
24
+ return result;
25
+ })
26
+ }))
27
+ ));
30
28
 
31
29
  export const useDashboardOrganisation = ComposableFactory.get(DashboardOrganisationServiceFactory);
32
30
  export const useDashboardOrganisations = ComposableFactory.getMany(DashboardOrganisationServiceFactory);
@@ -1,5 +1,4 @@
1
- import type { ChangeDashboardShallowFolderDTO, CreateDashboardShallowDTO, DashboardShallowDetailsDTO, DashboardShallowFilters, DashboardShallowInfosDTO, UpdateDashboardShallowDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { DashboardShallowDetails, DashboardShallowInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { type ChangeDashboardShallowFolderDTO, type CreateDashboardShallowDTO, DashboardShallowDetails, type DashboardShallowDetailsDTO, type DashboardShallowFilters, DashboardShallowInfos, type DashboardShallowInfosDTO, type UpdateDashboardShallowDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { DASHBOARD_SHALLOW_FOLDER_URL, DASHBOARD_SHALLOW_URL, DASHBOARD_SHALLOWS_URL } from "../../config/urls/dashboardShallows";
@@ -7,21 +6,20 @@ import { DASHBOARD_SHALLOW_FOLDER_URL, DASHBOARD_SHALLOW_URL, DASHBOARD_SHALLOWS
7
6
  const DashboardShallowServiceFactory = new ServiceFactory<DashboardShallowDetailsDTO, DashboardShallowDetails>("dashboardShallow", DashboardShallowDetails)
8
7
  .createComplete<DashboardShallowInfos, DashboardShallowInfosDTO, CreateDashboardShallowDTO, UpdateDashboardShallowDTO, DashboardShallowFilters>(DASHBOARD_SHALLOWS_URL, DASHBOARD_SHALLOW_URL, DashboardShallowInfos);
9
8
 
10
- const DashboardShallowServiceFactoryIncomplete = new ServiceFactory("dashboardShallow", DashboardShallowDetails)
11
- .create(factory => factory.build(
12
- factory.addNotify(notifyService => ({
13
- ...ServiceFactory.addCustom("duplicate", (axios, dashboardShallowId: string) => axios.patch(DASHBOARD_SHALLOW_URL(dashboardShallowId)), (dto: DashboardShallowDetailsDTO) => {
14
- const result = new DashboardShallowDetails(dto);
15
- notifyService.notify("update", result);
16
- return result;
17
- }),
18
- ...ServiceFactory.addCustom("changeFolder", (axios, dashboardShallowId: string, payload: ChangeDashboardShallowFolderDTO) => axios.put(DASHBOARD_SHALLOW_FOLDER_URL(dashboardShallowId), payload), (dto: DashboardShallowDetailsDTO) => {
19
- const result = new DashboardShallowDetails(dto);
20
- notifyService.notify("update", result);
21
- return result;
22
- })
23
- }))
24
- ));
9
+ const DashboardShallowServiceFactoryIncomplete = new ServiceFactory("dashboardShallow", DashboardShallowDetails).create(factory => factory.build(
10
+ factory.addNotify(notifyService => ({
11
+ ...ServiceFactory.addCustom("duplicate", (axios, dashboardShallowId: string) => axios.patch(DASHBOARD_SHALLOW_URL(dashboardShallowId)), (dto: DashboardShallowDetailsDTO) => {
12
+ const result = new DashboardShallowDetails(dto);
13
+ notifyService.notify("update", result);
14
+ return result;
15
+ }),
16
+ ...ServiceFactory.addCustom("changeFolder", (axios, dashboardShallowId: string, payload: ChangeDashboardShallowFolderDTO) => axios.put(DASHBOARD_SHALLOW_FOLDER_URL(dashboardShallowId), payload), (dto: DashboardShallowDetailsDTO) => {
17
+ const result = new DashboardShallowDetails(dto);
18
+ notifyService.notify("update", result);
19
+ return result;
20
+ })
21
+ }))
22
+ ));
25
23
 
26
24
  export const useDashboardShallow = ComposableFactory.get(DashboardShallowServiceFactory);
27
25
  export const useDashboardShallows = ComposableFactory.getMany(DashboardShallowServiceFactory);
@@ -1,12 +1,10 @@
1
+ import { DashboardDetails, type DashboardDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
1
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
2
3
 
3
- import type { DashboardDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
4
- import { DashboardDetails } from "@dative-gpi/foundation-core-domain/models";
5
-
6
4
  import { DASHBOARD_CURRENT_URL } from "../../config";
7
5
 
8
6
  const DashboardServiceFactory = new ServiceFactory<DashboardDetailsDTO, DashboardDetails>("dashboard", DashboardDetails).create(factory => factory.build(
9
- ServiceFactory.addCustom("getCurrent", (axios) => axios.get(DASHBOARD_CURRENT_URL()), (dto: DashboardDetailsDTO) => new DashboardDetails(dto))
7
+ ServiceFactory.addCustom("getCurrent", (axios) => axios.get(DASHBOARD_CURRENT_URL()), (dto: DashboardDetailsDTO) => new DashboardDetails(dto))
10
8
  ));
11
9
 
12
10
  export const useCurrentDashboard = ComposableFactory.custom(DashboardServiceFactory.getCurrent);
@@ -1,13 +1,12 @@
1
- import type { DataCategoryDetailsDTO, DataCategoryFilters, DataCategoryInfosDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { DataCategoryDetails, DataCategoryInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { DataCategoryDetails, type DataCategoryDetailsDTO, type DataCategoryFilters, DataCategoryInfos, type DataCategoryInfosDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { DATA_CATEGORIES_URL, DATA_CATEGORY_URL } from "../../config/urls";
6
5
 
7
6
  const DataCategoryServiceFactory = new ServiceFactory<DataCategoryDetailsDTO, DataCategoryDetails>("dataCategory", DataCategoryDetails).create(factory => factory.build(
8
- factory.addGet(DATA_CATEGORY_URL),
9
- factory.addGetMany<DataCategoryInfosDTO, DataCategoryInfos, DataCategoryFilters>(DATA_CATEGORIES_URL, DataCategoryInfos),
10
- factory.addNotify()
7
+ factory.addGet(DATA_CATEGORY_URL),
8
+ factory.addGetMany<DataCategoryInfosDTO, DataCategoryInfos, DataCategoryFilters>(DATA_CATEGORIES_URL, DataCategoryInfos),
9
+ factory.addNotify()
11
10
  ));
12
11
 
13
12
  export const useDataCategory = ComposableFactory.get(DataCategoryServiceFactory);
@@ -1,13 +1,12 @@
1
- import type { DataDefinitionDetailsDTO, DataDefinitionFilters, DataDefinitionInfosDTO } from "@dative-gpi/foundation-core-domain/models";
2
- import { DataDefinitionDetails, DataDefinitionInfos } from "@dative-gpi/foundation-core-domain/models";
1
+ import { DataDefinitionDetails, type DataDefinitionDetailsDTO, type DataDefinitionFilters, DataDefinitionInfos, type DataDefinitionInfosDTO } from "@dative-gpi/foundation-core-domain/models";
3
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
4
3
 
5
4
  import { DATA_DEFINITIONS_URL, DATA_DEFINITION_URL } from "../../config/urls";
6
5
 
7
6
  const DataDefinitionServiceFactory = new ServiceFactory<DataDefinitionDetailsDTO, DataDefinitionDetails>("dataDefinition", DataDefinitionDetails).create(factory => factory.build(
8
- factory.addGet(DATA_DEFINITION_URL),
9
- factory.addGetMany<DataDefinitionInfosDTO, DataDefinitionInfos, DataDefinitionFilters>(DATA_DEFINITIONS_URL, DataDefinitionInfos),
10
- factory.addNotify()
7
+ factory.addGet(DATA_DEFINITION_URL),
8
+ factory.addGetMany<DataDefinitionInfosDTO, DataDefinitionInfos, DataDefinitionFilters>(DATA_DEFINITIONS_URL, DataDefinitionInfos),
9
+ factory.addNotify()
11
10
  ));
12
11
 
13
12
  export const useDataDefinition = ComposableFactory.get(DataDefinitionServiceFactory);
@@ -1,26 +1,30 @@
1
1
  import { ref, type Ref } from "vue";
2
2
 
3
3
  import { type UpdateUserOrganisationTableDTO, type UserOrganisationTableDetails } from "@dative-gpi/foundation-core-domain/models";
4
- import { type FSDataTable } from "@dative-gpi/foundation-shared-components/models";
4
+ import { type FSDataTable, type FSDataTableColumn } from "@dative-gpi/foundation-shared-components/models";
5
5
 
6
6
  export const useDataTables = () => {
7
7
  const initialized = ref(false);
8
8
 
9
9
  const table = ref<FSDataTable>({
10
10
  headers: [],
11
- mode: "table",
11
+ mode: "iterator",
12
12
  sortBy: null,
13
13
  rowsPerPage: 10,
14
14
  filters: {},
15
15
  page: 1
16
16
  });
17
17
 
18
- const computeTable = ((customSorts: { [key: string]: any }, customSortRaws: { [key: string]: any }) => ({
18
+ const computeTable = ((headersOptions: { [key: string]: Partial<FSDataTableColumn> }) => ({
19
19
  ...table.value,
20
20
  headers: table.value.headers.map(header => ({
21
21
  ...header,
22
- sort: header.value && customSorts[header.value] || null,
23
- sortRaw: header.value && customSortRaws[header.value] || null
22
+ fixedFilters: (header.value && headersOptions[header.value] && headersOptions[header.value].fixedFilters) || null,
23
+ methodFilter: (header.value && headersOptions[header.value] && headersOptions[header.value].methodFilter) || null,
24
+ methodFilterRaw: (header.value && headersOptions[header.value] && headersOptions[header.value].methodFilterRaw) || null,
25
+ sort: (header.value && headersOptions[header.value] && headersOptions[header.value].sort) || null,
26
+ sortRaw: (header.value && headersOptions[header.value] && headersOptions[header.value].sortRaw) || null ,
27
+ innerValue: (header.value && headersOptions[header.value] && headersOptions[header.value].innerValue) || null
24
28
  }))
25
29
  }));
26
30
 
@@ -87,4 +91,4 @@ export const useDataTables = () => {
87
91
  computeTable,
88
92
  updateTable
89
93
  };
90
- };
94
+ };