Skip to content
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

Regular withdrawal #167

Merged
merged 11 commits into from
Jul 7, 2024
Merged

Regular withdrawal #167

merged 11 commits into from
Jul 7, 2024

Conversation

randycoulman
Copy link
Owner

Implements the regular withdrawals feature.

While doing this, I discovered that adding LineItems to an unsaved Transaction doesn't work for more than one line item, so I had to change approach by using put_assoc when creating the initial changeset. I refactored the single-fund deposit and withdrawal transactions to match the same pattern.

Reused the SingleTransactionForm, which had almost everything needed so renamed it to TransactionForm.

I couldn't find a great way to get the fund names to use as field labels, so using Enum.at for now.

I'm using the action: ignore feature of Ecto to ignore any line items that have missing or zero amounts. The net result has too much error feedback on the form, but I'm going to live with that for now.

Closes #102

Checklist

Have you added the following where appropriate?

  • Unit tests for new code?
  • End-to-end happy-path tests?
  • Proper error handling?

Discovered that adding LineItems to an unsaved Transaction doesn't work for more than one line item, so had to change approach by using `put_assoc` when creating the initial changeset. Will refactor other transactions to match in follow-up commits.

Reusing the `SingleTransactionForm`, which had almost everything needed. Will rename in a follow-up. Couldn't find a great way to get the fund names to use as field labels, so using `Enum.at` for now.
Includes testing that unfilled lines are ignored and showing a higher-level error message when all lines are unfilled.
@randycoulman randycoulman merged commit bfa6e3b into main Jul 7, 2024
1 check passed
@randycoulman randycoulman deleted the regular-withdrawal branch July 7, 2024 04:56
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.

Make regular withdrawal
1 participant