Allow external booking for deleted and moderated donations
Closed, ResolvedPublic3 Story Points

Description

Currently only donations with status STATUS_EXTERNAL_INCOMPLETE can be booked. It must be possible to allow STATUS_MODERATION and STATUS_CANCELLED also to be booked (otherwise donations from Daniel Dorfdepp and donations deleted in the backend would fail).

Additional behavior when changing state to STATUS_EXTERNAL_BOOKED from something other than STATUS_EXTERNAL_INCOMPLETE: set comment display to private.

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 8 2016, 5:27 PM

I'd say the behavior should take place in Donation::confirmBooked but that model has no concept of public/private comments. How do you think we should proceed, @JeroenDeDauw?

I'd say the behavior should take place in Donation::confirmBooked but that model has no concept of public/private comments. How do you think we should proceed, @JeroenDeDauw?

Perhaps it was a mistake to not have the comment be part of Donation. See also my comment on https://phabricator.wikimedia.org/T137307

We could do the needed work in DoctrineDonationRepository::updateDonationEntity, which can look at the old state and the new state, and see if the relevant change happened. This is not the correct layer to put this logic into though. How about we do this and keep it in mind as a thing we'd like to be able to do in the model?

It must be possible to allow STATUS_MODERATION and STATUS_CANCELLED also to be booked (otherwise donations from Daniel Dorfdepp and donations deleted in the backend would fail).

That part is easy enough to do. I'll modify the method.

JeroenDeDauw added a comment.EditedJun 8 2016, 9:01 PM

The moderation part is done in https://github.com/wmde/FundraisingFrontend/pull/482

I tried to create a canceled external payment but got "Can only cancel direct debit". So I suppose we don't need to actually handle that case, since it can't happen.

This still leaves the making the comment private part.

It actually can happen if the donation is deleted for whatever reason in the backend.

Tobi_WMDE_SW closed this task as Resolved.Apr 7 2017, 11:25 AM
Tobi_WMDE_SW claimed this task.
Restricted Application added a project: WMDE-Fun-Team. · View Herald TranscriptApr 7 2017, 11:25 AM