@dative-gpi/foundation-core-services 1.0.137 → 1.0.139-chartlists
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.
|
@@ -29,6 +29,8 @@ export * from "./useManufacturers";
|
|
|
29
29
|
export * from "./useModels";
|
|
30
30
|
export * from "./useOrganisations";
|
|
31
31
|
export * from "./useOrganisationTypes";
|
|
32
|
+
export * from "./useReports";
|
|
33
|
+
export * from "./useReportExecutions";
|
|
32
34
|
export * from "./usePermissionCategories";
|
|
33
35
|
export * from "./useRoleOrganisations";
|
|
34
36
|
export * from "./useRoleOrganisationTypes";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
2
|
+
import { ReportExecution, type ReportExecutionFilters, type ReportExecutionDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { REPORT_EXECUTIONS_URL } from "../../config/urls";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const ReportServiceFactoryIncomplete = new ServiceFactory("reportExecution", ReportExecution).create(factory => factory.build(
|
|
7
|
+
factory.addGetMany<ReportExecutionDTO, ReportExecution, ReportExecutionFilters>(REPORT_EXECUTIONS_URL, ReportExecution),
|
|
8
|
+
factory.addNotify()
|
|
9
|
+
));
|
|
10
|
+
|
|
11
|
+
export const useReportExecutions = ComposableFactory.getMany(ReportServiceFactoryIncomplete);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
2
|
+
import { REPORTS_URL, REPORT_URL } from "../../config/urls";
|
|
3
|
+
import {
|
|
4
|
+
type CreateReportDTO, ReportDetails, type ReportDetailsDTO, type ReportFilters, ReportInfos, type ReportInfosDTO, type UpdateReportDTO,
|
|
5
|
+
} from "@dative-gpi/foundation-core-domain/models";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const ReportServiceFactory = new ServiceFactory<ReportDetailsDTO, ReportDetails>("report", ReportDetails)
|
|
9
|
+
.createComplete<ReportInfos, ReportInfosDTO, CreateReportDTO, UpdateReportDTO, ReportFilters>(REPORTS_URL, REPORT_URL, ReportInfos);
|
|
10
|
+
|
|
11
|
+
const ReportServiceFactoryIncomplete = new ServiceFactory("report", ReportDetails).create(factory => factory.build(
|
|
12
|
+
factory.addNotify(() => ({
|
|
13
|
+
...ServiceFactory.addCustom("trigger", (axios, reportId: string) => axios.patch(REPORT_URL(reportId)), () => {
|
|
14
|
+
}),
|
|
15
|
+
}))
|
|
16
|
+
));
|
|
17
|
+
|
|
18
|
+
export const useReport = ComposableFactory.get(ReportServiceFactory);
|
|
19
|
+
export const useReports = ComposableFactory.getMany(ReportServiceFactory);
|
|
20
|
+
export const useCreateReport = ComposableFactory.create(ReportServiceFactory);
|
|
21
|
+
export const useUpdateReport = ComposableFactory.update(ReportServiceFactory);
|
|
22
|
+
export const useRemoveReport = ComposableFactory.remove(ReportServiceFactory);
|
|
23
|
+
export const useTriggerReport = ComposableFactory.custom(ReportServiceFactoryIncomplete.trigger);
|
package/config/urls/base.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { urlFactory } from "./urlFactory";
|
|
2
2
|
|
|
3
3
|
export const CORE_URL = urlFactory(organisationId => `/api/foundation/core/v1/organisations/${encodeURIComponent(organisationId)}`);
|
|
4
|
+
export const CORE_REPORT_URL = urlFactory((organisationId) => `/api/foundation/report/v1/organisations/${organisationId}`);
|
|
4
5
|
export const HUBS_URL = urlFactory(organisationId => `/api/foundation/hubs/v1/organisations/${encodeURIComponent(organisationId)}`);
|
package/config/urls/index.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from "./organisations";
|
|
|
29
29
|
export * from "./organisationTypes";
|
|
30
30
|
export * from "./permissionCategories";
|
|
31
31
|
export * from "./permissions";
|
|
32
|
+
export * from "./reports";
|
|
32
33
|
export * from "./roleOrganisations";
|
|
33
34
|
export * from "./roleOrganisationTypes";
|
|
34
35
|
export * from "./scenarioDeviceOrganisations";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CORE_REPORT_URL } from "./base";
|
|
2
|
+
|
|
3
|
+
export const REPORTS_URL = () => `${CORE_REPORT_URL()}/reports`;
|
|
4
|
+
export const REPORT_EXECUTIONS_URL = () => `${CORE_REPORT_URL()}/report-executions`;
|
|
5
|
+
export const REPORT_URL = (reportId: string) => `${REPORTS_URL()}/${reportId}`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-services",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.139-chartlists",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-core-domain": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "1.0.139-chartlists"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"vue": "^3.4.38",
|
|
19
19
|
"vue-router": "^4.3.0"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "d6d4df26014365b637a93c3e05c616616159a6f7"
|
|
22
22
|
}
|