This commit is contained in:
@@ -162,6 +162,12 @@ public class LawCaseHandler implements RequestHandler {
|
||||
|
||||
private BaseResponse createLawCase(Long userId, LawCaseRequest lawCaseRequest, BaseRequest request) {
|
||||
validateRequiredParameters(lawCaseRequest, request, userId);
|
||||
Long violationId = lawCaseRequest.getViolationId();
|
||||
|
||||
if (lawCaseService.lawCaseExistByViolationId(violationId)) {
|
||||
return new BaseResponse(request.getMsgId(), MessageCode.LAW_CASE_ALREADY_EXIST.getCode(),
|
||||
MessageCode.LAW_CASE_ALREADY_EXIST.getDescription(), "Law case was already exists");
|
||||
}
|
||||
|
||||
try {
|
||||
tariffInfoService.writeOffTokens(userId, TariffConstants.LEGAL_COST, OperationType.CREATE_LEGAL_CASE);
|
||||
@@ -175,7 +181,6 @@ public class LawCaseHandler implements RequestHandler {
|
||||
}
|
||||
|
||||
User user = userRepository.findById(userId).orElseThrow(() -> new UserNotFoundException("User not found"));
|
||||
Long violationId = lawCaseRequest.getViolationId();
|
||||
|
||||
LawCase lawCase = lawCaseService.addLawCase(
|
||||
lawCaseRequest.getAmount(),
|
||||
|
||||
Reference in New Issue
Block a user