-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC-1762 send messages to trigger alerts
- Loading branch information
1 parent
98dd587
commit 5489f3c
Showing
20 changed files
with
363 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
PROCESSING_SUBCRIPTION_FAILED: 'uk.gov.defra.ffc.doc.warning.processing.subscription.failed', | ||
SUBMIT_SUBCRIPTION_FAILED: 'uk.gov.defra.ffc.doc.warning.submit.subscription.failed', | ||
RETURN_SUBCRIPTION_FAILED: 'uk.gov.defra.ffc.doc.warning.return.subscription.failed' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const util = require('util') | ||
const { PROCESSING_SUBCRIPTION_FAILED } = require('../constants/message-types') | ||
const sendMessage = require('../messaging/send-message') | ||
const config = require('../config') | ||
|
||
const publishProcessingSubscriptionFailed = async (paymentRequest, error) => { | ||
const body = { | ||
data: { | ||
message: error.message, | ||
...paymentRequest | ||
} | ||
} | ||
|
||
await sendMessage(body, PROCESSING_SUBCRIPTION_FAILED, config.processingSubscriptionFailed) | ||
console.log('Message sent:', util.inspect(body, false, null, true)) | ||
} | ||
|
||
module.exports = publishProcessingSubscriptionFailed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const util = require('util') | ||
const { RETURN_SUBCRIPTION_FAILED } = require('../constants/message-types') | ||
const sendMessage = require('../messaging/send-message') | ||
const config = require('../config') | ||
|
||
const publishReturnSubscriptionFailed = async (paymentRequest, error) => { | ||
const body = { | ||
data: { | ||
message: error.message, | ||
...paymentRequest | ||
} | ||
} | ||
|
||
await sendMessage(body, RETURN_SUBCRIPTION_FAILED, config.returnSubscriptionFailed) | ||
console.log('Message sent:', util.inspect(body, false, null, true)) | ||
} | ||
|
||
module.exports = publishReturnSubscriptionFailed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const util = require('util') | ||
const { SUBMIT_SUBCRIPTION_FAILED } = require('../constants/message-types') | ||
const sendMessage = require('../messaging/send-message') | ||
const config = require('../config') | ||
|
||
const publishSubmitSubscriptionFailed = async (paymentRequest, error) => { | ||
const body = { | ||
data: { | ||
message: error.message, | ||
...paymentRequest | ||
} | ||
} | ||
|
||
await sendMessage(body, SUBMIT_SUBCRIPTION_FAILED, config.submitSubscriptionFailed) | ||
console.log('Message sent:', util.inspect(body, false, null, true)) | ||
} | ||
|
||
module.exports = publishSubmitSubscriptionFailed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.