Skip to content
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

Health Check(s): Stripe Balance Transaction #563

Open
arborrow opened this issue Feb 17, 2024 · 1 comment
Open

Health Check(s): Stripe Balance Transaction #563

arborrow opened this issue Feb 17, 2024 · 1 comment
Assignees
Labels
improvement issues that will improve existing functionality

Comments

@arborrow
Copy link
Owner

arborrow commented Feb 17, 2024

All reconciled SBTs should have at least one associated payment.

I want to review the results of:

SELECT sbt.* , p.payment_id, p.payment_amount, p.payment_date
FROM stripe_balance_transaction as sbt 
LEFT JOIN Donations_payment as p ON (p.stripe_balance_transaction_id = sbt.id)
WHERE sbt.deleted_at IS NULL AND p.deleted_at IS NULL AND p.payment_amount IS NULL AND sbt.reconcile_date IS NOT NULL

I figured it would be good to add a database health check for reconciled SBTs without a payment. Going one step further, we could also have another check to ensure that the sum of the associated payments is equal to the amount of payout. Having both of those flagged would give us a good internal check on the data in addition to end of month reconciliation done by Finance.

@arborrow arborrow self-assigned this Feb 17, 2024
@arborrow arborrow added the improvement issues that will improve existing functionality label Feb 17, 2024
@arborrow
Copy link
Owner Author

Reviewed existing SBTs without corresponding payments and was able to get the list down to 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement issues that will improve existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant