changemaker.lite/api/dist/modules/influence/representatives/representatives.service.d.ts

98 lines
3.0 KiB
TypeScript

import { Prisma } from '@prisma/client';
import type { ListRepresentativesInput } from './representatives.schemas';
export declare const representativesService: {
lookupByPostalCode(code: string, forceRefresh?: boolean): Promise<{
source: "cache";
postalCode: string;
location: {
city: string | null;
province: string | null;
};
representatives: {
id: string;
email: string | null;
name: string | null;
url: string | null;
postalCode: string;
districtName: string | null;
electedOffice: string | null;
partyName: string | null;
representativeSetName: string | null;
photoUrl: string | null;
offices: Prisma.JsonValue | null;
cachedAt: Date;
}[];
} | {
source: "api";
postalCode: string;
location: {
city: string | null;
province: string | null;
};
representatives: {
id: null;
postalCode: string;
name: string | null;
email: string | null;
districtName: string | null;
electedOffice: string | null;
partyName: string | null;
representativeSetName: string | null;
url: string | null;
photoUrl: string | null;
offices: import("./represent-api.client").RepresentOffice[];
cachedAt: string;
}[];
}>;
findAll(filters: ListRepresentativesInput): Promise<{
representatives: {
id: string;
email: string | null;
name: string | null;
url: string | null;
postalCode: string;
districtName: string | null;
electedOffice: string | null;
partyName: string | null;
representativeSetName: string | null;
photoUrl: string | null;
offices: Prisma.JsonValue | null;
cachedAt: Date;
}[];
pagination: {
page: number;
limit: number;
total: number;
totalPages: number;
};
}>;
findById(id: string): Promise<{
id: string;
email: string | null;
name: string | null;
url: string | null;
postalCode: string;
districtName: string | null;
electedOffice: string | null;
partyName: string | null;
representativeSetName: string | null;
photoUrl: string | null;
offices: Prisma.JsonValue | null;
cachedAt: Date;
}>;
clearByPostalCode(code: string): Promise<{
deleted: number;
postalCode: string;
}>;
deleteById(id: string): Promise<void>;
testApiConnection(): Promise<{
ok: boolean;
message: string;
}>;
getCacheStats(): Promise<{
totalRepresentatives: number;
postalCodesWithRepresentatives: number;
totalPostalCodes: number;
}>;
};
//# sourceMappingURL=representatives.service.d.ts.map