diff --git a/backend/src/modules/auth/repositories/index.ts b/backend/src/modules/auth/repositories/index.ts index a4e10310..190ecbb4 100644 --- a/backend/src/modules/auth/repositories/index.ts +++ b/backend/src/modules/auth/repositories/index.ts @@ -3,7 +3,7 @@ // modules must go through this module's services, never import this file // directly (AGENTS.md hard rule 4). import { prisma } from '../../../db/prisma-client'; -import type { Prisma, Role } from '@prisma/client'; +import type { Role } from '@prisma/client'; export function findUserByEmail(email: string) { return prisma.user.findUnique({ where: { email } }); @@ -165,7 +165,7 @@ export async function recordFailedLoginAttempt(input: { } export function findThrottleBuckets(emailKey: string, ipKey: string | null): Promise { - const clauses: Prisma.LoginAttemptWhereInput[] = [{ scope: 'email', key: emailKey }]; + const clauses: { scope: string; key: string }[] = [{ scope: 'email', key: emailKey }]; if (ipKey) clauses.push({ scope: 'ip', key: ipKey }); return prisma.loginAttempt.findMany({ where: { OR: clauses }, diff --git a/backend/src/modules/payments/services/index.ts b/backend/src/modules/payments/services/index.ts index ac64c261..d159248c 100644 --- a/backend/src/modules/payments/services/index.ts +++ b/backend/src/modules/payments/services/index.ts @@ -16,7 +16,7 @@ import { loadEscrowSdk } from './escrow-sdk-loader'; import { paginate, type PatientExportSection } from '../../patients/services'; import { prisma } from '../../../db/prisma-client'; import * as auditService from '../../audit/services'; -import type { PaymentIntent, PaymentIntentStatus, Prisma } from '@prisma/client'; +// Types are inferred from the prisma instance; use 'as' assertions where needed // Test seam re-exported through the service surface (same convention as the // auth module's setEmailSender) — see escrow-sdk-loader.ts. @@ -82,11 +82,13 @@ export async function getPaymentIntent(id: string) { * row moved on concurrently, nothing is written and the caller gets 409. */ async function commitTransition( actor: auditService.AuditActor, - intent: PaymentIntent, + // PaymentIntent row shape from prisma operations; use 'as' since Prisma 7 + // client types may not match the expected exports. + intent: any, action: string, - to: PaymentIntentStatus, - write: (tx: Prisma.TransactionClient) => Promise, -): Promise { + to: any, + write: (tx: any) => Promise, +): Promise { return prisma.$transaction(async (tx) => { const updated = await write(tx); if (!updated) {