Created At: 2026-11-18T04:45:32Z Completed At: 2026-11-18T04:45:32Z Command exited with code 0. Command output: weekly: 10 * 24 * 60 * 60 * 1000, // 7 Days + 3 Days Extra Offer = 10 Days monthly: 40 * 24 * 60 * 60 * 1000, // 30 Days + 10 Days Extra Offer = 40 Days '2months': 60 * 24 * 60 * 60 * 1000, yearly: 365 * 24 * 60 * 60 * 1000, lifetime: 10 * 365 * 24 * 60 * 60 * 1000 }; let creditCalc = { baseCredits: 0, bonusCredits: 0, totalCredits: 0 }; if (planType !== 'credits' && planDurations[planType]) { // Apply Unlimited Plan with Offer Bonus Days const duration = planDurations[planType]; const days = Math.round(duration / (24 * 60 * 60 * 1000)); const durationLabel = `${days} Days (${planType.toUpperCase()} + Offer)`; const planExpiresAt = new Date(Date.now() + duration); planExpiryStr = planExpiresAt.toLocaleString('en-IN', { timeZone: 'Asia/Kolkata' }); isPlanApplied = true; if (!process.env.DATABASE_URL) { let db = {}; if (fs.existsSync('db.json')) { try { db = JSON.parse(fs.readFileSync('db.json', 'utf8')); } catch (e) { console.error("Error:", e); } } if (!db[payment.userId]) { db[payment.userId] = { name: 'User', credits: 0 }; } db[payment.userId].plan_type = 'unlimited'; db[payment.userId].plan_expires_at = planExpiresAt.toISOString(); db[payment.userId].plan_started_at = new Date().toISOString(); db[payment.userId].subscription_duration = durationLabel; db[payment.userId].subscription_payment_method = 'UPI (QR Code)'; db[payment.userId].subscription_amount = `₹${payment.expectedAmount}`; fs.writeFileSync('db.json', JSON.stringify(db, null, 2)); } else { await pool.query( `INSERT INTO users (telegram_id, name, credits, plan_type, plan_expires_at, plan_started_at, subscription_duration, subscription_payment_method, subscription_amount, created_at, updated_at) VALUES ($1, 'User', 0, 'unlimited', $2, NOW(), $3, 'UPI (QR Code)', $4, NOW(), NOW()) ON CONFLICT (telegram_id) DO UPDATE SET plan_type = 'unlimited', plan_expires_at = EXCLUDED.plan_expires_at, plan_started_at = NOW(), subscription_duration = EXCLUDED.subscription_duration, subscription_payment_method = 'UPI (QR Code)', subscription_amount = EXCLUDED.subscription_amount, updated_at = NOW()`, [payment.userId, planExpiresAt, durationLabel, `₹${payment.expectedAmount}`] ); await pool.query( `INSERT INTO user_subscriptions (telegram_id, plan_name, duration, days, amount, payment_method, order_id, started_at, expires_at, status)