Page MenuHomekolab.org

Allow search with transaction and customer IDs
ClosedPublic

Authored by vanmeeuwen on Aug 17 2021, 11:17 AM.

Details

Reviewers
machniak
mollekopf
Group Reviewers
Restricted Project
Commits
rKb70dbda55bad: Allow search with transaction and customer IDs
Test Plan

None

Diff Detail

Repository
rK kolab
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vanmeeuwen requested review of this revision.Aug 17 2021, 11:17 AM
vanmeeuwen created this revision.
machniak requested changes to this revision.Aug 18 2021, 8:00 AM
machniak added a subscriber: machniak.

Because both these additional searches are mollie-specific maybe this code should be abstracted-on/moved-to the Providers/PaymentProvider. E.g. isPaymentId(), isCustomerId(), findWalletByPaymentOrCustomerId() or sth like that.

src/app/Http/Controllers/API/V4/Admin/UsersController.php
94

This should include ->where('key', 'mollie_id'), but even then it will not use an index and might be slow.

This revision now requires changes to proceed.Aug 18 2021, 8:00 AM
mollekopf added inline comments.
src/app/Http/Controllers/API/V4/Admin/UsersController.php
94

I believe if not found first() will return null and therefore you'd try to invoke wallet() on null?

94

Is it intended that the value is matched against "cst_$something" or should the search only be executed against $something without the cst_ prefix? Same below.

mollekopf added inline comments.Aug 18 2021, 8:48 AM
src/app/Http/Controllers/API/V4/Admin/UsersController.php
93

Add a comment that this is a search by mollie customerId

94

Nevermind, I figured out what the cst_ and tr_ prefixes are.

101

Add a comment that this is a search by mollie payment id.

vanmeeuwen updated this revision to Diff 7843.Aug 18 2021, 10:21 AM
vanmeeuwen marked 6 inline comments as done.
  • Commentary, safety on settings not found

All comments resolved.

mollekopf accepted this revision.Aug 18 2021, 10:30 AM
machniak requested changes to this revision.Aug 18 2021, 10:34 AM
machniak added inline comments.
src/app/Http/Controllers/API/V4/Admin/UsersController.php
104

$wallet does not exist.

This revision now requires changes to proceed.Aug 18 2021, 10:34 AM
machniak added inline comments.Aug 18 2021, 10:35 AM
src/app/Http/Controllers/API/V4/Admin/UsersController.php
114

Should be $payment->wallet->...

vanmeeuwen updated this revision to Diff 7858.Aug 18 2021, 10:42 AM
  • Relations are properties
machniak requested changes to this revision.Aug 18 2021, 10:45 AM
machniak added inline comments.
src/app/Http/Controllers/API/V4/Admin/UsersController.php
104

must be owner() as you build the query here.

114

owner()

This revision now requires changes to proceed.Aug 18 2021, 10:45 AM
vanmeeuwen updated this revision to Diff 7864.Aug 18 2021, 10:50 AM
  • Here be a method not a property
machniak accepted this revision.Aug 18 2021, 10:53 AM
This revision is now accepted and ready to land.Aug 18 2021, 10:53 AM
vanmeeuwen updated this revision to Diff 7873.Aug 18 2021, 11:46 AM
  • Add tests for the api calls
vanmeeuwen updated this revision to Diff 7879.Aug 18 2021, 11:55 AM
  • Add a search for a wallet id
This revision was automatically updated to reflect the committed changes.