|
1 | 1 | // SPDX-License-Identifier: Apache-2.0
|
| 2 | +import { createSimpleConditionsBuffer } from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; |
2 | 3 | import { unwrap } from '@tazama-lf/frms-coe-lib/lib/helpers/unwrap';
|
3 | 4 | import { type AccountCondition, type ConditionEdge, type EntityCondition } from '@tazama-lf/frms-coe-lib/lib/interfaces';
|
4 | 5 | import {
|
5 | 6 | type AccountConditionResponse,
|
6 | 7 | type EntityConditionResponse,
|
7 | 8 | } from '@tazama-lf/frms-coe-lib/lib/interfaces/event-flow/ConditionDetails';
|
8 | 9 | import {
|
9 |
| - type Entity, |
10 | 10 | type Account,
|
| 11 | + type Entity, |
11 | 12 | type RawConditionResponse,
|
12 | 13 | } from '@tazama-lf/frms-coe-lib/lib/interfaces/event-flow/EntityConditionEdge';
|
13 |
| -import { databaseManager, loggerService } from '.'; |
14 |
| -import { configuration } from './config'; |
15 |
| -import { type ConditionRequest } from './interface/query'; |
16 |
| -import { type Report } from './interface/report.interface'; |
17 |
| -import { checkConditionValidity, validateAndParseExpirationDate } from './utils/condition-validation'; |
18 |
| -import { filterConditions } from './utils/filter-active-conditions'; |
19 |
| -import { parseConditionAccount, parseConditionEntity } from './utils/parse-condition'; |
20 |
| -import { updateCache } from './utils/update-cache'; |
21 |
| -import { createSimpleConditionsBuffer } from '@tazama-lf/frms-coe-lib/lib/helpers/protobuf'; |
| 14 | +import { databaseManager, loggerService } from '..'; |
| 15 | +import { configuration } from '../config'; |
| 16 | +import { type ConditionRequest } from '../interface/query'; |
| 17 | +import { checkConditionValidity, validateAndParseExpirationDate } from '../utils/condition-validation'; |
| 18 | +import { filterConditions } from '../utils/filter-active-conditions'; |
| 19 | +import { parseConditionAccount, parseConditionEntity } from '../utils/parse-condition'; |
| 20 | +import { updateCache } from '../utils/update-cache'; |
22 | 21 |
|
23 | 22 | const saveConditionEdges = async (
|
24 | 23 | perspective: string,
|
@@ -60,27 +59,6 @@ const saveConditionEdges = async (
|
60 | 59 | }
|
61 | 60 | };
|
62 | 61 |
|
63 |
| -export const handleGetReportRequestByMsgId = async (msgid: string): Promise<Report | undefined> => { |
64 |
| - let unWrappedReport; |
65 |
| - try { |
66 |
| - loggerService.log(`Started handling get request by message id the message id is ${msgid}`); |
67 |
| - |
68 |
| - const report = (await databaseManager.getReportByMessageId('transactions', msgid)) as Report[][]; |
69 |
| - |
70 |
| - unWrappedReport = unwrap<Report>(report); |
71 |
| - } catch (error) { |
72 |
| - const errorMessage = error as { message: string }; |
73 |
| - loggerService.log( |
74 |
| - `Failed fetching report from database service with error message: ${errorMessage.message}`, |
75 |
| - 'handleGetReportRequestByMsgId()', |
76 |
| - ); |
77 |
| - throw new Error(errorMessage.message); |
78 |
| - } finally { |
79 |
| - loggerService.log('Completed handling get report by message id'); |
80 |
| - } |
81 |
| - return unWrappedReport; |
82 |
| -}; |
83 |
| - |
84 | 62 | export const handlePostConditionEntity = async (
|
85 | 63 | condition: EntityCondition,
|
86 | 64 | ): Promise<{ message: string; result: EntityConditionResponse }> => {
|
|
0 commit comments