Skip to content

Commit

Permalink
DOC-1649: changed suffix to indicate not to send message rather than …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
jbarnardeviden committed Dec 4, 2024
1 parent 9ede4ad commit 29419a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/alerting/generate-return-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { getInboundBlobClient } = require('../storage')
const { getReturnFileContent } = require('./get-return-file-content')

const publishReturnFile = async (returnFilename, returnFileContent) => {
console.log('content:', returnFileContent.length)
const blobClient = await getInboundBlobClient(returnFilename)
await blobClient.upload(returnFileContent, returnFileContent.length)
console.info(`Published ${returnFilename}`)
Expand All @@ -12,7 +13,7 @@ const generateReturnFile = async (event) => {
const currentDate = moment()
// hard coded sequence because it will be correctly generated in pay responses service
const sequenceString = 'XXXX'
const returnFilename = `FCAP_${sequenceString}_RPA_${currentDate.format('YYMMDDHHmmss')}_NO_RETURN_FILE.dat`
const returnFilename = `FCAP_${sequenceString}_RPA_${currentDate.format('YYMMDDHHmmss')}_NO_RETURN_MESSAGE.dat`
const content = getReturnFileContent(event)
return publishReturnFile(returnFilename, content)
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/alerting/generate-return-file.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ describe('generateReturnFile', () => {

await generateReturnFile(mockEvent)

expect(getInboundBlobClient).toHaveBeenCalledWith('FCAP_XXXX_RPA_240101010101_NO_RETURN_FILE.dat')
expect(getInboundBlobClient).toHaveBeenCalledWith('FCAP_XXXX_RPA_240101010101_NO_RETURN_MESSAGE.dat')
expect(mockBlobClient.upload).toHaveBeenCalledWith(expectedContent, expectedContent.length)
expect(console.info).toHaveBeenCalledWith('Published FCAP_XXXX_RPA_240101010101_NO_RETURN_FILE.dat')
expect(console.info).toHaveBeenCalledWith('Published FCAP_XXXX_RPA_240101010101_NO_RETURN_MESSAGE.dat')
})
})

0 comments on commit 29419a0

Please sign in to comment.