FamilyState
Represents the state of an order family (entry + TP + SL). PENDING - Entry order not yet filled ACTIVE - Entry filled, TP and SL are working CLOSED - All orders have reached terminal state
FamilyState.java
package com.bookmap.ordermanagement.model;
/**
* Represents the state of an order family (entry + TP + SL).
*
* PENDING - Entry order not yet filled
* ACTIVE - Entry filled, TP and SL are working
* CLOSED - All orders have reached terminal state
*/
public enum FamilyState {
PENDING("PENDING"),
ACTIVE("ACTIVE"),
CLOSED("CLOSED");
private final String label;
FamilyState(String label) {
this.label = label;
}
/**
* Returns true if the family is still active (position open).
*/
public boolean isActive() {
return this == PENDING || this == ACTIVE;
}
/**
* Returns true if the family is closed (position flat).
*/
public boolean isClosed() {
return this == CLOSED;
}
@Override
public String toString() {
return label;
}
}