@acorex-platform/module-report-management-server 0.0.15

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 (70) hide show
  1. package/contracts/src/entities/index.d.ts +2 -0
  2. package/contracts/src/entities/index.js +6 -0
  3. package/contracts/src/entities/index.js.map +1 -0
  4. package/contracts/src/entities/report/index.d.ts +1 -0
  5. package/contracts/src/entities/report/index.js +5 -0
  6. package/contracts/src/entities/report/index.js.map +1 -0
  7. package/contracts/src/entities/report/report.entity.d.ts +2 -0
  8. package/contracts/src/entities/report/report.entity.js +83 -0
  9. package/contracts/src/entities/report/report.entity.js.map +1 -0
  10. package/contracts/src/entities/report-category/index.d.ts +1 -0
  11. package/contracts/src/entities/report-category/index.js +5 -0
  12. package/contracts/src/entities/report-category/index.js.map +1 -0
  13. package/contracts/src/entities/report-category/report-category.entity.d.ts +2 -0
  14. package/contracts/src/entities/report-category/report-category.entity.js +72 -0
  15. package/contracts/src/entities/report-category/report-category.entity.js.map +1 -0
  16. package/contracts/src/features.keys.d.ts +6 -0
  17. package/contracts/src/features.keys.js +10 -0
  18. package/contracts/src/features.keys.js.map +1 -0
  19. package/contracts/src/index.d.ts +6 -0
  20. package/contracts/src/index.js +12 -0
  21. package/contracts/src/index.js.map +1 -0
  22. package/contracts/src/menu.keys.d.ts +6 -0
  23. package/contracts/src/menu.keys.js +10 -0
  24. package/contracts/src/menu.keys.js.map +1 -0
  25. package/contracts/src/permission.keys.d.ts +19 -0
  26. package/contracts/src/permission.keys.js +23 -0
  27. package/contracts/src/permission.keys.js.map +1 -0
  28. package/contracts/src/report.types.d.ts +477 -0
  29. package/contracts/src/report.types.js +5 -0
  30. package/contracts/src/report.types.js.map +1 -0
  31. package/contracts/src/root-config.d.ts +34 -0
  32. package/contracts/src/root-config.js +39 -0
  33. package/contracts/src/root-config.js.map +1 -0
  34. package/package.json +27 -0
  35. package/server/src/index.d.ts +8 -0
  36. package/server/src/index.js +16 -0
  37. package/server/src/index.js.map +1 -0
  38. package/server/src/lib/report-browse.service.d.ts +13 -0
  39. package/server/src/lib/report-browse.service.js +128 -0
  40. package/server/src/lib/report-browse.service.js.map +1 -0
  41. package/server/src/lib/report-browse.types.d.ts +69 -0
  42. package/server/src/lib/report-browse.types.js +5 -0
  43. package/server/src/lib/report-browse.types.js.map +1 -0
  44. package/server/src/lib/report-management-server.module.d.ts +2 -0
  45. package/server/src/lib/report-management-server.module.js +30 -0
  46. package/server/src/lib/report-management-server.module.js.map +1 -0
  47. package/server/src/lib/report-management.controller.d.ts +11 -0
  48. package/server/src/lib/report-management.controller.js +74 -0
  49. package/server/src/lib/report-management.controller.js.map +1 -0
  50. package/server/src/lib/seed/index.d.ts +19 -0
  51. package/server/src/lib/seed/index.js +21 -0
  52. package/server/src/lib/seed/index.js.map +1 -0
  53. package/server/src/lib/seed/report-management-seed.provider.d.ts +4 -0
  54. package/server/src/lib/seed/report-management-seed.provider.js +18 -0
  55. package/server/src/lib/seed/report-management-seed.provider.js.map +1 -0
  56. package/server/src/lib/seed/report-management-seed.tokens.d.ts +1 -0
  57. package/server/src/lib/seed/report-management-seed.tokens.js +7 -0
  58. package/server/src/lib/seed/report-management-seed.tokens.js.map +1 -0
  59. package/server/src/lib/seed/report-management.seed-catalog.d.ts +2 -0
  60. package/server/src/lib/seed/report-management.seed-catalog.js +10 -0
  61. package/server/src/lib/seed/report-management.seed-catalog.js.map +1 -0
  62. package/server/src/lib/seed/samples/employee-report.mock.d.ts +9 -0
  63. package/server/src/lib/seed/samples/employee-report.mock.js +322 -0
  64. package/server/src/lib/seed/samples/employee-report.mock.js.map +1 -0
  65. package/server/src/lib/seed/samples/index.d.ts +2 -0
  66. package/server/src/lib/seed/samples/index.js +6 -0
  67. package/server/src/lib/seed/samples/index.js.map +1 -0
  68. package/server/src/lib/seed/samples/location-report.mock.d.ts +9 -0
  69. package/server/src/lib/seed/samples/location-report.mock.js +339 -0
  70. package/server/src/lib/seed/samples/location-report.mock.js.map +1 -0
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportBrowseService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@acorex-platform/framework-server/core");
7
+ const report_1 = require("@acorex-platform/framework-server/report");
8
+ //#region ---- Report browse service ----
9
+ let ReportBrowseService = class ReportBrowseService {
10
+ constructor(storage) {
11
+ this.storage = storage;
12
+ }
13
+ listRootCategories() {
14
+ return tslib_1.__awaiter(this, arguments, void 0, function* (skip = 0, take = 1000) {
15
+ const { categories, reports } = yield this.loadAll();
16
+ const roots = categories.filter((c) => !c.parentId);
17
+ const paged = roots.slice(skip, skip + take);
18
+ const items = paged.map((category) => this.mapCategoryToApiItem(category, categories, reports, { includeChildren: false }));
19
+ return { totalCount: roots.length, items };
20
+ });
21
+ }
22
+ getCategoryById(categoryId) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const { categories, reports } = yield this.loadAll();
25
+ const category = categories.find((c) => c.id === categoryId);
26
+ if (!category) {
27
+ throw new common_1.NotFoundException(`Report category with ID ${categoryId} not found`);
28
+ }
29
+ const item = this.mapCategoryToApiItem(category, categories, reports, { includeChildren: true });
30
+ return { totalCount: 1, items: [item] };
31
+ });
32
+ }
33
+ getReportDefinition(reportId) {
34
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
+ const report = (yield this.storage.getOne(report_1.REPORT_ENTITY, reportId));
36
+ if (!report) {
37
+ throw new common_1.NotFoundException(`Report with ID ${reportId} not found`);
38
+ }
39
+ return this.mapReportToApiResponse(report);
40
+ });
41
+ }
42
+ loadAll() {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ var _a, _b;
45
+ const [categoriesResult, reportsResult] = yield Promise.all([
46
+ this.storage.query(report_1.REPORT_CATEGORY_ENTITY, { skip: 0, take: 10000 }),
47
+ this.storage.query(report_1.REPORT_ENTITY, { skip: 0, take: 10000 })
48
+ ]);
49
+ return {
50
+ categories: ((_a = categoriesResult.items) !== null && _a !== void 0 ? _a : []),
51
+ reports: ((_b = reportsResult.items) !== null && _b !== void 0 ? _b : []),
52
+ };
53
+ });
54
+ }
55
+ mapCategoryToApiItem(category, allCategories, allReports, options) {
56
+ var _a, _b, _c, _d;
57
+ const childCategories = allCategories.filter((c) => c.parentId === category.id);
58
+ const directReports = allReports.filter((r) => { var _a; return ((_a = r.categoryIds) !== null && _a !== void 0 ? _a : []).includes(category.id); });
59
+ const folderCount = (_a = category.childrenCount) !== null && _a !== void 0 ? _a : childCategories.length;
60
+ const itemCount = (_b = category.itemsCount) !== null && _b !== void 0 ? _b : directReports.length;
61
+ const folderItems = options.includeChildren
62
+ ? childCategories.map((child) => this.mapCategoryToApiItem(child, allCategories, allReports, { includeChildren: true }))
63
+ : [];
64
+ const reportDefinitionItems = options.includeChildren
65
+ ? directReports.map((r) => this.mapReportToApiItem(r))
66
+ : [];
67
+ return {
68
+ id: category.id,
69
+ name: toApiName(category.title),
70
+ title: category.title,
71
+ description: (_c = category.description) !== null && _c !== void 0 ? _c : null,
72
+ reportCategoryParentId: (_d = category.parentId) !== null && _d !== void 0 ? _d : null,
73
+ folderCount,
74
+ itemCount,
75
+ isArchived: false,
76
+ reportDefinitionItems,
77
+ folderItems,
78
+ };
79
+ }
80
+ mapReportToApiItem(report) {
81
+ var _a, _b;
82
+ return {
83
+ id: report.id,
84
+ name: toApiName(report.title),
85
+ title: report.title,
86
+ description: (_a = report.description) !== null && _a !== void 0 ? _a : null,
87
+ categoryIds: (_b = report.categoryIds) !== null && _b !== void 0 ? _b : [],
88
+ isArchived: false,
89
+ };
90
+ }
91
+ mapReportToApiResponse(report) {
92
+ var _a, _b, _c, _d, _e, _f, _g;
93
+ const title = String((_a = report['title']) !== null && _a !== void 0 ? _a : '');
94
+ const parameterGroups = (_b = report['parameterGroups']) !== null && _b !== void 0 ? _b : [];
95
+ const layouts = ((_c = report['layouts']) !== null && _c !== void 0 ? _c : []).map((layout) => (Object.assign(Object.assign({}, layout), { dataSource: layout.dataSource
96
+ ? {
97
+ type: layout.dataSource.type,
98
+ name: layout.dataSource.name,
99
+ provider: layout.dataSource.provider,
100
+ pagination: layout.dataSource.pagination,
101
+ sortFields: layout.dataSource.sortFields,
102
+ }
103
+ : undefined })));
104
+ return {
105
+ id: String((_d = report['id']) !== null && _d !== void 0 ? _d : ''),
106
+ name: toApiName(title),
107
+ title,
108
+ description: (_e = report['description']) !== null && _e !== void 0 ? _e : null,
109
+ categoryIds: (_f = report['categoryIds']) !== null && _f !== void 0 ? _f : [],
110
+ parameterGroups,
111
+ layouts,
112
+ defaultLayoutId: String((_g = report['defaultLayoutId']) !== null && _g !== void 0 ? _g : ''),
113
+ };
114
+ }
115
+ };
116
+ exports.ReportBrowseService = ReportBrowseService;
117
+ exports.ReportBrowseService = ReportBrowseService = tslib_1.__decorate([
118
+ (0, common_1.Injectable)(),
119
+ tslib_1.__metadata("design:paramtypes", [core_1.EntityStorageMiddlewareService])
120
+ ], ReportBrowseService);
121
+ function toApiName(title) {
122
+ return title
123
+ .toLowerCase()
124
+ .replace(/[^a-z0-9]+/g, '_')
125
+ .replace(/^_|_$/g, '');
126
+ }
127
+ //#endregion
128
+ //# sourceMappingURL=report-browse.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-browse.service.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-browse.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA+D;AAC/D,iEAAwF;AACxF,qEAAiG;AAUjG,yCAAyC;AAGlC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,OAAuC;QAAvC,YAAO,GAAP,OAAO,CAAgC;IAAG,CAAC;IAElE,kBAAkB;qEAAC,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI;YAC5C,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,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GAAG,CAAC;SAC3B,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED,YAAY"}
@@ -0,0 +1,69 @@
1
+ export interface ReportCategoryApiResponse {
2
+ totalCount: number;
3
+ items: ReportCategoryApiItem[];
4
+ }
5
+ export interface ReportCategoryApiItem {
6
+ id: string;
7
+ name: string;
8
+ title: string;
9
+ description: string | null;
10
+ reportCategoryParentId: string | null;
11
+ folderCount: number;
12
+ itemCount: number;
13
+ isArchived: boolean;
14
+ reportDefinitionItems: ReportDefinitionApiItem[];
15
+ folderItems: ReportCategoryApiItem[];
16
+ }
17
+ export interface ReportDefinitionApiItem {
18
+ id: string;
19
+ name: string;
20
+ title: string;
21
+ description: string | null;
22
+ categoryIds: string[];
23
+ isArchived: boolean;
24
+ }
25
+ export interface ReportDefinitionApiResponse {
26
+ id: string;
27
+ name: string;
28
+ title: string;
29
+ description: string | null;
30
+ categoryIds: string[];
31
+ parameterGroups: ReportParameterGroupApi[];
32
+ layouts: ReportLayoutDefinitionApi[];
33
+ defaultLayoutId: string;
34
+ }
35
+ export interface ReportParameterGroupApi {
36
+ name: string;
37
+ title: string;
38
+ description?: string;
39
+ parameters: ReportParameterApi[];
40
+ }
41
+ export interface ReportParameterApi {
42
+ path: string;
43
+ title: string;
44
+ description?: string;
45
+ widget: {
46
+ type: string;
47
+ path?: string | null;
48
+ options?: unknown;
49
+ valueTransforms?: unknown;
50
+ };
51
+ }
52
+ export interface ReportLayoutDefinitionApi {
53
+ id: string;
54
+ title: string;
55
+ description?: string;
56
+ layout: unknown;
57
+ dataSource?: {
58
+ type: string;
59
+ name?: string;
60
+ provider?: string;
61
+ pagination?: boolean;
62
+ sortFields?: Array<{
63
+ name: string;
64
+ dir?: string;
65
+ }>;
66
+ };
67
+ export?: unknown;
68
+ isDefault?: boolean;
69
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ //#region ---- Report browse API DTOs (connectivity/api contract) ----
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //#endregion
5
+ //# sourceMappingURL=report-browse.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-browse.types.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-browse.types.ts"],"names":[],"mappings":";AAAA,sEAAsE;;AA2EtE,YAAY"}
@@ -0,0 +1,2 @@
1
+ export declare class ReportManagementServerModule {
2
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportManagementServerModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const report_management_seed_catalog_1 = require("./seed/report-management.seed-catalog");
7
+ const report_management_seed_tokens_1 = require("./seed/report-management-seed.tokens");
8
+ const report_management_seed_provider_1 = require("./seed/report-management-seed.provider");
9
+ const report_1 = require("@acorex-platform/framework-server/report");
10
+ const report_browse_service_1 = require("./report-browse.service");
11
+ const report_management_controller_1 = require("./report-management.controller");
12
+ //#region ---- Report management backend module ----
13
+ let ReportManagementServerModule = class ReportManagementServerModule {
14
+ };
15
+ exports.ReportManagementServerModule = ReportManagementServerModule;
16
+ exports.ReportManagementServerModule = ReportManagementServerModule = tslib_1.__decorate([
17
+ (0, common_1.Module)({
18
+ imports: [report_1.ReportModule],
19
+ controllers: [report_management_controller_1.ReportManagementController],
20
+ providers: [
21
+ report_management_seed_provider_1.ReportManagementSeedCatalogProvider,
22
+ {
23
+ provide: report_management_seed_tokens_1.REPORT_MANAGEMENT_MODULE_SEED,
24
+ useValue: report_management_seed_catalog_1.reportmanagementSeedCatalog,
25
+ }, report_browse_service_1.ReportBrowseService
26
+ ],
27
+ })
28
+ ], ReportManagementServerModule);
29
+ //#endregion
30
+ //# sourceMappingURL=report-management-server.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-management-server.module.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-management-server.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,0FAAoF;AACpF,wFAAqF;AACrF,4FAA6F;AAE7F,qEAAwE;AACxE,mEAA8D;AAC9D,iFAA4E;AAE5E,oDAAoD;AAY7C,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;CAAG,CAAA;AAA/B,oEAA4B;uCAA5B,4BAA4B;IAVxC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,qBAAY,CAAC;QACvB,WAAW,EAAE,CAAC,yDAA0B,CAAC;QACzC,SAAS,EAAE;YACT,qEAAmC;YACnC;gBACE,OAAO,EAAE,6DAA6B;gBACtC,QAAQ,EAAE,4DAA2B;aACtC,EAAC,2CAAmB;SAAC;KACzB,CAAC;GACW,4BAA4B,CAAG;AAE5C,YAAY"}
@@ -0,0 +1,11 @@
1
+ import { ReportExecuteService, type ReportExecuteBodyDto, type ReportExecuteResponseDto } from '@acorex-platform/framework-server/report';
2
+ import { ReportBrowseService } from './report-browse.service';
3
+ export declare class ReportManagementController {
4
+ private readonly reportExecute;
5
+ private readonly reportBrowse;
6
+ constructor(reportExecute: ReportExecuteService, reportBrowse: ReportBrowseService);
7
+ listRootCategories(skip?: string, take?: string): Promise<import("./report-browse.types").ReportCategoryApiResponse>;
8
+ getCategoryById(parentId: string): Promise<import("./report-browse.types").ReportCategoryApiResponse>;
9
+ getReportDefinition(id: string): Promise<import("./report-browse.types").ReportDefinitionApiResponse>;
10
+ executeReport(body: ReportExecuteBodyDto): Promise<ReportExecuteResponseDto>;
11
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportManagementController = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ const security_1 = require("@acorex-platform/framework-server/security");
8
+ const report_1 = require("@acorex-platform/framework-server/report");
9
+ const report_browse_service_1 = require("./report-browse.service");
10
+ //#region ---- Report management REST API ----
11
+ let ReportManagementController = class ReportManagementController {
12
+ constructor(reportExecute, reportBrowse) {
13
+ this.reportExecute = reportExecute;
14
+ this.reportBrowse = reportBrowse;
15
+ }
16
+ listRootCategories(skip, take) {
17
+ const skipNum = skip != null ? Number(skip) : 0;
18
+ const takeNum = take != null ? Number(take) : 1000;
19
+ return this.reportBrowse.listRootCategories(Number.isFinite(skipNum) ? skipNum : 0, Number.isFinite(takeNum) ? takeNum : 1000);
20
+ }
21
+ getCategoryById(parentId) {
22
+ return this.reportBrowse.getCategoryById(parentId);
23
+ }
24
+ getReportDefinition(id) {
25
+ return this.reportBrowse.getReportDefinition(id);
26
+ }
27
+ executeReport(body) {
28
+ return this.reportExecute.execute(body);
29
+ }
30
+ };
31
+ exports.ReportManagementController = ReportManagementController;
32
+ tslib_1.__decorate([
33
+ (0, common_1.Get)('category'),
34
+ (0, swagger_1.ApiOperation)({ summary: 'List root report categories' }),
35
+ tslib_1.__param(0, (0, common_1.Query)('Skip')),
36
+ tslib_1.__param(1, (0, common_1.Query)('Take')),
37
+ tslib_1.__metadata("design:type", Function),
38
+ tslib_1.__metadata("design:paramtypes", [String, String]),
39
+ tslib_1.__metadata("design:returntype", void 0)
40
+ ], ReportManagementController.prototype, "listRootCategories", null);
41
+ tslib_1.__decorate([
42
+ (0, common_1.Get)('category/:parentId'),
43
+ (0, swagger_1.ApiOperation)({ summary: 'Get report category with child folders and report stubs' }),
44
+ tslib_1.__param(0, (0, common_1.Param)('parentId')),
45
+ tslib_1.__metadata("design:type", Function),
46
+ tslib_1.__metadata("design:paramtypes", [String]),
47
+ tslib_1.__metadata("design:returntype", void 0)
48
+ ], ReportManagementController.prototype, "getCategoryById", null);
49
+ tslib_1.__decorate([
50
+ (0, common_1.Get)('report/:id'),
51
+ (0, swagger_1.ApiOperation)({ summary: 'Get full report definition' }),
52
+ tslib_1.__param(0, (0, common_1.Param)('id')),
53
+ tslib_1.__metadata("design:type", Function),
54
+ tslib_1.__metadata("design:paramtypes", [String]),
55
+ tslib_1.__metadata("design:returntype", void 0)
56
+ ], ReportManagementController.prototype, "getReportDefinition", null);
57
+ tslib_1.__decorate([
58
+ (0, common_1.Post)('report/execute'),
59
+ (0, swagger_1.ApiOperation)({ summary: 'Execute report' }),
60
+ tslib_1.__param(0, (0, common_1.Body)()),
61
+ tslib_1.__metadata("design:type", Function),
62
+ tslib_1.__metadata("design:paramtypes", [Object]),
63
+ tslib_1.__metadata("design:returntype", Promise)
64
+ ], ReportManagementController.prototype, "executeReport", null);
65
+ exports.ReportManagementController = ReportManagementController = tslib_1.__decorate([
66
+ (0, swagger_1.ApiTags)('report-management'),
67
+ (0, swagger_1.ApiBearerAuth)(),
68
+ (0, common_1.UseGuards)(security_1.JwtAuthGuard),
69
+ (0, common_1.Controller)('v1/global/report-management'),
70
+ tslib_1.__metadata("design:paramtypes", [report_1.ReportExecuteService,
71
+ report_browse_service_1.ReportBrowseService])
72
+ ], ReportManagementController);
73
+ //#endregion
74
+ //# sourceMappingURL=report-management.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-management.controller.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-management.controller.ts"],"names":[],"mappings":";;;;AAAA,2CAAsF;AACtF,6CAAuE;AACvE,yEAA0E;AAC1E,qEAIkD;AAClD,mEAA8D;AAE9D,8CAA8C;AAMvC,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YACmB,aAAmC,EACnC,YAAiC;QADjC,kBAAa,GAAb,aAAa,CAAsB;QACnC,iBAAY,GAAZ,YAAY,CAAqB;IACjD,CAAC;IAIJ,kBAAkB,CACD,IAAa,EACb,IAAa;QAE5B,MAAM,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC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AAO,EAAE,gBAAgB,EAAE,CAAC;IAC7B,mBAAA,IAAA,aAAI,GAAE,CAAA;;;;+DAEpB;qCApCU,0BAA0B;IAJtC,IAAA,iBAAO,EAAC,mBAAmB,CAAC;IAC5B,IAAA,uBAAa,GAAE;IACf,IAAA,kBAAS,EAAC,uBAAY,CAAC;IACvB,IAAA,mBAAU,EAAC,6BAA6B,CAAC;6CAGN,6BAAoB;QACrB,2CAAmB;GAHzC,0BAA0B,CAqCtC;AAED,YAAY"}
@@ -0,0 +1,19 @@
1
+ export interface ReportManagementSeedContext {
2
+ moduleName: string;
3
+ route: string;
4
+ }
5
+ export declare const reportManagementSeedContext: {
6
+ moduleName: string;
7
+ route: string;
8
+ };
9
+ export declare const reportManagementSeedData: {
10
+ module: {
11
+ name: string;
12
+ title: `@${string}:module.title`;
13
+ icon: "fa-light fa-chart-bar";
14
+ i18n: string;
15
+ required: boolean;
16
+ };
17
+ };
18
+ export * from './report-management.seed-catalog';
19
+ export * from './samples';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reportManagementSeedData = exports.reportManagementSeedContext = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const module_report_management_contracts_1 = require("@acorex-platform/module-report-management-contracts");
6
+ exports.reportManagementSeedContext = {
7
+ moduleName: module_report_management_contracts_1.RootConfig.module.name,
8
+ route: 'report-management',
9
+ };
10
+ exports.reportManagementSeedData = {
11
+ module: {
12
+ name: module_report_management_contracts_1.RootConfig.module.name,
13
+ title: module_report_management_contracts_1.RootConfig.module.title,
14
+ icon: module_report_management_contracts_1.RootConfig.module.icon,
15
+ i18n: module_report_management_contracts_1.RootConfig.config.i18n,
16
+ required: false,
17
+ },
18
+ };
19
+ tslib_1.__exportStar(require("./report-management.seed-catalog"), exports);
20
+ tslib_1.__exportStar(require("./samples"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/seed/index.ts"],"names":[],"mappings":";;;;AAAA,4GAAiF;AAOpE,QAAA,2BAA2B,GAAG;IACzC,UAAU,EAAE,+CAAU,CAAC,MAAM,CAAC,IAAI;IAClC,KAAK,EAAE,mBAAmB;CAC3B,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACtC,MAAM,EAAE;QACN,IAAI,EAAE,+CAAU,CAAC,MAAM,CAAC,IAAI;QAC5B,KAAK,EAAE,+CAAU,CAAC,MAAM,CAAC,KAAK;QAC9B,IAAI,EAAE,+CAAU,CAAC,MAAM,CAAC,IAAI;QAC5B,IAAI,EAAE,+CAAU,CAAC,MAAM,CAAC,IAAI;QAC5B,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC;AACF,2EAAiD;AACjD,oDAA0B"}
@@ -0,0 +1,4 @@
1
+ import type { AXPModuleSeedCatalog } from '@acorex-platform/module-common-server/seed';
2
+ export declare class ReportManagementSeedCatalogProvider {
3
+ getCatalog(): AXPModuleSeedCatalog;
4
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportManagementSeedCatalogProvider = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const report_management_seed_catalog_1 = require("./report-management.seed-catalog");
7
+ //#region ---- report-management seed provider ----
8
+ let ReportManagementSeedCatalogProvider = class ReportManagementSeedCatalogProvider {
9
+ getCatalog() {
10
+ return report_management_seed_catalog_1.reportmanagementSeedCatalog;
11
+ }
12
+ };
13
+ exports.ReportManagementSeedCatalogProvider = ReportManagementSeedCatalogProvider;
14
+ exports.ReportManagementSeedCatalogProvider = ReportManagementSeedCatalogProvider = tslib_1.__decorate([
15
+ (0, common_1.Injectable)()
16
+ ], ReportManagementSeedCatalogProvider);
17
+ //#endregion
18
+ //# sourceMappingURL=report-management-seed.provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-management-seed.provider.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/seed/report-management-seed.provider.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAG5C,qFAA+E;AAE/E,mDAAmD;AAG5C,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC9C,UAAU;QACR,OAAO,4DAA2B,CAAC;IACrC,CAAC;CACF,CAAA;AAJY,kFAAmC;8CAAnC,mCAAmC;IAD/C,IAAA,mBAAU,GAAE;GACA,mCAAmC,CAI/C;AAED,YAAY"}
@@ -0,0 +1 @@
1
+ export declare const REPORT_MANAGEMENT_MODULE_SEED = "REPORT_MANAGEMENT_MODULE_SEED";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ //#region ---- report-management seed tokens ----
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.REPORT_MANAGEMENT_MODULE_SEED = void 0;
5
+ exports.REPORT_MANAGEMENT_MODULE_SEED = 'REPORT_MANAGEMENT_MODULE_SEED';
6
+ //#endregion
7
+ //# sourceMappingURL=report-management-seed.tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-management-seed.tokens.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/seed/report-management-seed.tokens.ts"],"names":[],"mappings":";AAAA,iDAAiD;;;AAEpC,QAAA,6BAA6B,GAAG,+BAA+B,CAAC;AAE7E,YAAY"}
@@ -0,0 +1,2 @@
1
+ import type { AXPModuleSeedCatalog } from '@acorex-platform/module-common-server/seed';
2
+ export declare const reportmanagementSeedCatalog: AXPModuleSeedCatalog;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reportmanagementSeedCatalog = void 0;
4
+ //#region ---- report-management seed catalog ----
5
+ exports.reportmanagementSeedCatalog = {
6
+ moduleName: 'report-management',
7
+ definitions: [],
8
+ };
9
+ //#endregion
10
+ //# sourceMappingURL=report-management.seed-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-management.seed-catalog.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/seed/report-management.seed-catalog.ts"],"names":[],"mappings":";;;AAEA,kDAAkD;AAErC,QAAA,2BAA2B,GAAyB;IAC/D,UAAU,EAAE,mBAAmB;IAC/B,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,YAAY"}
@@ -0,0 +1,9 @@
1
+ import { AXPReportCategory, AXPReportDefinition } from '@acorex-platform/module-report-management-contracts';
2
+ export declare const EMPLOYEE_REPORT_CATEGORIES: AXPReportCategory[];
3
+ export declare const EMPLOYEE_REPORT_DEFINITIONS: AXPReportDefinition[];
4
+ /**
5
+ * Create a mapping of categories to their reports for easy lookup
6
+ *
7
+ * Optimization: Only processes categories with itemsCount > 0
8
+ */
9
+ export declare const EMPLOYEE_CATEGORY_REPORT_MAPPING: Map<string, AXPReportDefinition[]>;