diff --git a/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/queue/misc/OvernightSettingsController.java b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/queue/misc/OvernightSettingsController.java new file mode 100644 index 000000000..032bd0b69 --- /dev/null +++ b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/queue/misc/OvernightSettingsController.java @@ -0,0 +1,71 @@ +package ru.spcex.clearing.backendapi.controller.queue.misc; + +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import java.util.Collections; +import java.util.concurrent.ExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import ru.spcex.clearing.backendapi.controller.queue.AbstractQueueController; +import ru.spcex.clearing.backendapi.controller.request.cud.misc.OvernightNewAction; +import ru.spcex.clearing.backendapi.controller.request.cud.misc.OvernightUpdateAction; +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.platform.messaging.domain.Consts; + +@Controller +@RequestMapping("/overnight-settings") +public class OvernightSettingsController extends AbstractQueueController { + private final IStateLoader stateLoader; + + @Autowired + public OvernightSettingsController(IOperator operator, IStateLoader stateLoader) { + super(operator); + this.stateLoader = stateLoader; + } + + @ApiOperation(value = "get all overnight settings.") + @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CommonGetAllResponse.class)}) + @RequestMapping(method = RequestMethod.GET) + @ResponseBody + public CommonGetAllResponse getAll() { + CommonGetAllResponse response = new CommonGetAllResponse(); + response.fromEntity(Collections.EMPTY_LIST); + return response; + } + + @ApiOperation(value = "create overnight settings.") + @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) + @ResponseBody + public CudResponse create( + @ApiParam(value = "Значения полей нового объекта.", required = true) + @RequestBody OvernightNewAction overnightNewAction) throws ExecutionException, InterruptedException { + return processRequest(Consts.OVERNIGHT_SETTINGS_NEW, overnightNewAction); + } + + @ApiOperation(value = "update overnight settings.") + @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 OvernightUpdateAction overnightUpdateAction) throws ExecutionException, InterruptedException { + overnightUpdateAction.setId(id); + return processRequest(Consts.OVERNIGHT_SETTINGS_UPDATE, overnightUpdateAction); + } + +} diff --git a/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/queue/order/OrderCurrencyController.java b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/queue/order/OrderCurrencyController.java new file mode 100644 index 000000000..07a1d71c5 --- /dev/null +++ b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/queue/order/OrderCurrencyController.java @@ -0,0 +1,116 @@ +package ru.spcex.clearing.backendapi.controller.queue.order; + +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +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.misc.OrderCurrency; +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.order.OrderCompanyNewAction; +import ru.spcex.clearing.backendapi.controller.request.cud.order.OrderCompanyUpdateAction; +import ru.spcex.clearing.backendapi.controller.request.cud.order.OrderCurrencyUpdateAction; +import ru.spcex.clearing.backendapi.controller.request.cud.order.OrderOvernightTypeUpdateAction; +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; + +@Controller +@RequestMapping("/order-currency") +public class OrderCurrencyController extends AbstractQueueController { + private final IStateLoader stateLoader; + + @Autowired + public OrderCurrencyController(IOperator operator, IStateLoader stateLoader) { + super(operator); + this.stateLoader = stateLoader; + } + + @ApiOperation(value = "get all order currency.") + @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CommonGetAllResponse.class)}) + @RequestMapping(method = RequestMethod.GET) + @ResponseBody + public CommonGetAllResponse getAll() { + Collection> all = stateLoader.getAllMetaTransform( + IMDGDistributedNames.Map_OrderCurrency, OrderCurrency.class); + CommonGetAllResponse response = new CommonGetAllResponse(); + response.fromEntity(all); + return response; + } + + @ApiOperation(value = "update order currency.") + @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 OrderCurrencyUpdateAction orderCurrencyUpdateAction) throws ExecutionException, InterruptedException { + orderCurrencyUpdateAction.setId(id); + return processRequest(Consts.ORDER_CURRENCY_UPDATE, orderCurrencyUpdateAction); + } + + @ApiOperation(value = "update overnight type for order currency.") + @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)}) + @RequestMapping(path = "/overnightType/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CudResponse updateOvernightType( + @ApiParam(value = "Идентификатор изменяемого объекта.", required = true, example = "1234") + @PathVariable("id") Long id, + @ApiParam(value = "Новые значения полей объекта.", required = true) + @RequestBody OrderOvernightTypeUpdateAction orderOvernightTypeUpdateAction) throws ExecutionException, InterruptedException { + orderOvernightTypeUpdateAction.setId(id); + return processRequest(Consts.ORDER_OVERNIGHT_TYPE_UPDATE, orderOvernightTypeUpdateAction); + } + + @ApiOperation(value = "create company for order currency.") + @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)}) + @RequestMapping(path = "/company", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CudResponse createCompany( + @ApiParam(value = "Значения полей нового объекта.", required = true) + @RequestBody OrderCompanyNewAction orderCompanyNewAction) throws ExecutionException, InterruptedException { + return processRequest(Consts.ORDER_CURRENCY_COMPANY_NEW, orderCompanyNewAction); + } + + @ApiOperation(value = "update company for order currency.") + @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)}) + @RequestMapping(path = "/company/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public CudResponse updateCompany( + @ApiParam(value = "Идентификатор изменяемого объекта.", required = true, example = "1234") + @PathVariable("id") Long id, + @ApiParam(value = "Новые значения полей объекта.", required = true) + @RequestBody OrderCompanyUpdateAction orderCompanyUpdateAction) throws ExecutionException, InterruptedException { + orderCompanyUpdateAction.setId(id); + return processRequest(Consts.ORDER_CURRENCY_COMPANY_UPDATE, orderCompanyUpdateAction); + } + + @ApiOperation(value = "delete company for order currency.") + @ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.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.ORDER_CURRENCY_COMPANY_DELETE, deleteAction); + } + +} diff --git a/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/misc/OvernightNewAction.java b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/misc/OvernightNewAction.java new file mode 100644 index 000000000..6f1de0641 --- /dev/null +++ b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/misc/OvernightNewAction.java @@ -0,0 +1,58 @@ +package ru.spcex.clearing.backendapi.controller.request.cud.misc; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import ru.spcex.clearing.backendapi.domain.actions.IAction; +import ru.spcex.clearing.platform.messaging.domain.ActionType; +import ru.spcex.clearing.platform.messaging.domain.cud.misc.OvernightSettingsNewRequest; + +public class OvernightNewAction implements IAction { + @ApiModelProperty(value = "Идентификатор участника", example = "123") + @JsonProperty + public Long companyId; + @ApiModelProperty(value = "Код рынка", example = "TVAF") + @JsonProperty + public String market; + @ApiModelProperty(value = "Тип сделок переноса компании", example = "ASD") + @JsonProperty + public String overnightType; + + @Override + public OvernightSettingsNewRequest toRequest() { + var req = new OvernightSettingsNewRequest(); + req.setCompanyId(this.companyId); + req.setMarket(this.market); + req.setOvernightType(this.overnightType); + return req; + } + + @ApiModelProperty(hidden = true) + @Override + public ActionType getActionType() { + return ActionType.NEW; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getMarket() { + return market; + } + + public void setMarket(String market) { + this.market = market; + } + + public String getOvernightType() { + return overnightType; + } + + public void setOvernightType(String overnightType) { + this.overnightType = overnightType; + } +} diff --git a/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/misc/OvernightUpdateAction.java b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/misc/OvernightUpdateAction.java new file mode 100644 index 000000000..8826bfab5 --- /dev/null +++ b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/misc/OvernightUpdateAction.java @@ -0,0 +1,70 @@ +package ru.spcex.clearing.backendapi.controller.request.cud.misc; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import ru.spcex.clearing.backendapi.domain.actions.IAction; +import ru.spcex.clearing.platform.messaging.domain.ActionType; +import ru.spcex.clearing.platform.messaging.domain.cud.misc.OvernightSettingsUpdateRequest; + +public class OvernightUpdateAction implements IAction { + @ApiModelProperty(value = "Идентификатор записи", example = "122") + @JsonProperty + public Long id; + @ApiModelProperty(value = "Идентификатор участника", example = "123") + @JsonProperty + public Long companyId; + @ApiModelProperty(value = "Код рынка", example = "TVAF") + @JsonProperty + public String market; + @ApiModelProperty(value = "Тип сделок переноса компании", example = "ASD") + @JsonProperty + public String overnightType; + + @Override + public OvernightSettingsUpdateRequest toRequest() { + var req = new OvernightSettingsUpdateRequest(); + req.setId(this.id); + req.setCompanyId(this.companyId); + req.setMarket(this.market); + req.setOvernightType(this.overnightType); + return req; + } + + @ApiModelProperty(hidden = true) + @Override + public ActionType getActionType() { + return ActionType.UPDATE; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getMarket() { + return market; + } + + public void setMarket(String market) { + this.market = market; + } + + public String getOvernightType() { + return overnightType; + } + + public void setOvernightType(String overnightType) { + this.overnightType = overnightType; + } +} diff --git a/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCompanyNewAction.java b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCompanyNewAction.java new file mode 100644 index 000000000..d8ae0dc9c --- /dev/null +++ b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCompanyNewAction.java @@ -0,0 +1,70 @@ +package ru.spcex.clearing.backendapi.controller.request.cud.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import ru.spcex.clearing.backendapi.domain.actions.IAction; +import ru.spcex.clearing.platform.messaging.domain.ActionType; +import ru.spcex.clearing.platform.messaging.domain.cud.order.OrderCompanyNewRequest; + +public class OrderCompanyNewAction implements IAction { + @ApiModelProperty(value = "Идентификатор записи", example = "12") + @JsonProperty + private Long id; + @ApiModelProperty(value = "Тип сделок переноса компании", example = "ASDF") + @JsonProperty + private Long companyId; + @ApiModelProperty(value = "Торгово-клиринговый регистр", example = "ASDF") + @JsonProperty + private Long tradingClearingRegistryId; + @ApiModelProperty(value = "Объем заявки в лотах", example = "ASDF") + @JsonProperty + private Long quantityLot; + + @Override + public OrderCompanyNewRequest toRequest() { + OrderCompanyNewRequest request = new OrderCompanyNewRequest(); + request.setId(id); + request.setCompanyId(companyId); + request.setTradingClearingRegistryId(tradingClearingRegistryId); + request.setQuantityLot(quantityLot); + return request; + } + + @ApiModelProperty(hidden = true) + @Override + public ActionType getActionType() { + return ActionType.NEW; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Long getTradingClearingRegistryId() { + return tradingClearingRegistryId; + } + + public void setTradingClearingRegistryId(Long tradingClearingRegistryId) { + this.tradingClearingRegistryId = tradingClearingRegistryId; + } + + public Long getQuantityLot() { + return quantityLot; + } + + public void setQuantityLot(Long quantityLot) { + this.quantityLot = quantityLot; + } +} diff --git a/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCompanyUpdateAction.java b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCompanyUpdateAction.java new file mode 100644 index 000000000..2261ca10f --- /dev/null +++ b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCompanyUpdateAction.java @@ -0,0 +1,70 @@ +package ru.spcex.clearing.backendapi.controller.request.cud.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import ru.spcex.clearing.backendapi.domain.actions.IAction; +import ru.spcex.clearing.platform.messaging.domain.ActionType; +import ru.spcex.clearing.platform.messaging.domain.cud.order.OrderCompanyUpdateRequest; + +public class OrderCompanyUpdateAction implements IAction { + @ApiModelProperty(value = "Идентификатор записи", example = "12") + @JsonProperty + private Long id; + @ApiModelProperty(value = "Тип сделок переноса компании", example = "ASDF") + @JsonProperty + private Long companyId; + @ApiModelProperty(value = "Торгово-клиринговый регистр", example = "ASDF") + @JsonProperty + private Long tradingClearingRegistryId; + @ApiModelProperty(value = "Объем заявки в лотах", example = "ASDF") + @JsonProperty + private Long quantityLot; + + @Override + public OrderCompanyUpdateRequest toRequest() { + OrderCompanyUpdateRequest request = new OrderCompanyUpdateRequest(); + request.setId(id); + request.setCompanyId(companyId); + request.setTradingClearingRegistryId(tradingClearingRegistryId); + request.setQuantityLot(quantityLot); + return request; + } + + @ApiModelProperty(hidden = true) + @Override + public ActionType getActionType() { + return ActionType.NEW; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Long getTradingClearingRegistryId() { + return tradingClearingRegistryId; + } + + public void setTradingClearingRegistryId(Long tradingClearingRegistryId) { + this.tradingClearingRegistryId = tradingClearingRegistryId; + } + + public Long getQuantityLot() { + return quantityLot; + } + + public void setQuantityLot(Long quantityLot) { + this.quantityLot = quantityLot; + } +} diff --git a/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCurrencyUpdateAction.java b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCurrencyUpdateAction.java new file mode 100644 index 000000000..8cd2e5691 --- /dev/null +++ b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderCurrencyUpdateAction.java @@ -0,0 +1,107 @@ +package ru.spcex.clearing.backendapi.controller.request.cud.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import ru.spcex.clearing.backendapi.domain.actions.IAction; +import ru.spcex.clearing.platform.messaging.domain.ActionType; +import ru.spcex.clearing.platform.messaging.domain.cud.order.OrderCurrencyUpdateRequest; + +public class OrderCurrencyUpdateAction implements IAction { + @ApiModelProperty(value = "Идентификатор записи", example = "12") + @JsonProperty + private Long id; + @ApiModelProperty(value = "Наименование инструмента", example = "333") + @JsonProperty + private Long securityId; + @ApiModelProperty(value = "Цена заявки", example = "12.33") + @JsonProperty + private BigDecimal price; + @ApiModelProperty(value = "Объем заявки в лотах", example = "21") + @JsonProperty + private Long quantityLot; + @ApiModelProperty(value = "Направление заявки", example = "BUY") + @JsonProperty + private String side; + @ApiModelProperty(value = "Статус заявки", example = "ACT") + @JsonProperty + private String status; + @ApiModelProperty(value = "Комментарий", example = "asd") + @JsonProperty + private String comment; + + @Override + public OrderCurrencyUpdateRequest toRequest() { + OrderCurrencyUpdateRequest request = new OrderCurrencyUpdateRequest(); + request.setId(id); + request.setSecurityId(securityId); + request.setPrice(price); + request.setQuantityLot(quantityLot); + request.setSide(side); + request.setStatus(status); + request.setComment(comment); + return request; + } + + @ApiModelProperty(hidden = true) + @Override + public ActionType getActionType() { + return ActionType.UPDATE; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getSecurityId() { + return securityId; + } + + public void setSecurityId(Long securityId) { + this.securityId = securityId; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Long getQuantityLot() { + return quantityLot; + } + + public void setQuantityLot(Long quantityLot) { + this.quantityLot = quantityLot; + } + + public String getSide() { + return side; + } + + public void setSide(String side) { + this.side = side; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } +} diff --git a/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderOvernightTypeUpdateAction.java b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderOvernightTypeUpdateAction.java new file mode 100644 index 000000000..e6c785fdb --- /dev/null +++ b/clearing-parent/backend-api/src/main/java/ru/spcex/clearing/backendapi/controller/request/cud/order/OrderOvernightTypeUpdateAction.java @@ -0,0 +1,46 @@ +package ru.spcex.clearing.backendapi.controller.request.cud.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import ru.spcex.clearing.backendapi.domain.actions.IAction; +import ru.spcex.clearing.platform.messaging.domain.ActionType; +import ru.spcex.clearing.platform.messaging.domain.cud.order.OrderCurrencyUpdateRequest; + +public class OrderOvernightTypeUpdateAction implements IAction { + @ApiModelProperty(value = "Идентификатор записи", example = "12") + @JsonProperty + private Long id; + @ApiModelProperty(value = "Тип сделок переноса компании", example = "ASDF") + @JsonProperty + private String overnightType; + + @Override + public OrderCurrencyUpdateRequest toRequest() { + OrderCurrencyUpdateRequest request = new OrderCurrencyUpdateRequest(); + request.setId(id); + request.setOvernightType(overnightType); + return request; + } + + @ApiModelProperty(hidden = true) + @Override + public ActionType getActionType() { + return ActionType.UPDATE; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getOvernightType() { + return overnightType; + } + + public void setOvernightType(String overnightType) { + this.overnightType = overnightType; + } +} diff --git a/clearing-parent/backend-api/src/main/resources/meta/meta.xml b/clearing-parent/backend-api/src/main/resources/meta/meta.xml index 85e10f5a3..9a9b4ca24 100644 --- a/clearing-parent/backend-api/src/main/resources/meta/meta.xml +++ b/clearing-parent/backend-api/src/main/resources/meta/meta.xml @@ -349,6 +349,21 @@ + + + + + + + + + + + + + + + @@ -2659,6 +2674,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/Consts.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/Consts.java index f86a6a24b..1bc4997a4 100644 --- a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/Consts.java +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/Consts.java @@ -139,6 +139,14 @@ public interface Consts { String DESTINATION_VALIDATE_SYMBOLS_UPDATE = "validate-symbols-update"; String DESTINATION_VALIDATE_SYMBOLS_DELETE = "validate-symbols-delete"; + String OVERNIGHT_SETTINGS_NEW = "overnight-settings-new"; + String OVERNIGHT_SETTINGS_UPDATE = "overnight-settings-update"; + + String ORDER_CURRENCY_UPDATE = "order-currency-update"; + String ORDER_OVERNIGHT_TYPE_UPDATE = "order-overnight-type-update"; + String ORDER_CURRENCY_COMPANY_NEW = "order-currency-company-new"; + String ORDER_CURRENCY_COMPANY_UPDATE = "order-currency-company-update"; + String ORDER_CURRENCY_COMPANY_DELETE = "order-currency-company-delete"; String DESTINATION_SDF08_NEW = "s-df-08-new"; String DESTINATION_SDF02_NEW = "s-df-02-new"; diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/misc/OvernightSettingsNewRequest.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/misc/OvernightSettingsNewRequest.java new file mode 100644 index 000000000..defb8919a --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/misc/OvernightSettingsNewRequest.java @@ -0,0 +1,35 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.misc; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class OvernightSettingsNewRequest { + @JsonProperty + public Long companyId; + @JsonProperty + public String market; + @JsonProperty + public String overnightType; + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getMarket() { + return market; + } + + public void setMarket(String market) { + this.market = market; + } + + public String getOvernightType() { + return overnightType; + } + + public void setOvernightType(String overnightType) { + this.overnightType = overnightType; + } +} diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/misc/OvernightSettingsUpdateRequest.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/misc/OvernightSettingsUpdateRequest.java new file mode 100644 index 000000000..de468b79f --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/misc/OvernightSettingsUpdateRequest.java @@ -0,0 +1,46 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.misc; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class OvernightSettingsUpdateRequest { + @JsonProperty + public Long id; + @JsonProperty + public Long companyId; + @JsonProperty + public String market; + @JsonProperty + public String overnightType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getMarket() { + return market; + } + + public void setMarket(String market) { + this.market = market; + } + + public String getOvernightType() { + return overnightType; + } + + public void setOvernightType(String overnightType) { + this.overnightType = overnightType; + } +} diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCompanyNewRequest.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCompanyNewRequest.java new file mode 100644 index 000000000..e3339c4aa --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCompanyNewRequest.java @@ -0,0 +1,46 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.order; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class OrderCompanyNewRequest { + @JsonProperty + private Long id; + @JsonProperty + private Long companyId; + @JsonProperty + private Long tradingClearingRegistryId; + @JsonProperty + private Long quantityLot; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Long getTradingClearingRegistryId() { + return tradingClearingRegistryId; + } + + public void setTradingClearingRegistryId(Long tradingClearingRegistryId) { + this.tradingClearingRegistryId = tradingClearingRegistryId; + } + + public Long getQuantityLot() { + return quantityLot; + } + + public void setQuantityLot(Long quantityLot) { + this.quantityLot = quantityLot; + } +} diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCompanyUpdateRequest.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCompanyUpdateRequest.java new file mode 100644 index 000000000..40d4ca59a --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCompanyUpdateRequest.java @@ -0,0 +1,46 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.order; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class OrderCompanyUpdateRequest { + @JsonProperty + private Long id; + @JsonProperty + private Long companyId; + @JsonProperty + private Long tradingClearingRegistryId; + @JsonProperty + private Long quantityLot; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public Long getTradingClearingRegistryId() { + return tradingClearingRegistryId; + } + + public void setTradingClearingRegistryId(Long tradingClearingRegistryId) { + this.tradingClearingRegistryId = tradingClearingRegistryId; + } + + public Long getQuantityLot() { + return quantityLot; + } + + public void setQuantityLot(Long quantityLot) { + this.quantityLot = quantityLot; + } +} diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCurrencyUpdateRequest.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCurrencyUpdateRequest.java new file mode 100644 index 000000000..aa8ebf790 --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/order/OrderCurrencyUpdateRequest.java @@ -0,0 +1,87 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.order; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; + +public class OrderCurrencyUpdateRequest { + @JsonProperty + private Long id; + @JsonProperty + private Long securityId; + @JsonProperty + private BigDecimal price; + @JsonProperty + private Long quantityLot; + @JsonProperty + private String side; + @JsonProperty + private String status; + @JsonProperty + private String comment; + @JsonProperty + private String overnightType; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getSecurityId() { + return securityId; + } + + public void setSecurityId(Long securityId) { + this.securityId = securityId; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Long getQuantityLot() { + return quantityLot; + } + + public void setQuantityLot(Long quantityLot) { + this.quantityLot = quantityLot; + } + + public String getSide() { + return side; + } + + public void setSide(String side) { + this.side = side; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getOvernightType() { + return overnightType; + } + + public void setOvernightType(String overnightType) { + this.overnightType = overnightType; + } +}