Skip to content

Commit

Permalink
Merge pull request #139 from mojaloop/change-date-to-number
Browse files Browse the repository at this point in the history
Changed output date formats to Number instead of string.
  • Loading branch information
johanfol authored Jan 25, 2021
2 parents 67517cf + b82cdeb commit 4592626
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion typology-11/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RESULT_TOPIC=typology11Result
CONSUMER_GROUP=kafka-node-group
PARTITION=0
AUTO_COMMIT=false
LOG_TOPIC=typology214log
LOG_TOPIC=typology11log
MAX_QUEUE_SIZE=50
MAX_PARALLEL_HANDLES=10
REDIS_AUTH=yourpassword
Expand Down
4 changes: 2 additions & 2 deletions typology-11/src/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const createConsumer = (config: ConfigObj) => new kafka.ConsumerGroup(
*/
const createKafkaConsumer = async (senderClient: RedisClient, receiverClient: RedisClient) => {
const { topic } = config;
log('Starting Typology 214 engine...', topic);
log('Starting Typology 11 engine...', topic);
try {
const consumer = createConsumer(config);
let paused = false;
Expand Down Expand Up @@ -56,7 +56,7 @@ const createKafkaConsumer = async (senderClient: RedisClient, receiverClient: Re
paused = true;
}
});
log('Started Typology 214 engine.', topic);
log('Started Typology 11 engine.', topic);
} catch (e) {
log(`Unhandled exception while starting consumer with details: ${e}`, topic);
}
Expand Down
3 changes: 2 additions & 1 deletion typology-11/src/scoring-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const handleScores = (scores: any, topic: string, TransactionID: string, transac
+ (scores.rule86 ? 0.25 : 0)
+ (scores.rule87 ? 0.25 : 0);

publish(topic, `"typology":"typology-11","transactionID":"${TransactionID}","score":${score},"createDate":"${transactionDate}",

publish(topic, `"typology":"typology-11","transactionID":"${TransactionID}","score":${score},"createDate":${transactionDate},
"textResult":"Typology 11 score is ${score}, Reason: ${
+ (scores.rule17 ? 'Transaction Divergence, ' : '')
+ (scores.rule27 ? 'Transaction Mirroring, ' : '')
Expand Down
2 changes: 1 addition & 1 deletion typology-214/src/scoring-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const handleScores = (scores: any, topic: string, TransactionID: string, transac
+ (scores.rule48 ? 0.2 : 0)
+ (scores.rule78 ? 0.2 : 0);

publish(topic, `"typology":"typology-214","transactionID":"${TransactionID}","score":${score},"createDate":"${transactionDate}",
publish(topic, `"typology":"typology-214","transactionID":"${TransactionID}","score":${score},"createDate":${transactionDate},
"textResult":"Typology 214 score is ${score}, Reason: ${(scores.rule3 ? 'Account Dormancy - Payee, ' : '')
+ (scores.rule12 ? 'Party Type Individual, ' : '')
+ (scores.rule27 ? 'Transaction Mirroring, ' : '')
Expand Down
2 changes: 1 addition & 1 deletion typology-27/src/scoring-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const handleScores = (scores: any, topic: string, TransactionID: string, transac
+ (scores.rule78 ? 0.2 : 0)
);

publish(topic, `"typology":"typology-27","transactionID":"${TransactionID}","score":${score},"createDate":"${transactionDate}",
publish(topic, `"typology":"typology-27","transactionID":"${TransactionID}","score":${score},"createDate":${transactionDate},
"textResult":"Typology 27 score is ${score}, Reason: ${(scores.rule9 ? 'Recent Sim Swap, ' : '')
+ (scores.rule12 ? 'Party Type Individual, ' : '')
+ (scores.rule14 ? 'Recent Password Reset, ' : '')
Expand Down
2 changes: 1 addition & 1 deletion typology-28/src/scoring-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const handleScores = (scores: any, topic: string, TransactionID: string, transac
+ (scores.rule64 ? 0.15 : 0)
;

publish(topic, `"typology":"typology-28","transactionID":"${TransactionID}","createDate":"${transactionDate}",
publish(topic, `"typology":"typology-28","transactionID":"${TransactionID}","createDate":${transactionDate},
"score":${score},"textResult":"Typology 28 score is ${score}, Reason: ${(scores.rule2 ? 'Velocity (incoming), ' : '')
+ (scores.rule12 ? 'Party Type Individual, ' : '')
+ (scores.rule16 ? 'Transaction Convergence, ' : '')
Expand Down

0 comments on commit 4592626

Please sign in to comment.