fix: build errors

This commit is contained in:
Ephraim Atta-Duncan
2025-10-20 22:19:31 +00:00
parent a39b4efc28
commit 0aae25e423
2 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ import type {
export const getDocumentStats = async (filters: AnalyticsFilters): Promise<DocumentStats> => { export const getDocumentStats = async (filters: AnalyticsFilters): Promise<DocumentStats> => {
const { dateFrom, dateTo, ...entityFilter } = filters; const { dateFrom, dateTo, ...entityFilter } = filters;
const where: Prisma.DocumentWhereInput = { const where: Prisma.EnvelopeWhereInput = {
...entityFilter, ...entityFilter,
deletedAt: null, deletedAt: null,
...(dateFrom || dateTo ...(dateFrom || dateTo
@ -26,7 +26,7 @@ export const getDocumentStats = async (filters: AnalyticsFilters): Promise<Docum
: {}), : {}),
}; };
const counts = await prisma.document.groupBy({ const counts = await prisma.envelope.groupBy({
by: ['status'], by: ['status'],
where, where,
_count: { _count: {
@ -42,7 +42,7 @@ export const getDocumentStats = async (filters: AnalyticsFilters): Promise<Docum
[ExtendedDocumentStatus.ALL]: 0, [ExtendedDocumentStatus.ALL]: 0,
}; };
counts.forEach((stat) => { counts.forEach((stat: { status: DocumentStatus; _count: { _all: number } }) => {
stats[stat.status as DocumentStatus] = stat._count._all; stats[stat.status as DocumentStatus] = stat._count._all;
stats.ALL += stat._count._all; stats.ALL += stat._count._all;
}); });

View File

@ -13,7 +13,7 @@ export const getRecipientStats = async (filters: AnalyticsFilters): Promise<Reci
const { dateFrom, dateTo, ...entityFilter } = filters; const { dateFrom, dateTo, ...entityFilter } = filters;
const where: Prisma.RecipientWhereInput = { const where: Prisma.RecipientWhereInput = {
document: { envelope: {
...entityFilter, ...entityFilter,
deletedAt: null, deletedAt: null,
...(dateFrom || dateTo ...(dateFrom || dateTo