Files
meet-hub/test-manual-trigger.js
dwindown 17440cdf89 Fix consulting order processing and display
- Fix consulting history to show continuous time range (09:00 - 11:00) instead of listing individual slots
- Add foreign key relationships for consulting_slots (order_id and user_id)
- Fix handle-order-paid to query profiles(email, name) instead of full_name
- Add completed consulting sessions with recordings to Member Access page
- Add user_id foreign key constraint to consulting_slots table
- Add orders foreign key constraint for consulting_slots relationship

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 01:17:47 +07:00

38 lines
1.0 KiB
JavaScript

// Test script to manually trigger handle-order-paid for existing consulting orders
// Run with: node test-manual-trigger.js <order_id>
const orderId = process.argv[2];
if (!orderId) {
console.error('Usage: node test-manual-trigger.js <order_id>');
process.exit(1);
}
const SUPABASE_URL = process.env.SUPABASE_URL || 'https://lovable.backoffice.biz.id';
const SUPABASE_ANON_KEY = process.env.SUPABASE_ANON_KEY || 'your-anon-key';
async function triggerManual() {
try {
const response = await fetch(`${SUPABASE_URL}/functions/v1/handle-order-paid`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${SUPABASE_ANON_KEY}`,
},
body: JSON.stringify({
order_id: orderId,
user_id: 'test',
total_amount: 0,
}),
});
const result = await response.json();
console.log('Response:', result);
console.log('Status:', response.status);
} catch (error) {
console.error('Error:', error);
}
}
triggerManual();