@@ -94,7 +94,7 @@ describe('TADProc Service', () => {
9494 } ;
9595
9696 const getMockTypologyResult = ( ruleResults : RuleResult [ ] ) : TypologyResult => {
97- return { result :
50 , id :
'[email protected] ' , cfg :
'[email protected] ' , threshold : 0 , ruleResults
} ; 97+ return { result :
50 , id :
'[email protected] ' , cfg :
'[email protected] ' , workflow : { alertThreshold : '50' , interdictionThreshold : '' } , ruleResults
} ; 9898 } ;
9999
100100 const getMockNetworkMapWithMultipleChannels = ( ) => {
@@ -148,7 +148,7 @@ describe('TADProc Service', () => {
148148 return new Promise < Record < string , unknown > [ ] > ( ( resolve , reject ) =>
149149 resolve ( [
150150 JSON . parse (
151- '{"channelResult":{"result":0,"id":"[email protected] ","cfg":"1.0","typologyResult":[{"id":"[email protected] ","cfg":"1.0","result":50,"ruleResults":[{"id":"[email protected] ","cfg":"1.0","result":true,"reason":"asdf","subRuleRef":"123"},{"id":"[email protected] ","cfg":"1.0","result":true,"subRuleRef":"04","reason":"Thedebtoris50orolder"}]}]}}' , 151+ '{"channelResult":{"result":0,"id":"[email protected] ","cfg":"1.0","typologyResult":[{"id":"[email protected] ","review": false, " cfg":"1.0","result":50,"ruleResults":[{"id":"[email protected] ","cfg":"1.0","result":true,"reason":"asdf","subRuleRef":"123"},{"id":"[email protected] ","cfg":"1.0","result":true,"subRuleRef":"04","reason":"Thedebtoris50orolder"}]}]}}' , 152152 ) ,
153153 ] ) ,
154154 ) ;
@@ -186,26 +186,26 @@ describe('TADProc Service', () => {
186186 return Promise . resolve ( ) ;
187187 } ) ;
188188
189- jest . spyOn ( databaseManager , 'getTransactionConfig' ) . mockImplementationOnce ( ( ) => {
190- return new Promise ( ( resolve , reject ) => {
191- resolve (
192- Object . assign (
193- new TransactionConfiguration ( ) ,
194- JSON . parse (
195- '[[{"id":"[email protected] ","cfg":"1.0","txTp":"pacs.002.001.12","channels":[{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20},{"id":"[email protected] ","cfg":"1.0","threshold":20}]},{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20},{"id":"[email protected] ","cfg":"1.0","threshold":20}]}]}]]' , 196- ) ,
197- ) ,
198- ) ;
199- } ) ;
200- } ) ;
189+ // jest.spyOn(databaseManager, 'getTransactionConfig').mockImplementationOnce(() => {
190+ // return new Promise((resolve, reject) => {
191+ // resolve(
192+ // Object.assign(
193+ // new TransactionConfiguration(),
194+ // JSON.parse(
195+ // '[[{"id":"001@1.0","cfg":"1.0","txTp":"pacs.002.001.12","channels":[{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20},{"id":"[email protected] ","cfg":"1.0","threshold":20}]},{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20},{"id":"[email protected] ","cfg":"1.0","threshold":20}]}] }]]', 196+ // ),
197+ // ),
198+ // );
199+ // });
200+ // });
201201
202202 jest . spyOn ( databaseManager , 'getTransactionConfig' ) . mockImplementationOnce ( ( ) => {
203203 return new Promise ( ( resolve , reject ) => {
204204 resolve (
205205 Object . assign (
206206 new TransactionConfiguration ( ) ,
207207 JSON . parse (
208- '[[{"id":"[email protected] ","cfg":"1.0","txTp":"pacs.002.001.12","channels":[{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20} ,{"id":"[email protected] ","cfg":"1.0","threshold":20} ]},{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20} ,{"id":"[email protected] ","cfg":"1.0","threshold":20 }]}]}]]' , 208+ '[[{"id":"[email protected] ","cfg":"1.0","txTp":"pacs.002.001.12","channels":[{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","workflow":{"alertThreshold":"25","interdictionThreshold":"50"}} ,{"id":"[email protected] ","cfg":"1.0","workflow":{"alertThreshold":"25","interdictionThreshold":"50"}} ]},{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","workflow":{"alertThreshold":"25","interdictionThreshold":"50"}} ,{"id":"[email protected] ","cfg":"1.0","workflow":{"alertThreshold":"25","interdictionThreshold":"50"} }]}]}]]' , 209209 ) ,
210210 ) ,
211211 ) ;
@@ -216,7 +216,7 @@ describe('TADProc Service', () => {
216216 return new Promise < Record < string , unknown > [ ] > ( ( resolve ) =>
217217 resolve ( [
218218 JSON . parse (
219- '{"channelResult":{"result":0,"id":"002 @1.0","cfg":"1.0","typologyResult":[{"id":"[email protected] ","cfg":"1.0","result":50,"ruleResults":[{"id":"[email protected] ","cfg":"1.0","result":true,"reason":"asdf","subRuleRef":"123"},{"id":"[email protected] ","cfg":"1.0","result":true,"subRuleRef":"04","reason":"Thedebtoris50orolder"}]}]}}' , 219+ '{"channelResult":{"result":0,"id":"001 @1.0","cfg":"1.0","typologyResult":[{"id":"[email protected] ","cfg":"1.0","review":true ,"result":50,"ruleResults":[{"id":"[email protected] ","cfg":"1.0","result":true,"reason":"asdf","subRuleRef":"123"},{"id":"[email protected] ","cfg":"1.0","result":true,"subRuleRef":"04","reason":"Thedebtoris50orolder"}]}]}}' , 220220 ) ,
221221 ] ) ,
222222 ) ;
@@ -261,18 +261,18 @@ describe('TADProc Service', () => {
261261 } ) ;
262262 } ) ;
263263
264- jest . spyOn ( databaseManager , 'getTransactionConfig' ) . mockImplementationOnce ( ( ) => {
265- return new Promise ( ( resolve , reject ) => {
266- resolve (
267- Object . assign (
268- new TransactionConfiguration ( ) ,
269- JSON . parse (
270- '[[{"id":"[email protected] ","cfg":"1.0","txTp":"pacs.002.001.12","channels":[{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20},{"id":"[email protected] ","cfg":"1.0","threshold":20}]},{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20},{"id":"[email protected] ","cfg":"1.0","threshold":20}]}]}]]' , 271- ) ,
272- ) ,
273- ) ;
274- } ) ;
275- } ) ;
264+ // jest.spyOn(databaseManager, 'getTransactionConfig').mockImplementationOnce(() => {
265+ // return new Promise((resolve, reject) => {
266+ // resolve(
267+ // Object.assign(
268+ // new TransactionConfiguration(),
269+ // JSON.parse(
270+ // '[[{"id":"001@1.0","cfg":"1.0","txTp":"pacs.002.001.12","channels":[{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20},{"id":"[email protected] ","cfg":"1.0","threshold":20}]},{"id":"[email protected] ","cfg":"1.0","typologies":[{"id":"[email protected] ","cfg":"1.0","threshold":20},{"id":"[email protected] ","cfg":"1.0","threshold":20}]}] }]]', 271+ // ),
272+ // ),
273+ // );
274+ // });
275+ // });
276276
277277 jest . spyOn ( databaseManager , 'getMemberValues' ) . mockImplementationOnce ( ( ...args : unknown [ ] ) : Promise < Record < string , unknown > [ ] > => {
278278 return new Promise < Record < string , unknown > [ ] > ( ( resolve , reject ) =>
@@ -494,7 +494,17 @@ describe('TADProc Service', () => {
494494 } ) ;
495495
496496 jest . spyOn ( databaseManager , 'getMemberValues' ) . mockImplementation ( ( ...args : unknown [ ] ) : Promise < Record < string , unknown > [ ] > => {
497- return Promise . resolve ( [ { typologyResult :
{ result :
50 , id :
'[email protected] ' , cfg :
'[email protected] ' , threshold :
0 , ruleResults
} } ] ) ; 497+ return Promise . resolve ( [
498+ {
499+ typologyResult : {
500+ result : 50 ,
501+ 502+ 503+ workflow : { alertThreshold : '0' , interdictionThreshold : '' } ,
504+ ruleResults,
505+ } ,
506+ } ,
507+ ] ) ;
498508 } ) ;
499509 } ) ;
500510
@@ -504,7 +514,13 @@ describe('TADProc Service', () => {
504514 const ruleResults : RuleResult [ ] = [ { result : true , id : '' , cfg : '' , subRuleRef : '' , reason : '' } ] ;
505515
506516 const networkMap = getMockNetworkMapWithMultipleChannels ( ) ;
507- const typologyResult :
TypologyResult = { result :
50 , id :
'[email protected] ' , cfg :
'[email protected] ' , threshold :
0 , ruleResults
} ; 517+ const typologyResult : TypologyResult = {
518+ result : 50 ,
519+ 520+ 521+ workflow : { alertThreshold : '0' , interdictionThreshold : '' } ,
522+ ruleResults,
523+ } ;
508524
509525 await helpers . handleTypologies ( expectedReq , networkMap . messages [ 0 ] . channels [ 0 ] , networkMap , typologyResult ) ;
510526
@@ -634,7 +650,13 @@ describe('TADProc Service', () => {
634650 const ruleResults : RuleResult [ ] = [ { result : true , id : '' , cfg : '' , subRuleRef : '' , reason : '' } ] ;
635651
636652 const networkMap = getMockNetworkMapWithMultipleChannels ( ) ;
637- const typologyResult :
TypologyResult = { result :
50 , id :
'[email protected] ' , cfg :
'[email protected] ' , threshold :
0 , ruleResults
} ; 653+ const typologyResult : TypologyResult = {
654+ result : 50 ,
655+ 656+ 657+ workflow : { alertThreshold : '0' , interdictionThreshold : '' } ,
658+ ruleResults,
659+ } ;
638660
639661 await handleExecute ( { transaction : expectedReq , networkMap : networkMap , typologyResult : typologyResult } ) ;
640662
@@ -646,7 +668,14 @@ describe('TADProc Service', () => {
646668 const ruleResults : RuleResult [ ] = [ { result : true , id : '' , cfg : '' , subRuleRef : '' , reason : '' } ] ;
647669
648670 const networkMap = getMockNetworkMap ( ) ;
649- const typologyResult :
TypologyResult = { result :
50 , id :
'[email protected] ' , cfg :
'[email protected] ' , threshold :
0 , ruleResults
} ; 671+ const typologyResult : TypologyResult = {
672+ result : 50 ,
673+ 674+ 675+ review : false ,
676+ workflow : { alertThreshold : '0' , interdictionThreshold : '' } ,
677+ ruleResults,
678+ } ;
650679
651680 const typologySpy = jest . spyOn ( helpers , 'handleTypologies' ) . mockImplementationOnce ( ( ) => {
652681 return Promise . resolve ( [
@@ -684,21 +713,28 @@ describe('TADProc Service', () => {
684713 const ruleResults : RuleResult [ ] = [ { result : true , id : '' , cfg : '' , subRuleRef : '' , reason : '' } ] ;
685714
686715 const networkMap = getMockNetworkMap ( ) ;
687- const typologyResult :
TypologyResult = { result :
50 , id :
'[email protected] ' , cfg :
'[email protected] ' , threshold :
100 , ruleResults
} ; 716+ const typologyResult : TypologyResult = {
717+ result : 50 ,
718+ 719+ 720+ review : true ,
721+ workflow : { alertThreshold : '100' , interdictionThreshold : '' } ,
722+ ruleResults,
723+ } ;
688724
689725 const typologySpy = jest . spyOn ( helpers , 'handleTypologies' ) . mockImplementationOnce ( ( ) => {
690726 return Promise . resolve ( [
691727 {
692728 result : 0 ,
693729694730695- status : 'Review ' ,
731+ status : 'ALRT ' ,
696732 typologyResult : [
697733 {
698734699735 cfg : '1.0' ,
700736 result : 50 ,
701- status : 'Review ' ,
737+ status : 'ALRT ' ,
702738 ruleResults : [
703739 { id :
'[email protected] ' , cfg :
'1.0' , result :
true , reason :
'asdf' , subRuleRef :
'123' } , 704740 { id :
'[email protected] ' , cfg :
'1.0' , result :
true , subRuleRef :
'04' , reason :
'Thedebtoris50orolder' } , @@ -724,7 +760,13 @@ describe('TADProc Service', () => {
724760 const ruleResults : RuleResult [ ] = [ { result : true , id : '' , cfg : '' , subRuleRef : '' , reason : '' } ] ;
725761
726762 const networkMap = getMockNetworkMap ( ) ;
727- const typologyResult :
TypologyResult = { result :
50 , id :
'[email protected] ' , cfg :
'[email protected] ' , threshold :
0 , ruleResults
} ; 763+ const typologyResult : TypologyResult = {
764+ result : 50 ,
765+ 766+ 767+ workflow : { alertThreshold : '0' , interdictionThreshold : '' } ,
768+ ruleResults,
769+ } ;
728770
729771 const typologySpy = jest . spyOn ( helpers , 'handleTypologies' ) . mockRejectedValueOnce ( ( ) => {
730772 return Promise . reject ( ) ;
0 commit comments