JujaLabs / itevents

Resource to subscribe on it events
Apache License 2.0
7 stars 5 forks source link

Move UserRestController logic #187

Open vaa25 opened 8 years ago

vaa25 commented 8 years ago

Move logic from UserRestController into services and fix old and add new test for this moving

IgorMaksymov commented 8 years ago

@vaa25 i dont see any logic there, that should be moved

romach commented 8 years ago

@AndriyBaibak 1 hour spent

romach commented 8 years ago

@vaa25 do you mean that controller must only invoke services and not to manipulate other objects?

romach commented 8 years ago

@AndriyBaibak 1 hour spent

romach commented 8 years ago

@vaa25 for example in UserRestController we have method

public void deactivateSubscription() {
    User user = userService.getAuthorizedUser();
    userService.deactivateUserSubscription(user);
}

Should we refactor it that it will contain method, for example, userService.deactivateAuthorizedUserSubscription() that will contain User user = userService.getAuthorizedUser(); logic?

vaa25 commented 8 years ago

@IgorMaksymov @romach one controller method must have only one service method call. This service method can call another service and other methods. This was discussed earlier by PO or TL, I don't remember who of them exactly.

romach commented 8 years ago

@vaa25 I understood

romach commented 8 years ago

@AndriyBaibak 1 hour spent

romach commented 8 years ago

@AndriyBaibak 30 minutes spent

romach commented 8 years ago

@AndriyBaibak 30 minutes spent