…ions in ListPayments and allow empty strings for subpayment.ReceiverName, Avoid using DB outside the current connection in VerifyOrderAndCreatePayments
Type of change
[X] Bug fix (non-breaking change which fixes an issue)
[X] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
Description
This is a first step for the digital license backend customer part. But actually it's fixing a lot of things that have to be solved on the way.
IMPORTANT TO KNOW
When i was enabling the order tests again, it took forever, because the requests were blocking themself. So i replaced the calls to the database without a pgx.Tx to one with pgx.Tx and i had to change the get payments, too.
There is still the code missing to create the customer in keycloak, because we don't have the keycloak group the user should be added to for the current newspaper number in order to give access in wordpress.
Also I think this pr is already quite complex to review so i will solve the other problems with customers in a follow up pr.
CHANGES
add customer email to order and require an email for all license items
fix order tests,
the item creation in the tests had to be appended in order to get a custom name, because the item with a license and the item without had the same name, which doesn't work, when they are used in the same test
use native functions in ListPayments and
allow empty strings for subpayment.ReceiverName,
Avoid using DB outside the current connection in VerifyOrderAndCreatePayments -> this maybe fixes our deadlocks
to think on
The order code for orders in the tests shouldn't be 0 for all orders. We need a way to distinguish them in order to start parallel/fast tests.
TODO
Checklist:
[x] I have commented my code (or ChatGPT did), particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings, neither in my IDE nor in my browser
[x] I have added tests that prove my fix is effective or that my feature works
…ions in ListPayments and allow empty strings for subpayment.ReceiverName, Avoid using DB outside the current connection in VerifyOrderAndCreatePayments
Type of change
Description
This is a first step for the digital license backend customer part. But actually it's fixing a lot of things that have to be solved on the way.
IMPORTANT TO KNOW
When i was enabling the order tests again, it took forever, because the requests were blocking themself. So i replaced the calls to the database without a pgx.Tx to one with pgx.Tx and i had to change the get payments, too.
There is still the code missing to create the customer in keycloak, because we don't have the keycloak group the user should be added to for the current newspaper number in order to give access in wordpress. Also I think this pr is already quite complex to review so i will solve the other problems with customers in a follow up pr.
CHANGES
to think on The order code for orders in the tests shouldn't be
0
for all orders. We need a way to distinguish them in order to start parallel/fast tests.TODO
Checklist: