Files
Finlytic/FinlyticApp/lib/features/trades/models/trade_acceptance_dto.dart
T

75 lines
1.9 KiB
Dart

class TradeAcceptanceDto {
final String userId;
final String tradeId;
final String analysisId;
final String isin;
final String symbol;
final double? actualEntryPrice;
final double? positionSize;
final double? leverageUsed;
final double? entryFee;
final double? exitFee;
final double? quantity;
final double? knockoutThreshold;
final bool isRecurring;
final DateTime executionTimestamp;
final String? signalType;
final double? entryPrice;
final double? stopLoss;
final double? takeProfit;
final String? instrumentType;
final String? timeframe;
final String? reasoning;
TradeAcceptanceDto({
required this.userId,
required this.tradeId,
this.analysisId = '',
required this.isin,
required this.symbol,
this.actualEntryPrice,
this.positionSize,
this.leverageUsed,
this.entryFee,
this.exitFee,
this.quantity,
this.knockoutThreshold,
this.isRecurring = false,
required this.executionTimestamp,
this.signalType,
this.entryPrice,
this.stopLoss,
this.takeProfit,
this.instrumentType,
this.timeframe,
this.reasoning,
});
Map<String, dynamic> toJson() {
return {
'userId': userId.isNotEmpty ? userId : 'default_user',
'tradeId': tradeId,
'analysisId': analysisId,
'isin': isin,
'symbol': symbol,
'actualEntryPrice': actualEntryPrice,
'positionSize': positionSize,
'leverageUsed': leverageUsed,
'entryFee': entryFee,
'exitFee': exitFee,
'quantity': quantity,
'knockoutThreshold': knockoutThreshold,
'isRecurring': isRecurring,
'executionTimestamp': executionTimestamp.toIso8601String(),
'signalType': signalType,
'entryPrice': entryPrice,
'stopLoss': stopLoss,
'takeProfit': takeProfit,
'instrumentType': instrumentType,
'timeframe': timeframe,
'reasoning': reasoning,
};
}
}