feat(api): include dba_name in AZ stores API response

Add dba_name to DISPENSARY_COLUMNS for the /api/az/stores list endpoint
and getDispensaryById for the single store endpoint. This allows the
frontend to display DBA names (trade names) when available, falling
back to the legal entity name.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Kelly
2025-12-03 20:41:29 -07:00
parent bd65674f3a
commit 98f8e5e28d
2 changed files with 3 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ import { crawlDispensaryProducts } from '../services/product-crawler';
// Explicit column list for dispensaries table (avoids SELECT * issues with schema differences)
const DISPENSARY_COLUMNS = `
id, name, slug, city, state, zip, address, latitude, longitude,
id, name, dba_name, slug, city, state, zip, address, latitude, longitude,
menu_type, menu_url, platform_dispensary_id, website,
provider_detection_data, created_at, updated_at
`;

View File

@@ -342,6 +342,7 @@ export function mapDbRowToDispensary(row: any): Dispensary {
id: row.id,
platform: row.platform || 'dutchie', // keep platform as-is, default to 'dutchie'
name: row.name,
dbaName: row.dbaName || row.dba_name,
slug: row.slug,
city: row.city,
state: row.state,
@@ -376,6 +377,7 @@ export async function getDispensaryById(id: number): Promise<Dispensary | null>
SELECT
id,
name,
dba_name AS "dbaName",
slug,
city,
state,