-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/#1334 patch request notif #751
Changes from 5 commits
a5bd7ad
a295487
139a8ec
4b13959
1324714
b8d99b3
5f67ae2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,16 +274,16 @@ const fulfil = async (error, messages) => { | |
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, { method: `fulfil:${action}` })) | ||
|
||
const actionLetter = action === TransferEventAction.COMMIT ? Enum.Events.ActionLetter.commit | ||
: (action === TransferEventAction.REJECT ? Enum.Events.ActionLetter.reject | ||
: (action === TransferEventAction.ABORT ? Enum.Events.ActionLetter.abort | ||
: (action === TransferEventAction.BULK_COMMIT ? Enum.Events.ActionLetter.bulkCommit | ||
: (action === TransferEventAction.BULK_ABORT ? Enum.Events.ActionLetter.bulkAbort | ||
: (action === TransferEventAction.RESERVE ? Enum.Events.ActionLetter.reserve // TODO ADD ACTION LETTER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this TODO still applicable? |
||
: (action === TransferEventAction.REJECT ? Enum.Events.ActionLetter.reject | ||
: (action === TransferEventAction.ABORT ? Enum.Events.ActionLetter.abort | ||
: (action === TransferEventAction.BULK_COMMIT ? Enum.Events.ActionLetter.bulkCommit | ||
rmothilal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
: Enum.Events.ActionLetter.unknown)))) | ||
const functionality = action === TransferEventAction.COMMIT ? TransferEventType.NOTIFICATION | ||
: (action === TransferEventAction.REJECT ? TransferEventType.NOTIFICATION | ||
: (action === TransferEventAction.ABORT ? TransferEventType.NOTIFICATION | ||
: (action === TransferEventAction.BULK_COMMIT ? TransferEventType.BULK_PROCESSING | ||
: (action === TransferEventAction.BULK_ABORT ? TransferEventType.BULK_PROCESSING | ||
: (action === TransferEventAction.RESERVE ? TransferEventType.NOTIFICATION | ||
: (action === TransferEventAction.REJECT ? TransferEventType.NOTIFICATION | ||
: (action === TransferEventAction.ABORT ? TransferEventType.NOTIFICATION | ||
: (action === TransferEventAction.BULK_COMMIT ? TransferEventType.BULK_PROCESSING | ||
rmothilal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
: Enum.Events.ActionLetter.unknown)))) | ||
// fulfil-specific declarations | ||
const isTransferError = action === TransferEventAction.ABORT | ||
|
@@ -344,22 +344,22 @@ const fulfil = async (error, messages) => { | |
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, 'handleResend')) | ||
if (transferStateEnum === TransferState.COMMITTED || transferStateEnum === TransferState.ABORTED) { | ||
message.value.content.payload = TransferObjectTransform.toFulfil(transfer) | ||
if (!isTransferError) { | ||
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `callbackFinilized2--${actionLetter}3`)) | ||
const eventDetail = { functionality, action: TransferEventAction.FULFIL_DUPLICATE } | ||
/** | ||
* HOWTO: During bulk fulfil use an individualTransfer from a previous bulk fulfil | ||
*/ | ||
await Kafka.proceed(Config.KAFKA_CONFIG, params, { consumerCommit, eventDetail, fromSwitch }) | ||
histTimerEnd({ success: true, fspId: Config.INSTRUMENTATION_METRICS_LABELS.fspId }) | ||
return true | ||
} else { | ||
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `callbackFinilized3--${actionLetter}4`)) | ||
const eventDetail = { functionality, action: TransferEventAction.ABORT_DUPLICATE } | ||
await Kafka.proceed(Config.KAFKA_CONFIG, params, { consumerCommit, eventDetail, fromSwitch }) | ||
histTimerEnd({ success: true, fspId: Config.INSTRUMENTATION_METRICS_LABELS.fspId }) | ||
return true | ||
const eventDetail = { functionality, action } | ||
if (action !== TransferEventAction.RESERVE) { | ||
if (!isTransferError) { | ||
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `callbackFinilized2--${actionLetter}3`)) | ||
eventDetail.action = TransferEventAction.FULFIL_DUPLICATE | ||
/** | ||
* HOWTO: During bulk fulfil use an individualTransfer from a previous bulk fulfil | ||
*/ | ||
} else { | ||
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `callbackFinilized3--${actionLetter}4`)) | ||
eventDetail.action = TransferEventAction.ABORT_DUPLICATE | ||
} | ||
} | ||
await Kafka.proceed(Config.KAFKA_CONFIG, params, { consumerCommit, eventDetail, fromSwitch }) | ||
histTimerEnd({ success: true, fspId: Config.INSTRUMENTATION_METRICS_LABELS.fspId }) | ||
return true | ||
} else if (transferStateEnum === TransferState.RECEIVED || transferStateEnum === TransferState.RESERVED) { | ||
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `inProgress2--${actionLetter}5`)) | ||
/** | ||
|
@@ -401,7 +401,7 @@ const fulfil = async (error, messages) => { | |
await Kafka.proceed(Config.KAFKA_CONFIG, params, { consumerCommit, fspiopError: fspiopError.toApiErrorObject(Config.ERROR_HANDLING), eventDetail, fromSwitch }) | ||
throw fspiopError | ||
} else { // !hasDuplicateId | ||
if (type === TransferEventType.FULFIL && [TransferEventAction.COMMIT, TransferEventAction.REJECT, TransferEventAction.ABORT, TransferEventAction.BULK_COMMIT, TransferEventAction.BULK_ABORT].includes(action)) { | ||
if (type === TransferEventType.FULFIL && [TransferEventAction.COMMIT, TransferEventAction.RESERVE, TransferEventAction.REJECT, TransferEventAction.ABORT, TransferEventAction.BULK_COMMIT].includes(action)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You removed BULK_ABORT here |
||
Util.breadcrumb(location, { path: 'validationCheck' }) | ||
if (payload.fulfilment && !Validator.validateFulfilCondition(payload.fulfilment, transfer.condition)) { | ||
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `callbackErrorInvalidFulfilment--${actionLetter}9`)) | ||
|
@@ -434,7 +434,7 @@ const fulfil = async (error, messages) => { | |
throw fspiopError | ||
} else { // validations success | ||
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, { path: 'validationPassed' })) | ||
if ([TransferEventAction.COMMIT, TransferEventAction.BULK_COMMIT].includes(action)) { | ||
if ([TransferEventAction.COMMIT, TransferEventAction.RESERVE, TransferEventAction.BULK_COMMIT].includes(action)) { | ||
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `positionTopic2--${actionLetter}12`)) | ||
await TransferService.handlePayeeResponse(transferId, payload, action) | ||
const eventDetail = { functionality: TransferEventType.POSITION, action } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this supposed to be here? that config is in default.json