-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
[Mobile App] Resolve incorrect payment calculations for past and future payments (#869) #1040
[Mobile App] Resolve incorrect payment calculations for past and future payments (#869) #1040
Conversation
@floodoo is attempting to deploy a commit to the Social Income Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe changes modify the payment calculation logic in Changes
Sequence Diagram(s)sequenceDiagram
participant P as _calculatePastPayments
participant L as Payment List
participant C as Calculation Logic
P->>L: Iterate over each payment
loop For each Payment
L->>P: Return payment details
P->>P: Check if status is 'paid' or 'confirmed'
alt Status Valid
P->>C: Add payment to total
else Status Invalid
P->>P: Continue to next payment
end
end
P->>P: Return total of past payments
sequenceDiagram
participant F as _calculateFuturePayments
participant L as Payment List
participant FL as Filtered Payments
F->>L: Retrieve payments list
F->>L: Filter payments with status 'paid' or 'confirmed'
L-->>FL: Return filtered payments
FL->>F: Provide filtered list
F->>F: Calculate count from filtered list
F->>F: Return future payments count along with initial payment currency
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
recipients_app/lib/view/pages/payments_page.dart
(2 hunks)
🔇 Additional comments (2)
recipients_app/lib/view/pages/payments_page.dart (2)
147-149
: LGTM! Clean implementation of payment status filtering.The status check effectively implements the requirement to only count 'paid' and 'confirmed' payments.
160-166
: LGTM! Consistent filtering implementation.The where clause elegantly filters for 'paid' and 'confirmed' payments, maintaining consistency with past payments logic.
@floodoo I will double-check my suggested rules for past and future payments calculation from the issue with @ssandino because I'm also quite new to this project and do not have the whole overview 😊. In the meantime you could have a look on my refactoring suggestion if you want. |
@KarinBerg, I think your logic in issue #869 solves the problem. Thanks, @floodoo, for the PR! |
This Merge Request resolves the issue of incorrect calculations for past and future payments, as described in #869.
Previously, all payments were counted regardless of their status, leading to inaccurate totals.
Changes
Only payments with the status paid and confirmed are considered.
Deductions from the total amount are now only applied for payments with the status paid and confirmed.
Summary by CodeRabbit