Changes include: - Updated architecture documentation - Enhanced module definitions (OQI-001 to OQI-008) - ML integration documentation updates - Trading strategies documentation - Orchestration and inventory updates - Docker configuration updates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.2 KiB
2.2 KiB
| id | title | type | status | priority | epic | project | version | created_date | updated_date |
|---|---|---|---|---|---|---|---|---|---|
| ET-PFM-005 | Historial y Reportes | Technical Specification | Done | Alta | OQI-008 | trading-platform | 1.0.0 | 2025-12-05 | 2026-01-04 |
ET-PFM-005: Historial y Reportes
Épica: OQI-008 - Portfolio Manager Versión: 1.0 Fecha: 2025-12-05 Estado: Planificado
Modelo de Datos de Transacción
@Entity('transactions')
export class Transaction {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ name: 'user_id' })
userId: string;
@Column({
type: 'enum',
enum: ['BUY', 'SELL', 'DEPOSIT', 'WITHDRAWAL', 'DIVIDEND', 'FEE'],
})
type: TransactionType;
@Column({ nullable: true })
symbol: string;
@Column('decimal', { precision: 18, scale: 8, nullable: true })
quantity: number;
@Column('decimal', { precision: 18, scale: 2 })
price: number;
@Column('decimal', { precision: 18, scale: 2 })
total: number;
@Column('decimal', { precision: 18, scale: 2, default: 0 })
fees: number;
@Column('decimal', { precision: 18, scale: 2, nullable: true, name: 'realized_pnl' })
realizedPnl: number;
@Column({ name: 'executed_at' })
executedAt: Date;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
}
API Endpoints
| Method | Endpoint | Descripción |
|---|---|---|
| GET | /api/transactions |
Lista de transacciones |
| GET | /api/transactions/:id |
Detalle de transacción |
| GET | /api/transactions/stats |
Estadísticas de trading |
| GET | /api/transactions/export |
Exportar CSV/PDF |
Estadísticas de Trading
interface TradingStats {
totalTrades: number;
winningTrades: number;
losingTrades: number;
winRate: number;
totalPnL: number;
avgPnLPerTrade: number;
bestTrade: {
symbol: string;
pnl: number;
date: string;
};
worstTrade: {
symbol: string;
pnl: number;
date: string;
};
pnlBySymbol: Record<string, number>;
pnlByMonth: Record<string, number>;
}
Referencias
Especificación técnica - Sistema NEXUS