feat: implement complete automation system with real trading connection

This commit is contained in:
mindesbunister
2025-07-18 20:02:45 +02:00
parent 74b0087f17
commit 892c2c845f
18 changed files with 1930 additions and 16 deletions

View File

@@ -0,0 +1,29 @@
import { NextResponse } from 'next/server'
import { automationService } from '@/lib/automation-service-simple'
export async function POST(request) {
try {
const config = await request.json()
// Add a default userId for now (in production, get from auth)
const automationConfig = {
userId: 'default-user',
...config
}
const success = await automationService.startAutomation(automationConfig)
if (success) {
return NextResponse.json({ success: true, message: 'Automation started successfully' })
} else {
return NextResponse.json({ success: false, error: 'Failed to start automation' }, { status: 500 })
}
} catch (error) {
console.error('Start automation error:', error)
return NextResponse.json({
success: false,
error: 'Internal server error',
message: error.message
}, { status: 500 })
}
}