marcinadd / projecty-web

Project management software based on spring
GNU General Public License v3.0
74 stars 74 forks source link

Have the ability to delete messages but without affecting the other users #37

Closed fokion closed 4 years ago

fokion commented 4 years ago

Create a service and a new entity that holds the relationship between the user and the message. If we delete the message we basically delete this association and not the actual message.

marcinadd commented 4 years ago

I have a suggestion to check if the message doesn't have any association, then it should be deleted from db. While you are deleting association you can check this imho.

fokion commented 4 years ago

I will have a look. I saw that there is a field that cascades delete on the messages if a user is deleted. In my opinion, it has to be preserved as that affects the receiver. I do have to cascade the deletion if both associations are missing. I will work on it during the weekend

fokion commented 4 years ago

@marcinadd I have updated the code to remove the messages when both recipient and sender are unlinked.

fokion commented 4 years ago

For the service, it would be great to have test containers integrated first as mocking is not ideal.

marcinadd commented 4 years ago

For the service, it would be great to have test containers integrated first as mocking is not ideal.

Thanks for the suggestion. But I don't know is there important reason to edit all already created test classes at the moment but a contribution is welcome. If you want to help, you can create a pull request.

marcinadd commented 4 years ago

35