Files
cannaiq/backend/add-curaleaf-docker.js
2025-11-28 19:45:44 -07:00

72 lines
3.1 KiB
JavaScript

const { Pool } = require('pg');
const pool = new Pool({
connectionString: 'postgresql://dutchie:dutchie_local_pass@localhost:54320/dutchie_menus'
});
const azStores = [
{ slug: 'curaleaf-az-48th-street-med', name: 'Curaleaf - 48th Street (Medical)', city: 'Phoenix' },
{ slug: 'curaleaf-az-83rd-dispensary-med', name: 'Curaleaf - 83rd Ave (Medical)', city: 'Phoenix' },
{ slug: 'curaleaf-az-bell-med', name: 'Curaleaf - Bell (Medical)', city: 'Phoenix' },
{ slug: 'curaleaf-az-camelback-med', name: 'Curaleaf - Camelback (Medical)', city: 'Phoenix' },
{ slug: 'curaleaf-az-central-med', name: 'Curaleaf - Central (Medical)', city: 'Phoenix' },
{ slug: 'curaleaf-az-gilbert-med', name: 'Curaleaf - Gilbert (Medical)', city: 'Gilbert' },
{ slug: 'curaleaf-az-glendale-east', name: 'Curaleaf - Glendale East', city: 'Glendale' },
{ slug: 'curaleaf-az-glendale-east-the-kind-relief-med', name: 'Curaleaf - Glendale East Kind Relief (Medical)', city: 'Glendale' },
{ slug: 'curaleaf-az-glendale-med', name: 'Curaleaf - Glendale (Medical)', city: 'Glendale' },
{ slug: 'curaleaf-az-midtown-med', name: 'Curaleaf - Midtown (Medical)', city: 'Phoenix' },
{ slug: 'curaleaf-az-peoria-med', name: 'Curaleaf - Peoria (Medical)', city: 'Peoria' },
{ slug: 'curaleaf-az-phoenix-med', name: 'Curaleaf - Phoenix Airport (Medical)', city: 'Phoenix' },
{ slug: 'curaleaf-az-queen-creek', name: 'Curaleaf - Queen Creek', city: 'Queen Creek' },
{ slug: 'curaleaf-az-queen-creek-whoa-qc-inc-med', name: 'Curaleaf - Queen Creek WHOA (Medical)', city: 'Queen Creek' },
{ slug: 'curaleaf-az-scottsdale-natural-remedy-patient-center-med', name: 'Curaleaf - Scottsdale Natural Remedy (Medical)', city: 'Scottsdale' },
{ slug: 'curaleaf-az-sedona-med', name: 'Curaleaf - Sedona (Medical)', city: 'Sedona' },
{ slug: 'curaleaf-az-tucson-med', name: 'Curaleaf - Tucson (Medical)', city: 'Tucson' },
{ slug: 'curaleaf-az-youngtown-med', name: 'Curaleaf - Youngtown (Medical)', city: 'Youngtown' }
];
async function addStores() {
const client = await pool.connect();
try {
for (const store of azStores) {
const dutchieUrl = `https://curaleaf.com/stores/${store.slug}`;
// Skip sandbox stores
if (store.slug.includes('sandbox')) continue;
const result = await client.query(`
INSERT INTO stores (
name,
slug,
dutchie_url,
active,
scrape_enabled,
logo_url
)
VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (slug) DO UPDATE
SET name = $1, dutchie_url = $3, logo_url = $6
RETURNING id, name
`, [
store.name,
store.slug,
dutchieUrl,
true,
true,
'https://curaleaf.com/favicon.ico' // Using favicon as logo for now
]);
console.log(`✅ Added: ${result.rows[0].name} (ID: ${result.rows[0].id})`);
}
console.log(`\n🎉 Successfully added ${azStores.length} Curaleaf Arizona stores!`);
} catch (error) {
console.error('❌ Error adding stores:', error);
} finally {
client.release();
pool.end();
}
}
addStores();