diff --git a/src/routes/api/cospend/monthly-expenses/+server.ts b/src/routes/api/cospend/monthly-expenses/+server.ts index ae99705..cb955e8 100644 --- a/src/routes/api/cospend/monthly-expenses/+server.ts +++ b/src/routes/api/cospend/monthly-expenses/+server.ts @@ -77,7 +77,6 @@ export const GET: RequestHandler = async ({ url, locals }) => { ]; const results = await Payment.aggregate(pipeline); - console.log('Aggregation results:', results); // Transform data into chart-friendly format const monthsMap = new Map(); diff --git a/src/routes/api/cospend/recurring-payments/cron-execute/+server.ts b/src/routes/api/cospend/recurring-payments/cron-execute/+server.ts index 835b088..09e0a17 100644 --- a/src/routes/api/cospend/recurring-payments/cron-execute/+server.ts +++ b/src/routes/api/cospend/recurring-payments/cron-execute/+server.ts @@ -18,11 +18,10 @@ export const POST: RequestHandler = async ({ request }) => { } await dbConnect(); - + try { const now = new Date(); - console.log(`[Cron] Starting recurring payments processing at ${now.toISOString()}`); - + // Find all active recurring payments that are due const duePayments = await RecurringPayment.find({ isActive: true, @@ -34,16 +33,12 @@ export const POST: RequestHandler = async ({ request }) => { ] }); - console.log(`[Cron] Found ${duePayments.length} due recurring payments`); - const results = []; let successCount = 0; let failureCount = 0; for (const recurringPayment of duePayments) { try { - console.log(`[Cron] Processing recurring payment: ${recurringPayment.title} (${recurringPayment._id})`); - // Create the payment const payment = await Payment.create({ title: `${recurringPayment.title} (Auto)`, @@ -89,8 +84,6 @@ export const POST: RequestHandler = async ({ request }) => { success: true }); - console.log(`[Cron] Successfully processed: ${recurringPayment.title}, next execution: ${nextExecutionDate.toISOString()}`); - } catch (paymentError) { console.error(`[Cron] Error processing recurring payment ${recurringPayment._id}:`, paymentError); failureCount++; @@ -104,8 +97,6 @@ export const POST: RequestHandler = async ({ request }) => { } } - console.log(`[Cron] Completed processing. Success: ${successCount}, Failures: ${failureCount}`); - return json({ success: true, timestamp: now.toISOString(), diff --git a/src/routes/api/cospend/recurring-payments/scheduler/+server.ts b/src/routes/api/cospend/recurring-payments/scheduler/+server.ts index 1b2cec2..5bd7b3b 100644 --- a/src/routes/api/cospend/recurring-payments/scheduler/+server.ts +++ b/src/routes/api/cospend/recurring-payments/scheduler/+server.ts @@ -33,7 +33,6 @@ export const POST: RequestHandler = async ({ request, locals }) => { switch (action) { case 'execute': - console.log(`[API] Manual execution requested by ${auth.user.nickname}`); await recurringPaymentScheduler.executeNow(); return json({ success: true,