Изменились MoneyMarketSecurityNewRequest, MoneyMarketSecurityServiceDisabled, MoneyMarketSecurityFactory, MoneyMarketSecurityNewAction, MoneyMarketSecurityUpdateAction, MoneyMarketSecurityUpdateRequest в этих классах изменил Long nominalCurrencyId на String nominalCurrency (в мета нет nominalCurrencyId но есть nominalCurrency ) сюда не стал добавлять termType т.к. его нет в мета post и put.
MoneyMarketSecurityBackendGetFields, MoneyMarketSecurity, MoneyMarketSecurityBackendGetAllOld, MoneyMarketSecurityMapStore поменял Long на String nominalCurrency и добавил termType
This commit is contained in:
parent
8e191870b2
commit
53b0487e1f
11 changed files with 80 additions and 68 deletions
|
|
@ -32,7 +32,7 @@ public class MoneyMarketSecurityNewAction implements IAction<MoneyMarketSecurity
|
|||
public Double nominalValue;
|
||||
@ApiModelProperty(value = "Идентификатор валюты номинала", example = "1000")
|
||||
@JsonProperty
|
||||
public Long nominalCurrencyId;
|
||||
public String nominalCurrency;
|
||||
@ApiModelProperty(value = "Идентификатор типа инструмента", example = "ABCD")
|
||||
@JsonProperty
|
||||
public String instrumentType;
|
||||
|
|
@ -59,7 +59,7 @@ public class MoneyMarketSecurityNewAction implements IAction<MoneyMarketSecurity
|
|||
req.setStartDate(this.getStartDate());
|
||||
req.setEndDate(this.getEndDate());
|
||||
req.setNominalValue(this.getNominalValue());
|
||||
req.setNominalCurrencyId(this.getNominalCurrencyId());
|
||||
req.setNominalCurrency(this.getNominalCurrency());
|
||||
req.setInstrumentType(this.getInstrumentType());
|
||||
req.setFullName(this.getFullName());
|
||||
req.setSecuritySymbol(this.getSecuritySymbol());
|
||||
|
|
@ -97,12 +97,12 @@ public class MoneyMarketSecurityNewAction implements IAction<MoneyMarketSecurity
|
|||
this.nominalValue = nominalValue;
|
||||
}
|
||||
|
||||
public Long getNominalCurrencyId() {
|
||||
return nominalCurrencyId;
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
|
||||
public void setNominalCurrencyId(Long nominalCurrencyId) {
|
||||
this.nominalCurrencyId = nominalCurrencyId;
|
||||
public void setNominalCurrency(String nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
}
|
||||
|
||||
public String getInstrumentType() {
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ public class MoneyMarketSecurityUpdateAction implements IAction<MoneyMarketSecur
|
|||
@ApiModelProperty(value = "Номинал", example = "20.5")
|
||||
@JsonProperty
|
||||
public Double nominalValue;
|
||||
@ApiModelProperty(value = "Идентификатор валюты номинала", example = "1000")
|
||||
@ApiModelProperty(value = "Валюта номинала", example = "RUB")
|
||||
@JsonProperty
|
||||
public Long nominalCurrencyId;
|
||||
public String nominalCurrency;
|
||||
@ApiModelProperty(value = "Идентификатор типа инструмента", example = "ABCD")
|
||||
@JsonProperty
|
||||
public String instrumentType;
|
||||
|
|
@ -43,7 +43,7 @@ public class MoneyMarketSecurityUpdateAction implements IAction<MoneyMarketSecur
|
|||
req.setId(this.getId());
|
||||
req.setEndDate(this.getEndDate());
|
||||
req.setNominalValue(this.getNominalValue());
|
||||
req.setNominalCurrencyId(this.getNominalCurrencyId());
|
||||
req.setNominalCurrency(this.getNominalCurrency());
|
||||
req.setInstrumentType(this.getInstrumentType());
|
||||
req.setFullName(this.getFullName());
|
||||
req.setLotSize(this.getLotSize());
|
||||
|
|
@ -73,12 +73,12 @@ public class MoneyMarketSecurityUpdateAction implements IAction<MoneyMarketSecur
|
|||
this.nominalValue = nominalValue;
|
||||
}
|
||||
|
||||
public Long getNominalCurrencyId() {
|
||||
return nominalCurrencyId;
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
|
||||
public void setNominalCurrencyId(Long nominalCurrencyId) {
|
||||
this.nominalCurrencyId = nominalCurrencyId;
|
||||
public void setNominalCurrency(String nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
}
|
||||
|
||||
public String getInstrumentType() {
|
||||
|
|
|
|||
|
|
@ -18,18 +18,6 @@ public class MoneyMarketSecurityBackendGetAllOld extends BasicSpcexResponse {
|
|||
@ApiModelProperty(value = "Полезная нагрузка")
|
||||
private MoneyMarketSecurityBackendPayload payload = new MoneyMarketSecurityBackendPayload();
|
||||
|
||||
private static class MoneyMarketSecurityBackendPayload {
|
||||
private List<MoneyMarketSecurityBackendGetFields> items = new ArrayList<>();
|
||||
|
||||
public List<MoneyMarketSecurityBackendGetFields> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<MoneyMarketSecurityBackendGetFields> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
public MoneyMarketSecurityBackendPayload getPayload() {
|
||||
return payload;
|
||||
}
|
||||
|
|
@ -52,8 +40,21 @@ public class MoneyMarketSecurityBackendGetAllOld extends BasicSpcexResponse {
|
|||
singleItem.setInstrumentType(moneyMarketSecurity.getInstrumentType());
|
||||
singleItem.setFullName(moneyMarketSecurity.getFullName());
|
||||
singleItem.setSecuritySymbol(moneyMarketSecurity.getSecuritySymbol());
|
||||
singleItem.setTermType(moneyMarketSecurity.getTermType());
|
||||
payload.getItems().add(singleItem);
|
||||
}
|
||||
}
|
||||
|
||||
private static class MoneyMarketSecurityBackendPayload {
|
||||
private List<MoneyMarketSecurityBackendGetFields> items = new ArrayList<>();
|
||||
|
||||
public List<MoneyMarketSecurityBackendGetFields> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<MoneyMarketSecurityBackendGetFields> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -23,13 +23,15 @@ public class MoneyMarketSecurityBackendGetFields {
|
|||
@JsonProperty
|
||||
private BigDecimal nominalValue;
|
||||
@JsonProperty
|
||||
private Long nominalCurrency; // (linked to currencyCode)
|
||||
private String nominalCurrency; // (linked to currencyCode)
|
||||
@JsonProperty
|
||||
private String instrumentType; // (linked to instrumentType)
|
||||
@JsonProperty
|
||||
private String fullName;
|
||||
@JsonProperty
|
||||
private String securitySymbol;
|
||||
@JsonProperty
|
||||
private String termType;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
|
|
@ -79,11 +81,11 @@ public class MoneyMarketSecurityBackendGetFields {
|
|||
this.nominalValue = nominalValue;
|
||||
}
|
||||
|
||||
public Long getNominalCurrency() {
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
|
||||
public void setNominalCurrency(Long nominalCurrency) {
|
||||
public void setNominalCurrency(String nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
}
|
||||
|
||||
|
|
@ -110,4 +112,12 @@ public class MoneyMarketSecurityBackendGetFields {
|
|||
public void setSecuritySymbol(String securitySymbol) {
|
||||
this.securitySymbol = securitySymbol;
|
||||
}
|
||||
|
||||
public String getTermType() {
|
||||
return termType;
|
||||
}
|
||||
|
||||
public void setTermType(String termType) {
|
||||
this.termType = termType;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ public class MoneyMarketSecurity extends Security {
|
|||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
private BigDecimal nominalValue;
|
||||
private Long nominalCurrency; // (linked to currencyCode)
|
||||
private String nominalCurrency; // (linked to currencyCode)
|
||||
private String termType;
|
||||
|
||||
public Long getSecurityId() {
|
||||
return securityId;
|
||||
|
|
@ -58,11 +59,19 @@ public class MoneyMarketSecurity extends Security {
|
|||
this.nominalValue = nominalValue;
|
||||
}
|
||||
|
||||
public Long getNominalCurrency() {
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
|
||||
public void setNominalCurrency(Long nominalCurrency) {
|
||||
public void setNominalCurrency(String nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
}
|
||||
|
||||
public String getTermType() {
|
||||
return termType;
|
||||
}
|
||||
|
||||
public void setTermType(String termType) {
|
||||
this.termType = termType;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@ import java.util.Map;
|
|||
@Component
|
||||
public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSecurity> {
|
||||
|
||||
private final String insertToSecurityStatement = makeInsertSql("SECURITY",
|
||||
getFieldsSecurity(), "id");
|
||||
|
||||
public MoneyMarketSecurityMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
private final String insertToSecurityStatement = makeInsertSql("SECURITY",
|
||||
getFieldsSecurity(), "id");
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "MONEY_MARKET_SECURITY";
|
||||
|
|
@ -41,7 +41,7 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
|
|||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "SECURITY_ID", "DESCRIPTION", "START_DATE", "END_DATE", "NOMINAL_VALUE", "NOMINAL_CURRENCY"};
|
||||
return new String[]{"ID", "SECURITY_ID", "DESCRIPTION", "START_DATE", "END_DATE", "NOMINAL_VALUE", "NOMINAL_CURRENCY, TERM_TYPE"};
|
||||
}
|
||||
|
||||
public String[] getFieldsSecurity() {
|
||||
|
|
@ -70,7 +70,8 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
|
|||
object.setStartDate(getLocalDateFromSqlDate(resultSet, "START_DATE"));
|
||||
object.setEndDate(getLocalDateFromSqlDate(resultSet, "END_DATE"));
|
||||
object.setNominalValue(resultSet.getObject("NOMINAL_VALUE", BigDecimal.class));
|
||||
object.setNominalCurrency(resultSet.getObject("NOMINAL_CURRENCY", Long.class));
|
||||
object.setNominalCurrency(resultSet.getObject("NOMINAL_CURRENCY", String.class));
|
||||
object.setTermType(resultSet.getObject("TERM_TYPE", String.class));
|
||||
fillBySecurity(object, object.getSecurityId());
|
||||
return object;
|
||||
}
|
||||
|
|
@ -100,6 +101,7 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
|
|||
TimeUtil.toDateFromLocalDate(moneyMarketSecurity.getEndDate()),
|
||||
moneyMarketSecurity.getNominalValue(),
|
||||
moneyMarketSecurity.getNominalCurrency(),
|
||||
moneyMarketSecurity.getTermType()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class MoneyMarketSecurityService extends QueueConsumer implements Initial
|
|||
mms.setStartDate(req.getStartDate());
|
||||
mms.setEndDate(req.getEndDate());
|
||||
mms.setNominalValue(req.getNominalValue() != null ? BigDecimal.valueOf(req.getNominalValue()) : null);
|
||||
mms.setNominalCurrency(req.getNominalCurrencyId());
|
||||
mms.setNominalCurrency(req.getNominalCurrency());
|
||||
mms.setInstrumentType(req.getInstrumentType());
|
||||
mms.setFullName(req.getFullName());
|
||||
mms.setSecuritySymbol(req.getSecuritySymbol());
|
||||
|
|
@ -114,7 +114,7 @@ public class MoneyMarketSecurityService extends QueueConsumer implements Initial
|
|||
mms.setUpdated(Instant.now());
|
||||
mms.setEndDate(req.getEndDate());
|
||||
mms.setNominalValue(req.getNominalValue() != null ? BigDecimal.valueOf(req.getNominalValue()) : null);
|
||||
mms.setNominalCurrency(req.getNominalCurrencyId());
|
||||
mms.setNominalCurrency(req.getNominalCurrency());
|
||||
mms.setInstrumentType(req.getInstrumentType());
|
||||
mms.setFullName(req.getFullName());
|
||||
moneyMarketSecurityMap.update(mms);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.time.LocalDate;
|
|||
|
||||
|
||||
class MoneyMarketSecurityFactory {
|
||||
private String nominalCurrency = "RUB"; // (linked to currencyCode)
|
||||
private Long id = 0L;
|
||||
private Long securityId = 0L;// (linked to security)
|
||||
private String description = "tsetse";
|
||||
|
|
@ -17,12 +18,8 @@ class MoneyMarketSecurityFactory {
|
|||
private LocalDate startDate = LocalDate.ofEpochDay(0);
|
||||
private LocalDate endDate = LocalDate.ofEpochDay(0);
|
||||
private BigDecimal nominalValue = BigDecimal.valueOf(1.0);
|
||||
|
||||
private Long nominalCurrency = 1L; // (linked to currencyCode)
|
||||
private String instrumentType = "sdgaga"; // (linked to instrumentType)
|
||||
private String fullName = "estat";
|
||||
|
||||
private Long nominalCurrencyId = 1L;
|
||||
private String securitySymbol = "sdfafd";
|
||||
|
||||
public MoneyMarketSecurityFactory setLotSize(Double lotSize) {
|
||||
|
|
@ -30,8 +27,7 @@ class MoneyMarketSecurityFactory {
|
|||
return this;
|
||||
}
|
||||
|
||||
public MoneyMarketSecurityFactory setNominalCurrencyId(Long nominalCurrencyId) {
|
||||
this.nominalCurrencyId = nominalCurrencyId;
|
||||
public MoneyMarketSecurityFactory setNominalCurrency(String nominalCurrencyId) {
|
||||
this.nominalCurrency = nominalCurrencyId;
|
||||
return this;
|
||||
}
|
||||
|
|
@ -66,12 +62,6 @@ class MoneyMarketSecurityFactory {
|
|||
return this;
|
||||
}
|
||||
|
||||
public MoneyMarketSecurityFactory setNominalCurrency(Long nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
this.nominalCurrencyId = nominalCurrency;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MoneyMarketSecurityFactory setInstrumentType(String instrumentType) {
|
||||
this.instrumentType = instrumentType;
|
||||
return this;
|
||||
|
|
@ -111,7 +101,7 @@ class MoneyMarketSecurityFactory {
|
|||
moneyMarketSecurityUpdateRequest.setId(id);
|
||||
moneyMarketSecurityUpdateRequest.setEndDate(endDate);
|
||||
moneyMarketSecurityUpdateRequest.setNominalValue(nominalValue.doubleValue());
|
||||
moneyMarketSecurityUpdateRequest.setNominalCurrencyId(nominalCurrencyId);
|
||||
moneyMarketSecurityUpdateRequest.setNominalCurrency(nominalCurrency);
|
||||
moneyMarketSecurityUpdateRequest.setInstrumentType(instrumentType);
|
||||
moneyMarketSecurityUpdateRequest.setFullName(fullName);
|
||||
|
||||
|
|
@ -131,7 +121,7 @@ class MoneyMarketSecurityFactory {
|
|||
keyRequest.setStartDate(startDate);
|
||||
keyRequest.setEndDate(endDate);
|
||||
keyRequest.setNominalValue(nominalValue.doubleValue());
|
||||
keyRequest.setNominalCurrencyId(nominalCurrencyId);
|
||||
keyRequest.setNominalCurrency(nominalCurrency);
|
||||
keyRequest.setInstrumentType(instrumentType);
|
||||
keyRequest.setFullName(fullName);
|
||||
keyRequest.setSecuritySymbol(securitySymbol);
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ public class MoneyMarketSecurityServiceDisabled {
|
|||
private final int TIMEOUT = 1000;
|
||||
boolean isUsed;
|
||||
private MockConsumer<String, Object> kafkaMockQueue;
|
||||
private MockProducer<String, Object> mockProducer = new MockProducer<>();
|
||||
// @Autowired
|
||||
private final MockProducer<String, Object> mockProducer = new MockProducer<>();
|
||||
// @Autowired
|
||||
// @Qualifier("hazelcastServiceTest")
|
||||
private HazelcastService hazelcastService;
|
||||
// @Autowired
|
||||
// @Autowired
|
||||
// @Qualifier("hazelcastInstance")
|
||||
private HazelcastInstance hz;
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ public class MoneyMarketSecurityServiceDisabled {
|
|||
* {@link MoneyMarketSecurityNewRequest#startDate} - текущее колличество секунд с 1970-01-01T00:00:00Z.<br>
|
||||
* {@link MoneyMarketSecurityNewRequest#endDate} - текущее колличество секунд с 1970-01-01T00:00:00Z.<br>
|
||||
* {@link MoneyMarketSecurityNewRequest#nominalValue} - 1.0<br>
|
||||
* {@link MoneyMarketSecurityNewRequest#nominalCurrencyId} - 1L<br>
|
||||
* {@link MoneyMarketSecurityNewRequest#nominalCurrency} - 1L<br>
|
||||
* {@link MoneyMarketSecurityNewRequest#instrumentType} - "sdgaga"<br>
|
||||
* {@link MoneyMarketSecurityNewRequest#fullName} - "estat"<br>
|
||||
*/
|
||||
|
|
@ -236,7 +236,7 @@ public class MoneyMarketSecurityServiceDisabled {
|
|||
* Входной запрос {@link MoneyMarketSecurityUpdateRequest}:<br>
|
||||
* {@link MoneyMarketSecurityUpdateRequest#fullName} - sfgsdfg<br>
|
||||
* {@link MoneyMarketSecurityUpdateRequest#instrumentType} - qwerqwe<br>
|
||||
* {@link MoneyMarketSecurityUpdateRequest#nominalCurrencyId} - 2L<br>
|
||||
* {@link MoneyMarketSecurityUpdateRequest#nominalCurrency} - RUB<br>
|
||||
* {@link MoneyMarketSecurityUpdateRequest#nominalValue} - 2.0<br>
|
||||
* {@link MoneyMarketSecurityUpdateRequest#endDate} - текущее колличество секунд с 1970-01-01T00:00:00Z + (24 * 3600)<br>
|
||||
*/
|
||||
|
|
@ -260,7 +260,7 @@ public class MoneyMarketSecurityServiceDisabled {
|
|||
moneyMarketSecurityFactory
|
||||
.setFullName("sfgsdfg")
|
||||
.setInstrumentType("qwerqwe")
|
||||
.setNominalCurrencyId(2L)
|
||||
.setNominalCurrency("RUB")
|
||||
.setNominalValue(BigDecimal.valueOf(2.0))
|
||||
.setEndDate(LocalDate.ofEpochDay(24 * 3600));
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class MoneyMarketSecurityNewRequest {
|
|||
@JsonProperty
|
||||
public Double nominalValue;
|
||||
@JsonProperty
|
||||
public Long nominalCurrencyId;
|
||||
public String nominalCurrency;
|
||||
@JsonProperty
|
||||
public String instrumentType;
|
||||
@JsonProperty
|
||||
|
|
@ -54,12 +54,12 @@ public class MoneyMarketSecurityNewRequest {
|
|||
this.nominalValue = nominalValue;
|
||||
}
|
||||
|
||||
public Long getNominalCurrencyId() {
|
||||
return nominalCurrencyId;
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
|
||||
public void setNominalCurrencyId(Long nominalCurrencyId) {
|
||||
this.nominalCurrencyId = nominalCurrencyId;
|
||||
public void setNominalCurrency(String nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
}
|
||||
|
||||
public String getInstrumentType() {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class MoneyMarketSecurityUpdateRequest {
|
|||
@JsonProperty
|
||||
public Double nominalValue;
|
||||
@JsonProperty
|
||||
public Long nominalCurrencyId;
|
||||
public String nominalCurrency;
|
||||
@JsonProperty
|
||||
public String instrumentType;
|
||||
@JsonProperty
|
||||
|
|
@ -52,12 +52,12 @@ public class MoneyMarketSecurityUpdateRequest {
|
|||
this.nominalValue = nominalValue;
|
||||
}
|
||||
|
||||
public Long getNominalCurrencyId() {
|
||||
return nominalCurrencyId;
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
|
||||
public void setNominalCurrencyId(Long nominalCurrencyId) {
|
||||
this.nominalCurrencyId = nominalCurrencyId;
|
||||
public void setNominalCurrency(String nominalCurrency) {
|
||||
this.nominalCurrency = nominalCurrency;
|
||||
}
|
||||
|
||||
public String getInstrumentType() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue