Skip to content

Commit d892308

Browse files
Remove fetchFinancialData function and related interface; add getProjectUnits function for weekly financial reports
- Deleted `fetchFinancialData.ts` which contained the financial data fetching logic. - Introduced `getProjectUnits.ts` to fetch project units and write the results to a JSON file. - Updated `index.ts` files to export new functionalities for better modularity. These changes streamline the financial data handling and enhance the reporting capabilities for weekly financial reports.
1 parent 022ed8d commit d892308

File tree

4 files changed

+20
-32
lines changed

4 files changed

+20
-32
lines changed

workers/main/src/activities/fetchFinancialData.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './weeklyFinancialReports';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { writeJsonFile } from '../../common/fileUtils';
2+
import {TargetUnitRepository} from "../../services/TargetUnit/TargetUnitRepository";
3+
import {RedminePool} from "../../common/RedminePool";
4+
import {redmineDatabaseConfig} from "../../configs/redmineDatabase";
5+
6+
7+
export const getProjectUnits = async () => {
8+
const pool = new RedminePool(redmineDatabaseConfig).getPool();
9+
const repo = new TargetUnitRepository(pool);
10+
const result = await repo.getTargetUnits();
11+
const filename = `data/weeklyFinancialReportsWorkflow/getProjectUnits/project-units-${Date.now()}.json`;
12+
13+
await writeJsonFile(filename, result);
14+
15+
return {
16+
fileLink: `${filename}`,
17+
};
18+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './getProjectUnits';

0 commit comments

Comments
 (0)