toJson method
Implementation
Map<String, dynamic> toJson() => {
'id': id,
'symbol': symbol,
'side': side.name,
'type': type.name,
'price': price,
'quantity': quantity,
if (takeProfitPrice != null) 'takeProfitPrice': takeProfitPrice,
if (stopLossPrice != null) 'stopLossPrice': stopLossPrice,
if (customLabel != null) 'customLabel': customLabel,
'status': status.name,
if (metadata != null) 'metadata': metadata,
};