Page MenuHomePhabricator

Add use cases for moderating and soft-deleting memberships
Closed, ResolvedPublic8 Estimated Story Points

Description

Add new use cases to the membership bounded context that represent different state change actions:

  • Mark a membership as moderated or unmoderated.
  • Soft-delete a membership or remove soft-delete status

Implementation notes:

The currrent implementation (mis)uses a single field for moderation and deletion - status by applying binary flags. The new implementation must provide a new, more high-level API that hides the storage details:

  • The MembershipApplication domain class should get markAsDeleted, removeDeletionMarker, markAsModerationNeeded and markAsApproved methods (naming at your discretion).
  • The DoctrineMembershipApplicationRepository is responsible calculate the new status value

This architecture will allow us to replace the database implementation without touching the domain model, use cases or controllers.

The logic for changing the status in the Fundraising Operation Center is in app/model/Member.php and app/controllers/Backend/Ajax/MemberController.php. It's completely untested, so the recommended approach would be to extract the code from the controller into the use cases nearly 1:1, achieve 100% coverage with new tests and then refactor the extracted code.

Event Timeline

kai.nissen set the point value for this task to 8.Apr 9 2021, 1:37 PM
AbbanWMDE added a subscriber: AbbanWMDE.