266 lines
8.6 KiB
TypeScript
266 lines
8.6 KiB
TypeScript
import { Prisma, SupportLevel } from '@prisma/client';
|
|
import type { CreateLocationInput, UpdateLocationInput, ListLocationsInput, BulkImportInput } from './locations.schemas';
|
|
interface ImportFilters {
|
|
cutPolygon?: number[][][];
|
|
bounds?: {
|
|
north: number;
|
|
south: number;
|
|
east: number;
|
|
west: number;
|
|
};
|
|
city?: string;
|
|
province?: string;
|
|
}
|
|
export declare const locationsService: {
|
|
findAll(filters: ListLocationsInput): Promise<{
|
|
locations: ({
|
|
addresses: {
|
|
id: string;
|
|
unitNumber: string | null;
|
|
firstName: string | null;
|
|
lastName: string | null;
|
|
supportLevel: import(".prisma/client").$Enums.SupportLevel | null;
|
|
sign: boolean;
|
|
}[];
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
latitude: Prisma.Decimal;
|
|
longitude: Prisma.Decimal;
|
|
address: string;
|
|
createdByUserId: string | null;
|
|
postalCode: string | null;
|
|
province: string | null;
|
|
federalDistrict: string | null;
|
|
buildingUse: number | null;
|
|
locGuid: string | null;
|
|
buildingType: import(".prisma/client").$Enums.BuildingType;
|
|
totalUnits: number;
|
|
buildingNotes: string | null;
|
|
geocodeConfidence: number | null;
|
|
geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null;
|
|
updatedByUserId: string | null;
|
|
})[];
|
|
pagination: {
|
|
page: number;
|
|
limit: number;
|
|
total: number;
|
|
totalPages: number;
|
|
};
|
|
}>;
|
|
findById(id: string): Promise<{
|
|
addresses: {
|
|
id: string;
|
|
email: string | null;
|
|
phone: string | null;
|
|
unitNumber: string | null;
|
|
firstName: string | null;
|
|
lastName: string | null;
|
|
supportLevel: import(".prisma/client").$Enums.SupportLevel | null;
|
|
sign: boolean;
|
|
signSize: string | null;
|
|
notes: string | null;
|
|
}[];
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
latitude: Prisma.Decimal;
|
|
longitude: Prisma.Decimal;
|
|
address: string;
|
|
createdByUserId: string | null;
|
|
postalCode: string | null;
|
|
province: string | null;
|
|
federalDistrict: string | null;
|
|
buildingUse: number | null;
|
|
locGuid: string | null;
|
|
buildingType: import(".prisma/client").$Enums.BuildingType;
|
|
totalUnits: number;
|
|
buildingNotes: string | null;
|
|
geocodeConfidence: number | null;
|
|
geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null;
|
|
updatedByUserId: string | null;
|
|
}>;
|
|
create(data: CreateLocationInput, userId: string): Promise<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
latitude: Prisma.Decimal;
|
|
longitude: Prisma.Decimal;
|
|
address: string;
|
|
createdByUserId: string | null;
|
|
postalCode: string | null;
|
|
province: string | null;
|
|
federalDistrict: string | null;
|
|
buildingUse: number | null;
|
|
locGuid: string | null;
|
|
buildingType: import(".prisma/client").$Enums.BuildingType;
|
|
totalUnits: number;
|
|
buildingNotes: string | null;
|
|
geocodeConfidence: number | null;
|
|
geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null;
|
|
updatedByUserId: string | null;
|
|
}>;
|
|
update(id: string, data: UpdateLocationInput, userId: string): Promise<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
latitude: Prisma.Decimal;
|
|
longitude: Prisma.Decimal;
|
|
address: string;
|
|
createdByUserId: string | null;
|
|
postalCode: string | null;
|
|
province: string | null;
|
|
federalDistrict: string | null;
|
|
buildingUse: number | null;
|
|
locGuid: string | null;
|
|
buildingType: import(".prisma/client").$Enums.BuildingType;
|
|
totalUnits: number;
|
|
buildingNotes: string | null;
|
|
geocodeConfidence: number | null;
|
|
geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null;
|
|
updatedByUserId: string | null;
|
|
}>;
|
|
delete(id: string): Promise<void>;
|
|
bulkDelete(ids: string[]): Promise<{
|
|
deleted: number;
|
|
}>;
|
|
getHistory(locationId: string, page?: number, limit?: number): Promise<{
|
|
history: ({
|
|
user: {
|
|
id: string;
|
|
email: string;
|
|
name: string | null;
|
|
role: import(".prisma/client").$Enums.UserRole;
|
|
} | null;
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
userId: string | null;
|
|
action: import(".prisma/client").$Enums.LocationHistoryAction;
|
|
locationId: string;
|
|
field: string | null;
|
|
oldValue: string | null;
|
|
newValue: string | null;
|
|
metadata: Prisma.JsonValue | null;
|
|
})[];
|
|
pagination: {
|
|
page: number;
|
|
limit: number;
|
|
total: number;
|
|
totalPages: number;
|
|
};
|
|
}>;
|
|
geocodeAddress(address: string): Promise<import("../geocoding/geocoding.service").GeocodeResult>;
|
|
geocodeMissing(): Promise<{
|
|
total: number;
|
|
geocoded: number;
|
|
failed: number;
|
|
}>;
|
|
getStats(): Promise<{
|
|
total: number;
|
|
buildingTypes: {
|
|
SINGLE_FAMILY: number;
|
|
MULTI_UNIT: number;
|
|
MIXED_USE: number;
|
|
COMMERCIAL: number;
|
|
};
|
|
geocoded: number;
|
|
ungeocoded: number;
|
|
confidence: {
|
|
high: number;
|
|
medium: number;
|
|
low: number;
|
|
none: number;
|
|
average: number | null;
|
|
};
|
|
providers: {
|
|
nominatim: number;
|
|
mapbox: number;
|
|
arcgis: number;
|
|
photon: number;
|
|
google: number;
|
|
locationiq: number;
|
|
manual: number;
|
|
};
|
|
}>;
|
|
getAllForMap(bounds?: {
|
|
minLat: number;
|
|
maxLat: number;
|
|
minLng: number;
|
|
maxLng: number;
|
|
}, limit?: number): Promise<({
|
|
addresses: {
|
|
id: string;
|
|
email: string | null;
|
|
phone: string | null;
|
|
unitNumber: string | null;
|
|
firstName: string | null;
|
|
lastName: string | null;
|
|
supportLevel: import(".prisma/client").$Enums.SupportLevel | null;
|
|
sign: boolean;
|
|
signSize: string | null;
|
|
notes: string | null;
|
|
}[];
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
latitude: Prisma.Decimal;
|
|
longitude: Prisma.Decimal;
|
|
address: string;
|
|
createdByUserId: string | null;
|
|
postalCode: string | null;
|
|
province: string | null;
|
|
federalDistrict: string | null;
|
|
buildingUse: number | null;
|
|
locGuid: string | null;
|
|
buildingType: import(".prisma/client").$Enums.BuildingType;
|
|
totalUnits: number;
|
|
buildingNotes: string | null;
|
|
geocodeConfidence: number | null;
|
|
geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null;
|
|
updatedByUserId: string | null;
|
|
})[]>;
|
|
getPublicLocations(bounds?: {
|
|
minLat: number;
|
|
maxLat: number;
|
|
minLng: number;
|
|
maxLng: number;
|
|
}): Promise<{
|
|
id: string;
|
|
latitude: Prisma.Decimal;
|
|
longitude: Prisma.Decimal;
|
|
address: string;
|
|
addresses: {
|
|
id: string;
|
|
unitNumber: string | null;
|
|
supportLevel: import(".prisma/client").$Enums.SupportLevel | null;
|
|
sign: boolean;
|
|
signSize: string | null;
|
|
}[];
|
|
}[]>;
|
|
importFromCsv(buffer: Buffer, userId: string): Promise<{
|
|
total: number;
|
|
success: number;
|
|
warnings: number;
|
|
failed: number;
|
|
errors: string[];
|
|
}>;
|
|
reverseGeocode(latitude: number, longitude: number): Promise<import("../geocoding/geocoding.service").ReverseGeocodeResult>;
|
|
importBulk(buffer: Buffer, userId: string, options: BulkImportInput, filters?: ImportFilters): Promise<{
|
|
total: number;
|
|
created: number;
|
|
skippedDuplicate: number;
|
|
skippedOutOfBounds: number;
|
|
skippedInvalid: number;
|
|
errors: string[];
|
|
}>;
|
|
exportToCsv(filters?: {
|
|
supportLevel?: SupportLevel;
|
|
hasSign?: boolean;
|
|
}): Promise<string>;
|
|
};
|
|
export {};
|
|
//# sourceMappingURL=locations.service.d.ts.map
|