Sorry for the delay. I’ve been thinking quite a bit about this.
Making a post pending means hard-deleting the post and storing all the necessary data to re-create it inside the reviewable’s payload attribute. I had to rewrite this a couple of times because I was worried about losing data in this transition due to associations tagged with dependent: :destroy or dependent: :delete_all. However, after some testing, I believe it should be safe to do so.
Doing this when a topic has no replies or when it’s not the first post should require a low to moderate effort. All the logic for queueing a post is inside the NewPostManager#enqueue method, so we’ll have to extract it into a separate class and re-use it. We always add pending posts at the end of the topic after approval, so adding them in a specific position will require a little more work.
Moving a topic with replies back to pending should be more complicated using this approach. Serializing it into a reviewable seems a bit too much. Maybe we could temporarily hide the topic instead? For example, we already do this when a post gets flagged by spam by a trusted user.
Alternatively, we could always flag + delete (or hide) instead, making everything a lot easier. I can’t think of a reason why hard-deleting and queueing the post is better.