Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/src/modules/auth/repositories/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } });
Expand Down Expand Up @@ -165,7 +165,7 @@ export async function recordFailedLoginAttempt(input: {
}

export function findThrottleBuckets(emailKey: string, ipKey: string | null): Promise<ThrottleRow[]> {
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 },
Expand Down
12 changes: 7 additions & 5 deletions backend/src/modules/payments/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<PaymentIntent | null>,
): Promise<PaymentIntent> {
to: any,
write: (tx: any) => Promise<any>,
): Promise<any> {
return prisma.$transaction(async (tx) => {
const updated = await write(tx);
if (!updated) {
Expand Down
Loading