Add BankAccount #176

Merged
hansegucker merged 6 commits from 37-store-person-related-long-term-payment-information into master 2026-10-15 20:05:39 +02:00
Member

Information and screenshots

Enhances #37

Screenshot_20261003_003905
Screenshot_20261003_004604

Checklist

  • tox -e reformat,lint used
  • Changelog updated/No update necessary
  • Documentation (incl. Screenshots) up-to-date
  • Copyright in apps.py and README.rst up-to-date
  • (Unit) tests for new feature/regression tests for bug fixes (only if useful)
  • Adhere to URL scheme
  • Tested with admin account
  • Tested with normal account (based on permissions)

Backend checklist

  • Use permissions for all GraphQL mutations
  • Use query optimizer for all GraphQL queries
  • Don't use inefficient DB queries

Frontend checklist (mandatory with ~"part::frontend")

## Information and screenshots Enhances #37 ![Screenshot_20261003_003905](/attachments/106f5860-0db1-495b-bd24-8c406f0889bf) ![Screenshot_20261003_004604](/attachments/a1a1347f-4497-4242-b27e-9a23deb725e0) ## Checklist - [x] `tox -e reformat,lint` used - [x] Changelog updated/No update necessary - [ ] Documentation (incl. Screenshots) up-to-date - [ ] Copyright in `apps.py` and `README.rst` up-to-date - [ ] (Unit) tests for new feature/regression tests for bug fixes (only if useful) - [ ] Adhere to [URL scheme](https://code.teckids.org/aleksis/aleksis/issues/86) - [x] Tested with admin account - [x] Tested with normal account (based on permissions) ## Backend checklist - [x] Use permissions for all GraphQL mutations - [x] Use query optimizer for all GraphQL queries - [x] Don't use inefficient DB queries ## Frontend checklist (mandatory with ~"part::frontend") - [x] Screenshots are attached (mobile and desktop) - [x] Tested on mobile, tablet, and desktop sizes - [ ] Adhered to [frontend guidelines](hhttps://code.teckids.org/aleksis/AlekSIS/src/branch/master/project/frontend_guidelines.rst) - [ ] Checked with [Firefox Accessibility Checker](https://firefox-source-docs.mozilla.org/devtools-user/accessibility_inspector/)
Add frontend for bank accounts
Some checks failed
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / tests-done (push) Has been cancelled
CI / build (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / lock (push) Has been cancelled
d21baac297
Add changelog
All checks were successful
CI / lock (push) Successful in 38s
CI / lint (push) Successful in 6m6s
CI / test (push) Successful in 7m8s
CI / tests-done (push) Successful in 2s
CI / build (push) Successful in 1m24s
CI / publish (push) Successful in 9s
40b83d5644
magicfelix added this to the AlekSIS project 2026-10-03 00:49:11 +02:00
magicfelix force-pushed 37-store-person-related-long-term-payment-information from 40b83d5644
All checks were successful
CI / lock (push) Successful in 38s
CI / lint (push) Successful in 6m6s
CI / test (push) Successful in 7m8s
CI / tests-done (push) Successful in 2s
CI / build (push) Successful in 1m24s
CI / publish (push) Successful in 9s
to e13dea9b89
Some checks failed
CI / lock (push) Successful in 51s
CI / build (push) Failing after 1m26s
CI / lint (push) Successful in 1m44s
CI / test (push) Successful in 2m45s
CI / tests-done (push) Successful in 2s
CI / publish (push) Has been skipped
2026-10-03 21:56:02 +02:00
Compare
Prevent creating bank accounts for other persons
All checks were successful
CI / lock (push) Successful in 32s
CI / lint (push) Successful in 2m25s
CI / test (push) Successful in 3m26s
CI / tests-done (push) Successful in 1s
CI / build (push) Successful in 1m4s
CI / publish (push) Successful in 7s
176b272b6a
magicfelix changed title from 37-store-person-related-long-term-payment-information to Add BankAccount 2026-10-03 22:21:56 +02:00
Add standalone CRUD list for bank accounts
All checks were successful
CI / lock (push) Successful in 48s
CI / lint (push) Successful in 1m9s
CI / build (push) Successful in 1m12s
CI / test (push) Successful in 1m51s
CI / tests-done (push) Successful in 2s
CI / publish (push) Successful in 10s
1c237008c2
@ -130,0 +132,4 @@
"menu_title": "Bank Accounts",
"title_plural": "Bank Accounts",
"person": "Person",
"account_holder": "Account holder",
Owner

`Account Holder

`Account Holder
magicfelix marked this conversation as resolved
@ -130,0 +135,4 @@
"account_holder": "Account holder",
"iban": "IBAN",
"bic": "BIC",
"account_types": "Account types"
Owner

Account Types

`Account Types`
magicfelix marked this conversation as resolved
@ -0,0 +19,4 @@
@classmethod
def get_default(cls) -> "BankAccountType":
"""Get default address type."""
Owner

Not address type ;-)

Not `address type` ;-)
magicfelix marked this conversation as resolved
@ -0,0 +40,4 @@
on_delete=models.CASCADE,
)
account_holder = models.CharField(verbose_name=_("Account holder"), max_length=64)
Owner

Is 64 a technical limit of banks?

Is `64` a technical limit of banks?
Author
Member

I don't know, and a short research was not enlightening. I used django-payments-sepa as inspiration, this is where the 64 comes from.

I don't know, and a short research was not enlightening. I used `django-payments-sepa` as inspiration, this is where the `64` comes from.
hansegucker marked this conversation as resolved
@ -40,0 +45,4 @@
"""Predicate for checking if a BankAccount belongs to the user's person."""
if obj is None:
return False
return obj.person.user_id == user.id
Owner

obj.person == user.person

`obj.person == user.person`
magicfelix marked this conversation as resolved
@ -219,0 +269,4 @@
)
rules.add_perm("tezor.view_bankaccounttype_rule", view_bank_account_type_predicate)
change_bank_account_type_predicate = has_person & (
Owner

edit

`edit`
magicfelix marked this conversation as resolved
@ -91,1 +111,4 @@
@staticmethod
def resolve_bank_accounts(root, info, **kwargs) -> QuerySet:
if info.context.user.is_anonymous:
Owner

Maybe with has_person instead?

Maybe with `has_person` instead?
magicfelix marked this conversation as resolved
@ -92,0 +113,4 @@
def resolve_bank_accounts(root, info, **kwargs) -> QuerySet:
if info.context.user.is_anonymous:
return []
qs = BankAccount.objects.filter(
Owner

This could lead to duplicate entries (because of the OR). Would prefer `get_objects_for_user(...).union(BankAccount.objects.filter(person=info.context.user.person)

This could lead to duplicate entries (because of the OR). Would prefer `get_objects_for_user(...).union(BankAccount.objects.filter(person=info.context.user.person)
Owner

BankAccount.objects.filter(pk__in=...)

`BankAccount.objects.filter(pk__in=...)`
magicfelix marked this conversation as resolved
magicfelix force-pushed 37-store-person-related-long-term-payment-information from 1c237008c2
All checks were successful
CI / lock (push) Successful in 48s
CI / lint (push) Successful in 1m9s
CI / build (push) Successful in 1m12s
CI / test (push) Successful in 1m51s
CI / tests-done (push) Successful in 2s
CI / publish (push) Successful in 10s
to b043b4fbe8
Some checks failed
CI / lock (push) Successful in 1m7s
CI / build (push) Successful in 5m4s
CI / tests-done (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
2026-10-08 20:24:23 +02:00
Compare
magicfelix force-pushed 37-store-person-related-long-term-payment-information from b043b4fbe8
Some checks failed
CI / lock (push) Successful in 1m7s
CI / build (push) Successful in 5m4s
CI / tests-done (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
to 4eb20f2c36
All checks were successful
CI / lock (push) Successful in 2m30s
CI / lint (push) Successful in 4m57s
CI / build (push) Successful in 5m30s
CI / test (push) Successful in 8m39s
CI / tests-done (push) Successful in 2s
CI / publish (push) Successful in 33s
2026-10-08 20:31:18 +02:00
Compare
hansegucker deleted branch 37-store-person-related-long-term-payment-information 2026-10-15 20:05:39 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aleksis/AlekSIS-App-Tezor!176
No description provided.