129 lines
4.4 KiB
TypeScript
129 lines
4.4 KiB
TypeScript
import type { SubmitResponseInput, ListPublicResponsesInput, ListAdminResponsesInput, UpdateResponseStatusInput } from './responses.schemas';
|
|
export declare const responsesService: {
|
|
submitResponse(slug: string, data: SubmitResponseInput, senderIp?: string): Promise<{
|
|
id: string;
|
|
status: import(".prisma/client").$Enums.ResponseStatus;
|
|
verificationSent: boolean;
|
|
}>;
|
|
listApproved(slug: string, filters: ListPublicResponsesInput): Promise<{
|
|
responses: {
|
|
id: string;
|
|
createdAt: Date;
|
|
upvoteCount: number;
|
|
representativeName: string;
|
|
representativeTitle: string | null;
|
|
representativeLevel: import(".prisma/client").$Enums.GovernmentLevel;
|
|
responseType: import(".prisma/client").$Enums.ResponseType;
|
|
responseText: string;
|
|
userComment: string | null;
|
|
submittedByName: string | null;
|
|
isAnonymous: boolean;
|
|
isVerified: boolean;
|
|
verifiedAt: Date | null;
|
|
}[];
|
|
pagination: {
|
|
page: number;
|
|
limit: number;
|
|
total: number;
|
|
totalPages: number;
|
|
};
|
|
}>;
|
|
getStats(slug: string): Promise<{
|
|
total: number;
|
|
verified: number;
|
|
totalUpvotes: number;
|
|
byLevel: Record<string, number>;
|
|
}>;
|
|
upvote(responseId: string, userIp?: string, userId?: string): Promise<{
|
|
success: boolean;
|
|
alreadyUpvoted?: undefined;
|
|
} | {
|
|
success: boolean;
|
|
alreadyUpvoted: boolean;
|
|
}>;
|
|
removeUpvote(responseId: string, userIp?: string, userId?: string): Promise<{
|
|
success: boolean;
|
|
}>;
|
|
verify(responseId: string, token: string): Promise<{
|
|
success: boolean;
|
|
reason: string;
|
|
campaignTitle?: undefined;
|
|
} | {
|
|
success: boolean;
|
|
campaignTitle: string;
|
|
reason?: undefined;
|
|
}>;
|
|
report(responseId: string, token: string): Promise<{
|
|
success: boolean;
|
|
reason: string;
|
|
campaignTitle?: undefined;
|
|
} | {
|
|
success: boolean;
|
|
campaignTitle: string;
|
|
reason?: undefined;
|
|
}>;
|
|
findAll(filters: ListAdminResponsesInput): Promise<{
|
|
responses: {
|
|
status: import(".prisma/client").$Enums.ResponseStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
upvoteCount: number;
|
|
campaign: {
|
|
id: string;
|
|
title: string;
|
|
slug: string;
|
|
};
|
|
representativeName: string;
|
|
representativeTitle: string | null;
|
|
representativeLevel: import(".prisma/client").$Enums.GovernmentLevel;
|
|
representativeEmail: string | null;
|
|
responseType: import(".prisma/client").$Enums.ResponseType;
|
|
responseText: string;
|
|
userComment: string | null;
|
|
submittedByName: string | null;
|
|
submittedByEmail: string | null;
|
|
isAnonymous: boolean;
|
|
isVerified: boolean;
|
|
verifiedAt: Date | null;
|
|
verifiedBy: string | null;
|
|
}[];
|
|
pagination: {
|
|
page: number;
|
|
limit: number;
|
|
total: number;
|
|
totalPages: number;
|
|
};
|
|
}>;
|
|
updateStatus(id: string, data: UpdateResponseStatusInput): Promise<{
|
|
status: import(".prisma/client").$Enums.ResponseStatus;
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
upvoteCount: number;
|
|
submittedByUserId: string | null;
|
|
campaignId: string;
|
|
campaignSlug: string;
|
|
representativeName: string;
|
|
representativeTitle: string | null;
|
|
representativeLevel: import(".prisma/client").$Enums.GovernmentLevel;
|
|
representativeEmail: string | null;
|
|
responseType: import(".prisma/client").$Enums.ResponseType;
|
|
responseText: string;
|
|
userComment: string | null;
|
|
screenshotUrl: string | null;
|
|
submittedByName: string | null;
|
|
submittedByEmail: string | null;
|
|
isAnonymous: boolean;
|
|
isVerified: boolean;
|
|
verificationToken: string | null;
|
|
verificationSentAt: Date | null;
|
|
verifiedAt: Date | null;
|
|
verifiedBy: string | null;
|
|
submittedIp: string | null;
|
|
}>;
|
|
deleteResponse(id: string): Promise<void>;
|
|
resendVerification(id: string): Promise<{
|
|
success: boolean;
|
|
}>;
|
|
};
|
|
//# sourceMappingURL=responses.service.d.ts.map
|