Page MenuHomePhabricator

Remove status from donation queries
Open, Needs TriagePublic

Description

Currently, we are using the "status" field of the spenden table to coalesce payment status, moderation status and soft-deletion status into one. While this is convenient, it's also lossy, hard to parse (you have to look up what each status means) and a sign of a non-normalized database. The only place where we query the status (extensively) is the Fundraising Operation Center. We should chage the queries to use the proper data source to determine different (relevant) donation states.

Acceptance Criteria

  • No code uses the "spenden.status" field to select donations

Implementation Details
Queries/scripts to look out for in the Fundraising Operation Center:

To determine the actual status, join the payment tables to see if the payment is booked, check the donations_moderation_reasons to see if a donation is moderated and the soft-delete column to see if a donation is soft-deleted (T359955: Create a deletion flag on the donation database entries is a prerequisite for this ticket)