Skip to content

Health Check(s): Stripe Balance Transaction #563

Description

@arborrow

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.

Metadata

Metadata

Assignees

Labels

improvementissues that will improve existing functionality

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions