Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV-34879: Add OrderActionIssuer field #27

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright 2022 Nord Pool.
* This library is intended to aid integration with Nord Pool’s Intraday API and comes without any warranty. Users of this library are responsible for separately testing and ensuring that it works according to their own standards.
* Please send feedback to [email protected].
*/


package com.nordpool.id.publicapi.v1.order;

import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

public enum OrderActionIssuer {

USER("USER"),
SYSTEM("SYSTEM");
private final String value;
private final static Map<String, OrderActionIssuer> CONSTANTS = new HashMap<String, OrderActionIssuer>();

static {
for (OrderActionIssuer c: values()) {
CONSTANTS.put(c.value, c);
}
}

private OrderActionIssuer(String value) {
this.value = value;
}

@Override
public String toString() {
return this.value;
}

@JsonValue
public String value() {
return this.value;
}

@JsonCreator
public static OrderActionIssuer fromValue(String value) {
OrderActionIssuer constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public class OrderExecutionEntry {
*
*/
private OrderAction action;
private OrderActionIssuer actionIssuer;
private Long clipSize;
private Long clipPriceChange;
private Long remainingQuantity;
Expand Down Expand Up @@ -125,6 +126,7 @@ public OrderExecutionEntry() {
* @param executionRestriction
* @param originalOrderId
* @param action
* @param actionIssuer
* @param revisionNo
* @param text
* @param state
Expand All @@ -146,7 +148,7 @@ public OrderExecutionEntry() {
* @param previousOrderId
* @param errors
*/
public OrderExecutionEntry(Long eventSequenceNo, String marketId, String tenantId, String userId, String orderId, Long revisionNo, String previousOrderId, String originalOrderId, ZonedDateTime createdAt, ZonedDateTime updatedAt, String clientOrderId, UUID linkedBasketId, String portfolioId, List<String> contractIds, Long deliveryAreaId, OrderSide side, OrderType orderType, Long unitPrice, Long quantity, TimeInForce timeInForce, ZonedDateTime expireTime, String text, OrderState state, OrderAction action, Long clipSize, Long clipPriceChange, Long remainingQuantity, List<Error> errors, ExecutionRestriction executionRestriction) {
public OrderExecutionEntry(Long eventSequenceNo, String marketId, String tenantId, String userId, String orderId, Long revisionNo, String previousOrderId, String originalOrderId, ZonedDateTime createdAt, ZonedDateTime updatedAt, String clientOrderId, UUID linkedBasketId, String portfolioId, List<String> contractIds, Long deliveryAreaId, OrderSide side, OrderType orderType, Long unitPrice, Long quantity, TimeInForce timeInForce, ZonedDateTime expireTime, String text, OrderState state, OrderAction action, OrderActionIssuer actionIssuer, Long clipSize, Long clipPriceChange, Long remainingQuantity, List<Error> errors, ExecutionRestriction executionRestriction) {
super();
this.eventSequenceNo = eventSequenceNo;
this.marketId = marketId;
Expand Down Expand Up @@ -579,6 +581,19 @@ public OrderExecutionEntry withAction(OrderAction action) {
return this;
}

public OrderActionIssuer getActionIssuer() {
return actionIssuer;
}

public void setActionIssuer(OrderActionIssuer actionIssuer) {
this.actionIssuer = actionIssuer;
}

public OrderActionIssuer withActionIssuer(OrderActionIssuer actionIssuer) {
this.actionIssuer = actionIssuer;
return actionIssuer;
}

public Long getClipSize() {
return clipSize;
}
Expand Down Expand Up @@ -654,12 +669,12 @@ public OrderExecutionEntry withExecutionRestriction(ExecutionRestriction executi

@Override
public String toString() {
return new ToStringBuilder(this).append("eventSequenceNo", eventSequenceNo).append("marketId", marketId).append("tenantId", tenantId).append("userId", userId).append("orderId", orderId).append("revisionNo", revisionNo).append("previousOrderId", previousOrderId).append("originalOrderId", originalOrderId).append("createdAt", createdAt).append("updatedAt", updatedAt).append("clientOrderId", clientOrderId).append("portfolioId", portfolioId).append("contractIds", contractIds).append("deliveryAreaId", deliveryAreaId).append("side", side).append("orderType", orderType).append("unitPrice", unitPrice).append("quantity", quantity).append("timeInForce", timeInForce).append("expireTime", expireTime).append("text", text).append("state", state).append("action", action).append("clipSize", clipSize).append("clipPriceChange", clipPriceChange).append("remainingQuantity", remainingQuantity).append("errors", errors).append("executionRestriction", executionRestriction).toString();
return new ToStringBuilder(this).append("eventSequenceNo", eventSequenceNo).append("marketId", marketId).append("tenantId", tenantId).append("userId", userId).append("orderId", orderId).append("revisionNo", revisionNo).append("previousOrderId", previousOrderId).append("originalOrderId", originalOrderId).append("createdAt", createdAt).append("updatedAt", updatedAt).append("clientOrderId", clientOrderId).append("portfolioId", portfolioId).append("contractIds", contractIds).append("deliveryAreaId", deliveryAreaId).append("side", side).append("orderType", orderType).append("unitPrice", unitPrice).append("quantity", quantity).append("timeInForce", timeInForce).append("expireTime", expireTime).append("text", text).append("state", state).append("action", action).append("actionIssuer", actionIssuer).append("clipSize", clipSize).append("clipPriceChange", clipPriceChange).append("remainingQuantity", remainingQuantity).append("errors", errors).append("executionRestriction", executionRestriction).toString();
}

@Override
public int hashCode() {
return new HashCodeBuilder().append(remainingQuantity).append(orderType).append(clipSize).append(orderId).append(marketId).append(createdAt).append(executionRestriction).append(originalOrderId).append(action).append(revisionNo).append(text).append(state).append(timeInForce).append(updatedAt).append(unitPrice).append(side).append(quantity).append(clientOrderId).append(contractIds).append(eventSequenceNo).append(userId).append(clipPriceChange).append(portfolioId).append(expireTime).append(tenantId).append(deliveryAreaId).append(previousOrderId).append(errors).toHashCode();
return new HashCodeBuilder().append(remainingQuantity).append(orderType).append(clipSize).append(orderId).append(marketId).append(createdAt).append(executionRestriction).append(originalOrderId).append(action).append(actionIssuer).append(revisionNo).append(text).append(state).append(timeInForce).append(updatedAt).append(unitPrice).append(side).append(quantity).append(clientOrderId).append(contractIds).append(eventSequenceNo).append(userId).append(clipPriceChange).append(portfolioId).append(expireTime).append(tenantId).append(deliveryAreaId).append(previousOrderId).append(errors).toHashCode();
}

@Override
Expand All @@ -671,7 +686,7 @@ public boolean equals(Object other) {
return false;
}
OrderExecutionEntry rhs = ((OrderExecutionEntry) other);
return new EqualsBuilder().append(remainingQuantity, rhs.remainingQuantity).append(orderType, rhs.orderType).append(clipSize, rhs.clipSize).append(orderId, rhs.orderId).append(marketId, rhs.marketId).append(createdAt, rhs.createdAt).append(executionRestriction, rhs.executionRestriction).append(originalOrderId, rhs.originalOrderId).append(action, rhs.action).append(revisionNo, rhs.revisionNo).append(text, rhs.text).append(state, rhs.state).append(timeInForce, rhs.timeInForce).append(updatedAt, rhs.updatedAt).append(unitPrice, rhs.unitPrice).append(side, rhs.side).append(quantity, rhs.quantity).append(clientOrderId, rhs.clientOrderId).append(contractIds, rhs.contractIds).append(eventSequenceNo, rhs.eventSequenceNo).append(userId, rhs.userId).append(clipPriceChange, rhs.clipPriceChange).append(portfolioId, rhs.portfolioId).append(expireTime, rhs.expireTime).append(tenantId, rhs.tenantId).append(deliveryAreaId, rhs.deliveryAreaId).append(previousOrderId, rhs.previousOrderId).append(errors, rhs.errors).isEquals();
return new EqualsBuilder().append(remainingQuantity, rhs.remainingQuantity).append(orderType, rhs.orderType).append(clipSize, rhs.clipSize).append(orderId, rhs.orderId).append(marketId, rhs.marketId).append(createdAt, rhs.createdAt).append(executionRestriction, rhs.executionRestriction).append(originalOrderId, rhs.originalOrderId).append(action, rhs.action).append(actionIssuer, rhs.actionIssuer).append(revisionNo, rhs.revisionNo).append(text, rhs.text).append(state, rhs.state).append(timeInForce, rhs.timeInForce).append(updatedAt, rhs.updatedAt).append(unitPrice, rhs.unitPrice).append(side, rhs.side).append(quantity, rhs.quantity).append(clientOrderId, rhs.clientOrderId).append(contractIds, rhs.contractIds).append(eventSequenceNo, rhs.eventSequenceNo).append(userId, rhs.userId).append(clipPriceChange, rhs.clipPriceChange).append(portfolioId, rhs.portfolioId).append(expireTime, rhs.expireTime).append(tenantId, rhs.tenantId).append(deliveryAreaId, rhs.deliveryAreaId).append(previousOrderId, rhs.previousOrderId).append(errors, rhs.errors).isEquals();
}

}
Loading