Skip to content

Conversation

@Tilliki
Copy link

@Tilliki Tilliki commented May 7, 2025

Refactored code with several assumptions (which could not be validated with product person). Normally any such assumptions would be validated before making the changes:

  1. ProcessPayment is supposed to take a new Payment, and add it to an existing Invoice, if the payment is valid, and the invoice exists.
  2. paymentReference is a unique value
  3. We do not need to know whether there were already payments done on the invoice when processing a payment. The only important thing is whether the invoice is partially or completely paid. If we need to know about partial payments, it would be better to implement separate methods that check this and give the information to the user.
  4. The strings we are returning in the error messages won't be localised. If localisation is desired, resource files would be better here.
  5. There is no external code currently calling methods created here, meaning their signatures and return types can be updated with impunity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant