cc00a439bf
Add a dedicated Deep Research view with postal-area preview overlays, batch execution, and bundled map results. Also add postal dataset import tooling and fix local API networking and research insert issues needed to support the new workflow.
109 lines
2.4 KiB
TypeScript
109 lines
2.4 KiB
TypeScript
export type JobStatus = 'pending' | 'running' | 'completed' | 'failed' | 'stopped';
|
|
|
|
export interface AppUser {
|
|
id: string;
|
|
email: string;
|
|
displayName: string;
|
|
avatarUrl?: string | null;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface SessionUser extends AppUser {
|
|
sessionId: string;
|
|
}
|
|
|
|
export interface GeoJsonGeometry {
|
|
type: 'Polygon' | 'MultiPolygon';
|
|
coordinates: unknown;
|
|
}
|
|
|
|
export interface GeoJsonFeature<TProperties = Record<string, unknown>> {
|
|
type: 'Feature';
|
|
geometry: GeoJsonGeometry;
|
|
properties: TProperties;
|
|
}
|
|
|
|
export interface GeoJsonFeatureCollection<TProperties = Record<string, unknown>> {
|
|
type: 'FeatureCollection';
|
|
features: Array<GeoJsonFeature<TProperties>>;
|
|
}
|
|
|
|
export interface PostalAreaPreview {
|
|
id: string;
|
|
countryCode: string;
|
|
postalCode: string;
|
|
normalizedPostalCode: string;
|
|
displayName: string;
|
|
propagationRing: number;
|
|
centroidLat: number | null;
|
|
centroidLng: number | null;
|
|
}
|
|
|
|
export interface DeepResearchOverlayProperties {
|
|
postalAreaId: string;
|
|
countryCode: string;
|
|
postalCode: string;
|
|
displayName: string;
|
|
propagationRing: number;
|
|
}
|
|
|
|
export interface DeepResearchPreviewRequest {
|
|
lat: number;
|
|
lng: number;
|
|
propagation: number;
|
|
businessType: string;
|
|
keywords?: string;
|
|
}
|
|
|
|
export interface DeepResearchPreview {
|
|
baseArea: PostalAreaPreview;
|
|
areas: PostalAreaPreview[];
|
|
overlay: GeoJsonFeatureCollection<DeepResearchOverlayProperties>;
|
|
propagation: number;
|
|
countryCode: string;
|
|
totalAreas: number;
|
|
estimatedChildJobs: number;
|
|
businessType: string;
|
|
keywords?: string;
|
|
}
|
|
|
|
export interface DeepResearchChildJobSummary {
|
|
id: string;
|
|
name: string;
|
|
postalCode?: string;
|
|
status: JobStatus;
|
|
totalResults: number;
|
|
createdAt: string;
|
|
completedAt?: string;
|
|
}
|
|
|
|
export interface DeepResearchBatchSummary {
|
|
id: string;
|
|
userId: string;
|
|
pinLat: number;
|
|
pinLng: number;
|
|
basePostalCode?: string;
|
|
countryCode?: string;
|
|
propagation: number;
|
|
businessType: string;
|
|
keywords?: string;
|
|
status: JobStatus;
|
|
totalPostalAreas: number;
|
|
totalResults: number;
|
|
childJobCount: number;
|
|
completedJobCount: number;
|
|
failedJobCount: number;
|
|
startedAt?: string;
|
|
completedAt?: string;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface DeepResearchBatchDetail extends DeepResearchBatchSummary {
|
|
childJobs: DeepResearchChildJobSummary[];
|
|
jobIds: string[];
|
|
}
|
|
|
|
export interface CreateDeepResearchBatchRequest extends DeepResearchPreviewRequest {}
|