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:
- Export query, see T401229: Improve donation export query
- Analysis (DatabaseDonationReader class)
- Scrubbing of exported datam, see T401247: Improve donation scrubbing query
- Payment Monitor (see also T270069: Refactor PaymentMonitor )
- tools campaignExport and raw_data_export -> Check with Product manager if these scripts are still in use. If not, delete them
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)