feat: Add street address to locations

Adds a street_address column to the locations table and updates the LocationSearch component to capture, store, and display full street addresses. This includes database migration, interface updates, and formatter logic.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-06 13:51:40 +00:00
parent c1683f9b02
commit 98fbc94476
5 changed files with 128 additions and 9 deletions

View File

@@ -57,11 +57,13 @@ export interface LocationInfoSettings {
* Location data structure
*/
export interface LocationData {
street_address?: string;
country?: string;
state_province?: string;
city?: string;
latitude?: number;
longitude?: number;
postal_code?: string;
}
/**
@@ -71,10 +73,12 @@ export function isLocationData(data: unknown): data is LocationData {
if (typeof data !== 'object' || data === null) return false;
const loc = data as Record<string, unknown>;
return (
(loc.street_address === undefined || typeof loc.street_address === 'string') &&
(loc.country === undefined || typeof loc.country === 'string') &&
(loc.state_province === undefined || typeof loc.state_province === 'string') &&
(loc.city === undefined || typeof loc.city === 'string') &&
(loc.latitude === undefined || typeof loc.latitude === 'number') &&
(loc.longitude === undefined || typeof loc.longitude === 'number')
(loc.longitude === undefined || typeof loc.longitude === 'number') &&
(loc.postal_code === undefined || typeof loc.postal_code === 'string')
);
}