backend-api http://jira.mfd.msk:8088/browse/CLS-257
This commit is contained in:
parent
a213ca1872
commit
5d75c6f53d
12 changed files with 1160 additions and 32 deletions
|
|
@ -0,0 +1,43 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.securities;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.CouponPeriod;
|
||||
import ru.spcex.clearing.backendapi.controller.queue.AbstractQueueController;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||
import ru.spcex.clearing.backendapi.service.IOperator;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/securities/coupon-period-securities")
|
||||
public class CudCouponPeriodController extends AbstractQueueController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public CudCouponPeriodController(IOperator operator, IStateLoader stateLoader) {
|
||||
super(operator);
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all coupon periods.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CommonGetAllResponse.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonGetAllResponse getAll() {
|
||||
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_CouponPeriod,
|
||||
CouponPeriod.class);
|
||||
CommonGetAllResponse response = new CommonGetAllResponse();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.securities;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.EquitySecurity;
|
||||
import ru.spcex.clearing.backendapi.controller.queue.AbstractQueueController;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.common.CommonDeleteAction;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.securities.EquitySecurityNewAction;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.securities.EquitySecurityUpdateAction;
|
||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||
import ru.spcex.clearing.backendapi.controller.response.cud.CudResponse;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||
import ru.spcex.clearing.backendapi.service.IOperator;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
||||
import ru.spcex.platform.enumeration.Status;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/securities/equity-securities")
|
||||
public class CudEquitySecurityController extends AbstractQueueController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public CudEquitySecurityController(IOperator operator, IStateLoader stateLoader) {
|
||||
super(operator);
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "create equity security.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public CudResponse add(
|
||||
@ApiParam(value = "Параметры команды в JSON формате.", required = true)
|
||||
@RequestBody EquitySecurityNewAction equitySecurityNewAction) throws ExecutionException, InterruptedException {
|
||||
return processRequest(Consts.DESTINATION_EQUITY_SECURITY_NEW, equitySecurityNewAction);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "update equity security.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public CudResponse update(
|
||||
@ApiParam(value = "Идентификатор изменяемого объекта.", required = true, example = "1234")
|
||||
@PathVariable("id") Long id,
|
||||
@ApiParam(value = "Новые значения полей объекта.", required = true)
|
||||
@RequestBody EquitySecurityUpdateAction equitySecurityUpdateAction) throws ExecutionException, InterruptedException {
|
||||
equitySecurityUpdateAction.setId(id);
|
||||
return processRequest(Consts.DESTINATION_EQUITY_SECURITY_UPDATE, equitySecurityUpdateAction);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "delete equity security.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|
||||
@ResponseBody
|
||||
public CudResponse delete(@ApiParam(value = "Идентификатор удаляемого объекта", required = true, example = "1234")
|
||||
@PathVariable("id") Long id) throws ExecutionException, InterruptedException {
|
||||
CommonDeleteAction deleteAction = new CommonDeleteAction();
|
||||
deleteAction.setId(id);
|
||||
return processRequest(Consts.DESTINATION_EQUITY_SECURITY_DELETE, deleteAction);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all equity securities.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CommonGetAllResponse.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonGetAllResponse getAll() {
|
||||
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_EquitySecurity,
|
||||
EquitySecurity.class,
|
||||
Map.of("workflowStatus", Status.Active.getKey()));
|
||||
CommonGetAllResponse response = new CommonGetAllResponse();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.securities;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.FixedIncomeCashFlow;
|
||||
import ru.spcex.clearing.backendapi.controller.queue.AbstractQueueController;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||
import ru.spcex.clearing.backendapi.service.IOperator;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/securities/fixed-income-cash-flow-securities")
|
||||
public class CudFixedIncomeCashFlowController extends AbstractQueueController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public CudFixedIncomeCashFlowController(IOperator operator, IStateLoader stateLoader) {
|
||||
super(operator);
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all fixed income cash flow securities.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CommonGetAllResponse.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonGetAllResponse getAll() {
|
||||
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_FixedIncomeCashFlow,
|
||||
FixedIncomeCashFlow.class);
|
||||
CommonGetAllResponse response = new CommonGetAllResponse();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package ru.spcex.clearing.backendapi.controller.queue.securities;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.FixedIncomeSecurity;
|
||||
import ru.spcex.clearing.backendapi.controller.queue.AbstractQueueController;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.common.CommonDeleteAction;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.securities.FixedIncomeSecurityNewAction;
|
||||
import ru.spcex.clearing.backendapi.controller.request.cud.securities.FixedIncomeSecurityUpdateAction;
|
||||
import ru.spcex.clearing.backendapi.controller.response.BasicSpcexResponse;
|
||||
import ru.spcex.clearing.backendapi.controller.response.cud.CudResponse;
|
||||
import ru.spcex.clearing.backendapi.controller.response.entity.CommonGetAllResponse;
|
||||
import ru.spcex.clearing.backendapi.service.IOperator;
|
||||
import ru.spcex.clearing.backendapi.service.IStateLoader;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
||||
import ru.spcex.platform.enumeration.Status;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/securities/fixed-income-securities")
|
||||
public class CudFixedIncomeSecurityController extends AbstractQueueController {
|
||||
private final IStateLoader stateLoader;
|
||||
|
||||
@Autowired
|
||||
public CudFixedIncomeSecurityController(IOperator operator, IStateLoader stateLoader) {
|
||||
super(operator);
|
||||
this.stateLoader = stateLoader;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "create fixed income security.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public CudResponse add(
|
||||
@ApiParam(value = "Параметры команды в JSON формате.", required = true)
|
||||
@RequestBody FixedIncomeSecurityNewAction fixedIncomeSecurityNewAction) throws ExecutionException, InterruptedException {
|
||||
return processRequest(Consts.DESTINATION_FIXED_INCOME_SECURITY_NEW, fixedIncomeSecurityNewAction);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "update fixed income security.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public CudResponse update(
|
||||
@ApiParam(value = "Идентификатор изменяемого объекта.", required = true, example = "1234")
|
||||
@PathVariable("id") Long id,
|
||||
@ApiParam(value = "Новые значения полей объекта.", required = true)
|
||||
@RequestBody FixedIncomeSecurityUpdateAction fixedIncomeSecurityUpdateAction) throws ExecutionException, InterruptedException {
|
||||
fixedIncomeSecurityUpdateAction.setId(id);
|
||||
return processRequest(Consts.DESTINATION_FIXED_INCOME_SECURITY_UPDATE, fixedIncomeSecurityUpdateAction);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "delete fixed income security.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|
||||
@ResponseBody
|
||||
public CudResponse delete(@ApiParam(value = "Идентификатор удаляемого объекта", required = true, example = "1234")
|
||||
@PathVariable("id") Long id) throws ExecutionException, InterruptedException {
|
||||
CommonDeleteAction deleteAction = new CommonDeleteAction();
|
||||
deleteAction.setId(id);
|
||||
return processRequest(Consts.DESTINATION_FIXED_INCOME_SECURITY_DELETE, deleteAction);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "get all equity securities.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CommonGetAllResponse.class)})
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public CommonGetAllResponse getAll() {
|
||||
Collection<Map<String, Object>> all = stateLoader.getAllMetaTransform(IMDGDistributedNames.Map_FixedIncomeSecurity,
|
||||
FixedIncomeSecurity.class,
|
||||
Map.of("workflowStatus", Status.Active.getKey()));
|
||||
CommonGetAllResponse response = new CommonGetAllResponse();
|
||||
response.fromEntity(all);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
|||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@Deprecated //todo не лишний ли этот контроллер? См. CudMoneyMarketSecurityController @Deprecated
|
||||
@Controller
|
||||
@RequestMapping("/securities")
|
||||
public class SecurityController {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,179 @@
|
|||
package ru.spcex.clearing.backendapi.controller.request.cud.securities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.spcex.clearing.backendapi.domain.actions.IAction;
|
||||
import ru.spcex.clearing.backendapi.errors.BackEndError;
|
||||
import ru.spcex.clearing.platform.messaging.domain.ActionType;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.securitites.EquitySecurityNewRequest;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithSecuritySymbol;
|
||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||
import ru.spcex.platform.utils.text.TextUtil;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class EquitySecurityNewAction implements IAction<EquitySecurityNewRequest>, WithSecuritySymbol {
|
||||
@ApiModelProperty(value = "Код инструмента", example = "ABSDEFJ")
|
||||
@JsonProperty
|
||||
public String securitySymbol;
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента", example = "ABSDE")
|
||||
@JsonProperty
|
||||
public String shortName;
|
||||
@ApiModelProperty(value = "Полное наименование инструмента", example = "Treasury bills")
|
||||
@JsonProperty
|
||||
public String fullName;
|
||||
@ApiModelProperty(value = "Наименование инструмента ISIN", example = "AFLT")
|
||||
@JsonProperty
|
||||
public String isin;
|
||||
@ApiModelProperty(value = "Код типа акции", example = "S")
|
||||
@JsonProperty
|
||||
public String shareType;
|
||||
@ApiModelProperty(value = "Размер лота", example = "300.5")
|
||||
@JsonProperty
|
||||
public BigDecimal lotSize;
|
||||
@ApiModelProperty(value = "Наименование эмитента (company)", example = "123")
|
||||
@JsonProperty
|
||||
public Long issuerId;
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента на английском", example = "Aero LLC")
|
||||
@JsonProperty
|
||||
public String shortNameEng;
|
||||
@ApiModelProperty(value = "Полное наименование инструмента на английском", example = "Aero floating Limited local Company")
|
||||
@JsonProperty
|
||||
public String fullNameEng;
|
||||
@ApiModelProperty(value = "Наименование статуса", example = "ACTV")
|
||||
@JsonProperty
|
||||
public String workflowStatus;
|
||||
@ApiModelProperty(value = "Наименование типа инструмента", example = "EQTY")
|
||||
@JsonProperty
|
||||
public String instrumentType;
|
||||
|
||||
@Override
|
||||
public Collection<EnumMessage> validate() {
|
||||
List<EnumMessage> errors = new ArrayList<>();
|
||||
if (TextUtil.isEmpty(shortName))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "shortName"));
|
||||
if (TextUtil.isEmpty(securitySymbol))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "securitySymbol"));
|
||||
if (lotSize == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "lotSize"));
|
||||
if (TextUtil.isEmpty(instrumentType))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "instrumentType"));
|
||||
return errors.size() > 0 ? errors : Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquitySecurityNewRequest toRequest() {
|
||||
var req = new EquitySecurityNewRequest();
|
||||
req.setSecuritySymbol(this.getSecuritySymbol());
|
||||
req.setShortName(this.getShortName());
|
||||
req.setFullName(this.getFullName());
|
||||
req.setIsin(this.getIsin());
|
||||
req.setShareType(this.getShareType());
|
||||
req.setLotSize(this.getLotSize());
|
||||
req.setIssuerId(this.getIssuerId());
|
||||
req.setShortNameEng(this.getShortNameEng());
|
||||
req.setFullNameEng(this.getFullNameEng());
|
||||
req.setWorkflowStatus(this.getWorkflowStatus());
|
||||
req.setInstrumentType(this.getInstrumentType());
|
||||
return req;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSecuritySymbol() {
|
||||
return securitySymbol;
|
||||
}
|
||||
|
||||
public void setSecuritySymbol(String securitySymbol) {
|
||||
this.securitySymbol = securitySymbol;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
public String getIsin() {
|
||||
return isin;
|
||||
}
|
||||
|
||||
public void setIsin(String isin) {
|
||||
this.isin = isin;
|
||||
}
|
||||
|
||||
public String getShareType() {
|
||||
return shareType;
|
||||
}
|
||||
|
||||
public void setShareType(String shareType) {
|
||||
this.shareType = shareType;
|
||||
}
|
||||
|
||||
public BigDecimal getLotSize() {
|
||||
return lotSize;
|
||||
}
|
||||
|
||||
public void setLotSize(BigDecimal lotSize) {
|
||||
this.lotSize = lotSize;
|
||||
}
|
||||
|
||||
public Long getIssuerId() {
|
||||
return issuerId;
|
||||
}
|
||||
|
||||
public void setIssuerId(Long issuerId) {
|
||||
this.issuerId = issuerId;
|
||||
}
|
||||
|
||||
public String getShortNameEng() {
|
||||
return shortNameEng;
|
||||
}
|
||||
|
||||
public void setShortNameEng(String shortNameEng) {
|
||||
this.shortNameEng = shortNameEng;
|
||||
}
|
||||
|
||||
public String getFullNameEng() {
|
||||
return fullNameEng;
|
||||
}
|
||||
|
||||
public void setFullNameEng(String fullNameEng) {
|
||||
this.fullNameEng = fullNameEng;
|
||||
}
|
||||
|
||||
public String getWorkflowStatus() {
|
||||
return workflowStatus;
|
||||
}
|
||||
|
||||
public void setWorkflowStatus(String workflowStatus) {
|
||||
this.workflowStatus = workflowStatus;
|
||||
}
|
||||
|
||||
public String getInstrumentType() {
|
||||
return instrumentType;
|
||||
}
|
||||
|
||||
public void setInstrumentType(String instrumentType) {
|
||||
this.instrumentType = instrumentType;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
package ru.spcex.clearing.backendapi.controller.request.cud.securities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.spcex.clearing.backendapi.domain.actions.IAction;
|
||||
import ru.spcex.clearing.backendapi.errors.BackEndError;
|
||||
import ru.spcex.clearing.platform.messaging.domain.ActionType;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.securitites.EquitySecurityUpdateRequest;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithSecuritySymbol;
|
||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class EquitySecurityUpdateAction implements IAction<EquitySecurityUpdateRequest>, WithSecuritySymbol {
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JsonProperty
|
||||
public Long id;
|
||||
@ApiModelProperty(value = "Код инструмента", example = "ABSDEFJ")
|
||||
@JsonProperty
|
||||
public String securitySymbol;
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента", example = "ABSDE")
|
||||
@JsonProperty
|
||||
public String shortName;
|
||||
@ApiModelProperty(value = "Полное наименование инструмента", example = "Treasury bills")
|
||||
@JsonProperty
|
||||
public String fullName;
|
||||
@ApiModelProperty(value = "Наименование инструмента ISIN", example = "AFLT")
|
||||
@JsonProperty
|
||||
public String isin;
|
||||
@ApiModelProperty(value = "Код типа акции", example = "S")
|
||||
@JsonProperty
|
||||
public String shareType;
|
||||
@ApiModelProperty(value = "Размер лота", example = "300.5")
|
||||
@JsonProperty
|
||||
public BigDecimal lotSize;
|
||||
@ApiModelProperty(value = "Наименование эмитента (company)", example = "123")
|
||||
@JsonProperty
|
||||
public Long issuerId;
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента на английском", example = "Aero LLC")
|
||||
@JsonProperty
|
||||
public String shortNameEng;
|
||||
@ApiModelProperty(value = "Полное наименование инструмента на английском", example = "Aero floating Limited local Company")
|
||||
@JsonProperty
|
||||
public String fullNameEng;
|
||||
@ApiModelProperty(value = "Наименование статуса", example = "ACTV")
|
||||
@JsonProperty
|
||||
public String workflowStatus;
|
||||
@ApiModelProperty(value = "Наименование типа инструмента", example = "EQTY")
|
||||
@JsonProperty
|
||||
public String instrumentType;
|
||||
|
||||
@Override
|
||||
public Collection<EnumMessage> validate() {
|
||||
List<EnumMessage> errors = new ArrayList<>();
|
||||
if (id == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "id"));
|
||||
return errors.size() > 0 ? errors : Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquitySecurityUpdateRequest toRequest() {
|
||||
var req = new EquitySecurityUpdateRequest();
|
||||
req.setId(this.getId());
|
||||
req.setSecuritySymbol(this.getSecuritySymbol());
|
||||
req.setShortName(this.getShortName());
|
||||
req.setFullName(this.getFullName());
|
||||
req.setIsin(this.getIsin());
|
||||
req.setShareType(this.getShareType());
|
||||
req.setLotSize(this.getLotSize());
|
||||
req.setIssuerId(this.getIssuerId());
|
||||
req.setShortNameEng(this.getShortNameEng());
|
||||
req.setFullNameEng(this.getFullNameEng());
|
||||
req.setWorkflowStatus(this.getWorkflowStatus());
|
||||
req.setInstrumentType(this.getInstrumentType());
|
||||
return req;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSecuritySymbol() {
|
||||
return securitySymbol;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setSecuritySymbol(String securitySymbol) {
|
||||
this.securitySymbol = securitySymbol;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
public String getIsin() {
|
||||
return isin;
|
||||
}
|
||||
|
||||
public void setIsin(String isin) {
|
||||
this.isin = isin;
|
||||
}
|
||||
|
||||
public String getShareType() {
|
||||
return shareType;
|
||||
}
|
||||
|
||||
public void setShareType(String shareType) {
|
||||
this.shareType = shareType;
|
||||
}
|
||||
|
||||
public BigDecimal getLotSize() {
|
||||
return lotSize;
|
||||
}
|
||||
|
||||
public void setLotSize(BigDecimal lotSize) {
|
||||
this.lotSize = lotSize;
|
||||
}
|
||||
|
||||
public Long getIssuerId() {
|
||||
return issuerId;
|
||||
}
|
||||
|
||||
public void setIssuerId(Long issuerId) {
|
||||
this.issuerId = issuerId;
|
||||
}
|
||||
|
||||
public String getShortNameEng() {
|
||||
return shortNameEng;
|
||||
}
|
||||
|
||||
public void setShortNameEng(String shortNameEng) {
|
||||
this.shortNameEng = shortNameEng;
|
||||
}
|
||||
|
||||
public String getFullNameEng() {
|
||||
return fullNameEng;
|
||||
}
|
||||
|
||||
public void setFullNameEng(String fullNameEng) {
|
||||
this.fullNameEng = fullNameEng;
|
||||
}
|
||||
|
||||
public String getWorkflowStatus() {
|
||||
return workflowStatus;
|
||||
}
|
||||
|
||||
public void setWorkflowStatus(String workflowStatus) {
|
||||
this.workflowStatus = workflowStatus;
|
||||
}
|
||||
|
||||
public String getInstrumentType() {
|
||||
return instrumentType;
|
||||
}
|
||||
|
||||
public void setInstrumentType(String instrumentType) {
|
||||
this.instrumentType = instrumentType;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,246 @@
|
|||
package ru.spcex.clearing.backendapi.controller.request.cud.securities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.spcex.clearing.backendapi.domain.actions.IAction;
|
||||
import ru.spcex.clearing.backendapi.errors.BackEndError;
|
||||
import ru.spcex.clearing.platform.messaging.domain.ActionType;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.securitites.FixedIncomeSecurityNewRequest;
|
||||
import ru.spcex.clearing.platform.messaging.domain.json.deserialize.LocalDateDeserializer;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithSecuritySymbol;
|
||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||
import ru.spcex.platform.utils.text.TextUtil;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class FixedIncomeSecurityNewAction implements IAction<FixedIncomeSecurityNewRequest>, WithSecuritySymbol {
|
||||
@ApiModelProperty(value = "Код инструмента", example = "ABSDEFJ")
|
||||
@JsonProperty
|
||||
public String securitySymbol;
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента", example = "ABSDE")
|
||||
@JsonProperty
|
||||
public String shortName;
|
||||
@ApiModelProperty(value = "Полное наименование инструмента", example = "Treasury bills")
|
||||
@JsonProperty
|
||||
public String fullName;
|
||||
@ApiModelProperty(value = "Наименование инструмента ISIN", example = "AFLT")
|
||||
@JsonProperty
|
||||
public String isin;
|
||||
@ApiModelProperty(value = "Код типа облигации", example = "AFLT")
|
||||
@JsonProperty
|
||||
public String bondType;
|
||||
@ApiModelProperty(value = "Размер лота", example = "300.5")
|
||||
@JsonProperty
|
||||
public BigDecimal lotSize;
|
||||
@ApiModelProperty(value = "Номинал", example = "200.5")
|
||||
@JsonProperty
|
||||
public BigDecimal nominalValue;
|
||||
@ApiModelProperty(value = "Наименование валюты номинала", example = "RUB")
|
||||
@JsonProperty
|
||||
public String nominalCurrency;
|
||||
@ApiModelProperty(value = "Дата погашения", example = "2022-02-21")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Europe/Moscow")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
@JsonProperty
|
||||
public LocalDate maturityDate;
|
||||
@ApiModelProperty(value = "Купон", example = "310.5")
|
||||
@JsonProperty
|
||||
public BigDecimal coupon;
|
||||
@ApiModelProperty(value = "Длительность купона", example = "4")
|
||||
@JsonProperty
|
||||
public Long couponFrequency;
|
||||
@ApiModelProperty(value = "Наименование эмитента", example = "1000")
|
||||
@JsonProperty
|
||||
public Long issuerId;
|
||||
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента на английском", example = "Short LLT")
|
||||
@JsonProperty
|
||||
public String shortNameEng;
|
||||
@ApiModelProperty(value = "Полное наименование инструмента на английском", example = "True short name Limited Lumia Technology LLT")
|
||||
@JsonProperty
|
||||
public String fullNameEng;
|
||||
@ApiModelProperty(value = "Наименование статуса", example = "ACTV")
|
||||
@JsonProperty
|
||||
public String workflowStatus;
|
||||
@ApiModelProperty(value = "Наименование типа инструмента", example = "EQTY")
|
||||
@JsonProperty
|
||||
public String instrumentType;
|
||||
|
||||
@Override
|
||||
public Collection<EnumMessage> validate() {
|
||||
List<EnumMessage> errors = new ArrayList<>();
|
||||
if (TextUtil.isEmpty(securitySymbol))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "securitySymbol"));
|
||||
if (TextUtil.isEmpty(shortName))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "shortName"));
|
||||
if (lotSize == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "lotSize"));
|
||||
if (TextUtil.isEmpty(instrumentType))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "instrumentType"));
|
||||
return errors.size() > 0 ? errors : Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FixedIncomeSecurityNewRequest toRequest() {
|
||||
var req = new FixedIncomeSecurityNewRequest();
|
||||
req.setSecuritySymbol(this.getSecuritySymbol());
|
||||
req.setShortName(this.getShortName());
|
||||
req.setFullName(this.getFullName());
|
||||
req.setIsin(this.getIsin());
|
||||
req.setBondType(this.getBondType());
|
||||
req.setLotSize(this.getLotSize());
|
||||
req.setNominalValue(this.getNominalValue());
|
||||
req.setNominalCurrency(this.getNominalCurrency());
|
||||
req.setMaturityDate(this.getMaturityDate());
|
||||
req.setCoupon(this.getCoupon());
|
||||
req.setCouponFrequency(this.getCouponFrequency());
|
||||
req.setIssuerId(this.getIssuerId());
|
||||
req.setShortNameEng(this.getShortNameEng());
|
||||
req.setFullNameEng(this.getFullNameEng());
|
||||
req.setWorkflowStatus(this.getWorkflowStatus());
|
||||
req.setInstrumentType(this.getInstrumentType());
|
||||
return req;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSecuritySymbol() {
|
||||
return securitySymbol;
|
||||
}
|
||||
|
||||
public void setSecuritySymbol(String securitySymbol) {
|
||||
this.securitySymbol = securitySymbol;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
public String getIsin() {
|
||||
return isin;
|
||||
}
|
||||
|
||||
public void setIsin(String isin) {
|
||||
this.isin = isin;
|
||||
}
|
||||
|
||||
public String getBondType() {
|
||||
return bondType;
|
||||
}
|
||||
|
||||
public void setBondType(String bondType) {
|
||||
this.bondType = bondType;
|
||||
}
|
||||
|
||||
public BigDecimal getLotSize() {
|
||||
return lotSize;
|
||||
}
|
||||
|
||||
public void setLotSize(BigDecimal lotSize) {
|
||||
this.lotSize = lotSize;
|
||||
}
|
||||
|
||||
public BigDecimal getNominalValue() {
|
||||
return nominalValue;
|
||||
}
|
||||
|
||||
public void setNominalValue(BigDecimal nominalValue) {
|
||||
this.nominalValue = nominalValue;
|
||||
}
|
||||
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
|
||||
public void setNominalCurrency(String nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
}
|
||||
|
||||
public LocalDate getMaturityDate() {
|
||||
return maturityDate;
|
||||
}
|
||||
|
||||
public void setMaturityDate(LocalDate maturityDate) {
|
||||
this.maturityDate = maturityDate;
|
||||
}
|
||||
|
||||
public BigDecimal getCoupon() {
|
||||
return coupon;
|
||||
}
|
||||
|
||||
public void setCoupon(BigDecimal coupon) {
|
||||
this.coupon = coupon;
|
||||
}
|
||||
|
||||
public Long getCouponFrequency() {
|
||||
return couponFrequency;
|
||||
}
|
||||
|
||||
public void setCouponFrequency(Long couponFrequency) {
|
||||
this.couponFrequency = couponFrequency;
|
||||
}
|
||||
|
||||
public Long getIssuerId() {
|
||||
return issuerId;
|
||||
}
|
||||
|
||||
public void setIssuerId(Long issuerId) {
|
||||
this.issuerId = issuerId;
|
||||
}
|
||||
|
||||
public String getShortNameEng() {
|
||||
return shortNameEng;
|
||||
}
|
||||
|
||||
public void setShortNameEng(String shortNameEng) {
|
||||
this.shortNameEng = shortNameEng;
|
||||
}
|
||||
|
||||
public String getFullNameEng() {
|
||||
return fullNameEng;
|
||||
}
|
||||
|
||||
public void setFullNameEng(String fullNameEng) {
|
||||
this.fullNameEng = fullNameEng;
|
||||
}
|
||||
|
||||
public String getWorkflowStatus() {
|
||||
return workflowStatus;
|
||||
}
|
||||
|
||||
public void setWorkflowStatus(String workflowStatus) {
|
||||
this.workflowStatus = workflowStatus;
|
||||
}
|
||||
|
||||
public String getInstrumentType() {
|
||||
return instrumentType;
|
||||
}
|
||||
|
||||
public void setInstrumentType(String instrumentType) {
|
||||
this.instrumentType = instrumentType;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
package ru.spcex.clearing.backendapi.controller.request.cud.securities;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import ru.spcex.clearing.backendapi.domain.actions.IAction;
|
||||
import ru.spcex.clearing.backendapi.errors.BackEndError;
|
||||
import ru.spcex.clearing.platform.messaging.domain.ActionType;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.securitites.FixedIncomeSecurityUpdateRequest;
|
||||
import ru.spcex.clearing.platform.messaging.domain.json.deserialize.LocalDateDeserializer;
|
||||
import ru.spcex.platform.classes.base.interfaces.WithSecuritySymbol;
|
||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class FixedIncomeSecurityUpdateAction implements IAction<FixedIncomeSecurityUpdateRequest>, WithSecuritySymbol {
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JsonProperty
|
||||
public Long id;
|
||||
@ApiModelProperty(value = "Код инструмента", example = "ABSDEFJ")
|
||||
@JsonProperty
|
||||
public String securitySymbol;
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента", example = "ABSDE")
|
||||
@JsonProperty
|
||||
public String shortName;
|
||||
@ApiModelProperty(value = "Полное наименование инструмента", example = "Treasury bills")
|
||||
@JsonProperty
|
||||
public String fullName;
|
||||
@ApiModelProperty(value = "Наименование инструмента ISIN", example = "AFLT")
|
||||
@JsonProperty
|
||||
public String isin;
|
||||
@ApiModelProperty(value = "Код типа облигации", example = "AFLT")
|
||||
@JsonProperty
|
||||
public String bondType;
|
||||
@ApiModelProperty(value = "Размер лота", example = "300.5")
|
||||
@JsonProperty
|
||||
public BigDecimal lotSize;
|
||||
@ApiModelProperty(value = "Номинал", example = "200.5")
|
||||
@JsonProperty
|
||||
public BigDecimal nominalValue;
|
||||
@ApiModelProperty(value = "Наименование валюты номинала", example = "RUB")
|
||||
@JsonProperty
|
||||
public String nominalCurrency;
|
||||
@ApiModelProperty(value = "Дата погашения", example = "2022-02-21")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Europe/Moscow")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
@JsonProperty
|
||||
public LocalDate maturityDate;
|
||||
@ApiModelProperty(value = "Купон", example = "310.5")
|
||||
@JsonProperty
|
||||
public BigDecimal coupon;
|
||||
@ApiModelProperty(value = "Длительность купона", example = "4")
|
||||
@JsonProperty
|
||||
public Long couponFrequency;
|
||||
@ApiModelProperty(value = "Наименование эмитента", example = "1000")
|
||||
@JsonProperty
|
||||
public Long issuerId;
|
||||
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента на английском", example = "Short LLT")
|
||||
@JsonProperty
|
||||
public String shortNameEng;
|
||||
@ApiModelProperty(value = "Полное наименование инструмента на английском", example = "True short name Limited Lumia Technology LLT")
|
||||
@JsonProperty
|
||||
public String fullNameEng;
|
||||
@ApiModelProperty(value = "Наименование статуса", example = "ACTV")
|
||||
@JsonProperty
|
||||
public String workflowStatus;
|
||||
@ApiModelProperty(value = "Наименование типа инструмента", example = "EQTY")
|
||||
@JsonProperty
|
||||
public String instrumentType;
|
||||
|
||||
@Override
|
||||
public Collection<EnumMessage> validate() {
|
||||
List<EnumMessage> errors = new ArrayList<>();
|
||||
if (id == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "id"));
|
||||
return errors.size() > 0 ? errors : Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FixedIncomeSecurityUpdateRequest toRequest() {
|
||||
var req = new FixedIncomeSecurityUpdateRequest();
|
||||
req.setId(this.getId());
|
||||
req.setSecuritySymbol(this.getSecuritySymbol());
|
||||
req.setShortName(this.getShortName());
|
||||
req.setFullName(this.getFullName());
|
||||
req.setIsin(this.getIsin());
|
||||
req.setBondType(this.getBondType());
|
||||
req.setLotSize(this.getLotSize());
|
||||
req.setNominalValue(this.getNominalValue());
|
||||
req.setNominalCurrency(this.getNominalCurrency());
|
||||
req.setMaturityDate(this.getMaturityDate());
|
||||
req.setCoupon(this.getCoupon());
|
||||
req.setCouponFrequency(this.getCouponFrequency());
|
||||
req.setIssuerId(this.getIssuerId());
|
||||
req.setShortNameEng(this.getShortNameEng());
|
||||
req.setFullNameEng(this.getFullNameEng());
|
||||
req.setWorkflowStatus(this.getWorkflowStatus());
|
||||
req.setInstrumentType(this.getInstrumentType());
|
||||
return req;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSecuritySymbol() {
|
||||
return securitySymbol;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setSecuritySymbol(String securitySymbol) {
|
||||
this.securitySymbol = securitySymbol;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
public String getIsin() {
|
||||
return isin;
|
||||
}
|
||||
|
||||
public void setIsin(String isin) {
|
||||
this.isin = isin;
|
||||
}
|
||||
|
||||
public String getBondType() {
|
||||
return bondType;
|
||||
}
|
||||
|
||||
public void setBondType(String bondType) {
|
||||
this.bondType = bondType;
|
||||
}
|
||||
|
||||
public BigDecimal getLotSize() {
|
||||
return lotSize;
|
||||
}
|
||||
|
||||
public void setLotSize(BigDecimal lotSize) {
|
||||
this.lotSize = lotSize;
|
||||
}
|
||||
|
||||
public BigDecimal getNominalValue() {
|
||||
return nominalValue;
|
||||
}
|
||||
|
||||
public void setNominalValue(BigDecimal nominalValue) {
|
||||
this.nominalValue = nominalValue;
|
||||
}
|
||||
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
|
||||
public void setNominalCurrency(String nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
}
|
||||
|
||||
public LocalDate getMaturityDate() {
|
||||
return maturityDate;
|
||||
}
|
||||
|
||||
public void setMaturityDate(LocalDate maturityDate) {
|
||||
this.maturityDate = maturityDate;
|
||||
}
|
||||
|
||||
public BigDecimal getCoupon() {
|
||||
return coupon;
|
||||
}
|
||||
|
||||
public void setCoupon(BigDecimal coupon) {
|
||||
this.coupon = coupon;
|
||||
}
|
||||
|
||||
public Long getCouponFrequency() {
|
||||
return couponFrequency;
|
||||
}
|
||||
|
||||
public void setCouponFrequency(Long couponFrequency) {
|
||||
this.couponFrequency = couponFrequency;
|
||||
}
|
||||
|
||||
public Long getIssuerId() {
|
||||
return issuerId;
|
||||
}
|
||||
|
||||
public void setIssuerId(Long issuerId) {
|
||||
this.issuerId = issuerId;
|
||||
}
|
||||
|
||||
public String getShortNameEng() {
|
||||
return shortNameEng;
|
||||
}
|
||||
|
||||
public void setShortNameEng(String shortNameEng) {
|
||||
this.shortNameEng = shortNameEng;
|
||||
}
|
||||
|
||||
public String getFullNameEng() {
|
||||
return fullNameEng;
|
||||
}
|
||||
|
||||
public void setFullNameEng(String fullNameEng) {
|
||||
this.fullNameEng = fullNameEng;
|
||||
}
|
||||
|
||||
public String getWorkflowStatus() {
|
||||
return workflowStatus;
|
||||
}
|
||||
|
||||
public void setWorkflowStatus(String workflowStatus) {
|
||||
this.workflowStatus = workflowStatus;
|
||||
}
|
||||
|
||||
public String getInstrumentType() {
|
||||
return instrumentType;
|
||||
}
|
||||
|
||||
public void setInstrumentType(String instrumentType) {
|
||||
this.instrumentType = instrumentType;
|
||||
}
|
||||
}
|
||||
|
|
@ -49,26 +49,31 @@ public class MoneyMarketSecurityNewAction implements IAction<MoneyMarketSecurity
|
|||
@ApiModelProperty(value = "Размер лота", example = "300.5")
|
||||
@JsonProperty
|
||||
public BigDecimal lotSize;
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента", example = "ABSDE")
|
||||
@JsonProperty
|
||||
public String shortName;
|
||||
|
||||
@Override
|
||||
public Collection<EnumMessage> validate() {
|
||||
List<EnumMessage> errors = new ArrayList<>();
|
||||
if (this.startDate == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "startDate"));
|
||||
if (this.endDate == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "endDate"));
|
||||
if (TextUtil.isEmpty(securitySymbol))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "securitySymbol"));
|
||||
if (TextUtil.isEmpty(shortName))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "shortName"));
|
||||
if (this.lotSize == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "lotSize"));
|
||||
if (this.nominalValue == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "nominalValue"));
|
||||
if (TextUtil.isEmpty(nominalCurrency))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "nominalCurrency"));
|
||||
if (this.startDate == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "startDate"));
|
||||
if (this.endDate == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "endDate"));
|
||||
// if (this.termType == null)
|
||||
// errors.add(new EnumMessage(BackEndError.ValidationError, "termType"));
|
||||
if (TextUtil.isEmpty(instrumentType))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "instrumentType"));
|
||||
if (TextUtil.isEmpty(fullName))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "fullName"));
|
||||
if (TextUtil.isEmpty(securitySymbol))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "securitySymbol"));
|
||||
if (this.lotSize == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "lotSize"));
|
||||
return errors.size() > 0 ? errors : Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
@ -83,6 +88,7 @@ public class MoneyMarketSecurityNewAction implements IAction<MoneyMarketSecurity
|
|||
req.setFullName(this.getFullName());
|
||||
req.setSecuritySymbol(this.getSecuritySymbol());
|
||||
req.setLotSize(this.getLotSize());
|
||||
req.setShortName(this.getShortName());
|
||||
return req;
|
||||
}
|
||||
|
||||
|
|
@ -155,4 +161,12 @@ public class MoneyMarketSecurityNewAction implements IAction<MoneyMarketSecurity
|
|||
public void setLotSize(BigDecimal lotSize) {
|
||||
this.lotSize = lotSize;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ public class MoneyMarketSecurityUpdateAction implements IAction<MoneyMarketSecur
|
|||
@ApiModelProperty(value = "Размер лота", example = "300.5")
|
||||
@JsonProperty
|
||||
public BigDecimal lotSize;
|
||||
@ApiModelProperty(value = "Краткое наименование инструмента", example = "ABSDE")
|
||||
@JsonProperty
|
||||
public String shortName;
|
||||
|
||||
@Override
|
||||
public MoneyMarketSecurityUpdateRequest toRequest() {
|
||||
|
|
@ -61,26 +64,15 @@ public class MoneyMarketSecurityUpdateAction implements IAction<MoneyMarketSecur
|
|||
req.setInstrumentType(this.getInstrumentType());
|
||||
req.setFullName(this.getFullName());
|
||||
req.setLotSize(this.getLotSize());
|
||||
req.setShortName(this.getShortName());
|
||||
return req;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<EnumMessage> validate() {
|
||||
List<EnumMessage> errors = new ArrayList<>();
|
||||
if (this.startDate == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "startDate"));
|
||||
if (this.endDate == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "endDate"));
|
||||
if (this.nominalValue == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "nominalValue"));
|
||||
if (TextUtil.isEmpty(nominalCurrency))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "nominalCurrency"));
|
||||
if (TextUtil.isEmpty(instrumentType))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "instrumentType"));
|
||||
if (TextUtil.isEmpty(fullName))
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "fullName"));
|
||||
if (this.lotSize == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "lotSize"));
|
||||
if (this.id == null)
|
||||
errors.add(new EnumMessage(BackEndError.ValidationError, "id"));
|
||||
return errors.size() > 0 ? errors : Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
@ -154,4 +146,12 @@ public class MoneyMarketSecurityUpdateAction implements IAction<MoneyMarketSecur
|
|||
public void setStartDate(LocalDate startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
public void setShortName(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ class EditCompanyInfoControllerTest extends AbstractControllerTest {
|
|||
* {@link EditCompanyInfoController#update(Long, CompanyInfoUpdateAction)}<br>
|
||||
* Тест проверяет получение сущности {@link CompanyInfoUpdateAction} по REST API и отправку в Apache Kafka.<br>
|
||||
* Входной запрос {@link CompanyInfoUpdateAction}:<br>
|
||||
* {@link CompanyInfoUpdateAction#clearingCode} - 11<br>
|
||||
* {@link CompanyInfoUpdateAction#tradingCode} - 11<br>
|
||||
* {@link CompanyInfoUpdateAction#workflowStatus} - ACTV<br>
|
||||
* {@link CompanyInfoUpdateAction#corporationSoleType} - 0000<br>
|
||||
* {@link CompanyInfoUpdateAction#countryCode} - 0000<br>
|
||||
* {@link CompanyInfoUpdateAction#description} - exists description<br>
|
||||
|
|
@ -58,8 +57,7 @@ class EditCompanyInfoControllerTest extends AbstractControllerTest {
|
|||
* {@link EditCompanyInfoController#update(Long, CompanyInfoUpdateAction)}<br>
|
||||
* Тест проверяет получение сущности {@link CompanyInfoUpdateAction} по REST API и отправку в Apache Kafka.<br>
|
||||
* Входной запрос {@link CompanyInfoUpdateAction}:<br>
|
||||
* {@link CompanyInfoUpdateAction#clearingCode} - 11<br>
|
||||
* {@link CompanyInfoUpdateAction#tradingCode} - 11<br>
|
||||
* {@link CompanyInfoUpdateAction#workflowStatus} - ACTV<br>
|
||||
* {@link CompanyInfoUpdateAction#corporationSoleType} - 0000<br>
|
||||
* {@link CompanyInfoUpdateAction#countryCode} - 0000<br>
|
||||
* {@link CompanyInfoUpdateAction#description} - exists description<br>
|
||||
|
|
@ -77,8 +75,7 @@ class EditCompanyInfoControllerTest extends AbstractControllerTest {
|
|||
void update() throws Exception {
|
||||
//ARRANGE
|
||||
CompanyInfoUpdateAction companyInfoUpdateAction = new CompanyInfoUpdateAction();
|
||||
companyInfoUpdateAction.setClearingCode("11");
|
||||
companyInfoUpdateAction.setTradingCode("11");
|
||||
companyInfoUpdateAction.setWorkflowStatus("ACTV");
|
||||
companyInfoUpdateAction.setCorporationSoleType("0000");
|
||||
companyInfoUpdateAction.setCountryCode("0000");
|
||||
companyInfoUpdateAction.setDescription("exists description");
|
||||
|
|
@ -119,8 +116,6 @@ class EditCompanyInfoControllerTest extends AbstractControllerTest {
|
|||
existsCompanyInfo.setResidence("0000");
|
||||
existsCompanyInfo.setShortNameEng("exists shortNameEng");
|
||||
existsCompanyInfo.setFullNameEng("exists fullNameEng");
|
||||
existsCompanyInfo.setShortName("exists shortName");
|
||||
existsCompanyInfo.setFullName("exists fullName");
|
||||
Company existsCompany = new Company();
|
||||
existsCompany.setId(ID);
|
||||
existsCompany.setProfile(existsCompanyInfo);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue