Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Sfi 2199 subscribe to submitted payment requests #4

Merged
merged 72 commits into from
Aug 18, 2022

Conversation

AbidemiAdio
Copy link
Contributor

No description provided.

@@ -0,0 +1,4 @@
module.exports = {
FIRST_PAYMENT: 1,
POST_PAYMENT_ADJUSTMENT: 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably fine for now but may be a limitation if we have tests that cover three payment requests as 3 is still a post payment adjustment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, recognised this myself

johnwatson484
johnwatson484 previously approved these changes Aug 5, 2022
Copy link
Member

@johnwatson484 johnwatson484 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const processSubmitPaymentRequest = async (paymentRequest) => {
const transaction = await db.sequelize.transaction()
try {
const existingPaymentRequest = await getPaymentRequestByReferenceId(paymentRequest.referenceId, transaction)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still an issue because the reference number will mostly be the same for both the processing and submit messages so whichever got there first would prevent the other being saved.

It's only changed if we need to reprocess a payment request from processing again. ie DAX has rejected it.

What if we included the status of the payment request in the paymentRequest table and used that in the duplicate check?

eg rather than "if this reference exists, it's a duplicate" we have "if this reference exists and it's a submitted payment request" it's a duplicate?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@johnwatson484 johnwatson484 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marctemp marctemp merged commit 6114645 into main Aug 18, 2022
@marctemp marctemp deleted the SFI-2199-subscribe-to-submitted-payment-requests branch August 18, 2022 10:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants