Cost calculation unification, more tests
Details
- Reviewers
mollekopf - Group Reviewers
Restricted Project - Commits
- rK7cf045ae80e9: Asynchronous charging of deleted entitlements
./phpunit
Diff Detail
- Repository
- rK kolab
- Branch
- dev/entitlement-delete-changes
- Lint
Lint Skipped - Unit
No Test Coverage - Build Status
Buildable 45904 Build 17767: arc lint + arc unit
Event Timeline
src/app/Observers/EntitlementObserver.php | ||
---|---|---|
82 | So you think this is here to trigger an update job via the listener? Could be, it was added here: 66f0930de7bb3db29a5ead4148c96b3f38f8d370 (for ldap backend support) This deserves at least a comment though, it's a very in-transparent way to trigger an update job. | |
src/app/Wallet.php | ||
120 | Degraded pays nothing makes sense, the rest of the sentence I don't understand. | |
126 | Seems like we can end up with negative profit here? $cost - $fee should probably be at minimum 0? | |
588 | Avoid string interpolation for methods if possible. I know, personal preference, but IMO there are only very few places where obscuring which function you are calling and making it inaccessible to tools really is a good trade off. | |
668 | Seems good enough from my POV. |
src/app/Observers/EntitlementObserver.php | ||
---|---|---|
82 | I think this is a circumvention for the bubbling of an \App\User::delete() on to its individual \App\User::entitlements() getting deleted in its observer. |
src/app/Wallet.php | ||
---|---|---|
120 | Yes, we always get money from the tenant. |
src/app/Wallet.php | ||
---|---|---|
120 | Customer pays nothing, but see $profit. We get the fee from the tenant. |
This copies the latest database entry into the current $synctime cache, so that seems to indeed make more sense than reusing the synctime of the previous database entry.