- Add backend stale process monitoring API (/api/stale-processes) - Add users management route - Add frontend landing page and stale process monitor UI on /scraper-tools - Move old development scripts to backend/archive/ - Update frontend build with new features 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
1016 B
TypeScript
33 lines
1016 B
TypeScript
import { pool } from './src/db/migrate.js';
|
|
|
|
async function main() {
|
|
const result = await pool.query(`
|
|
SELECT name, brand, regular_price, sale_price, in_stock, stock_status
|
|
FROM products
|
|
WHERE dispensary_id = 112
|
|
AND brand = 'Select'
|
|
ORDER BY name
|
|
LIMIT 10
|
|
`);
|
|
|
|
console.log('\n' + '='.repeat(100));
|
|
console.log('SELECT BRAND PRODUCTS WITH PRICES (NEW ONE-PASS APPROACH)');
|
|
console.log('='.repeat(100) + '\n');
|
|
|
|
result.rows.forEach((row, idx) => {
|
|
const regularPrice = row.regular_price ? `$${parseFloat(row.regular_price).toFixed(2)}` : 'N/A';
|
|
const salePrice = row.sale_price ? `$${parseFloat(row.sale_price).toFixed(2)}` : 'N/A';
|
|
const stock = row.in_stock ? (row.stock_status || 'In Stock') : 'Out of Stock';
|
|
|
|
console.log(`${idx + 1}. ${row.name}`);
|
|
console.log(` Price: ${regularPrice} | Sale: ${salePrice} | Stock: ${stock}`);
|
|
console.log('');
|
|
});
|
|
|
|
console.log('='.repeat(100) + '\n');
|
|
|
|
await pool.end();
|
|
}
|
|
|
|
main().catch(console.error);
|