Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
// fraud.processor.ts @Processor('fraud-check') export class FraudProcessor { @Process('CHECK_FRAUD') async checkFraud(job: Job<{ paymentId: string }>): Promise<void> { const payment = await prisma.payment.findUnique({ where: { id: job.data.paymentId }, include: { rentCharge: true, tenant: true }, }); // Check 1: Duplicate reference number if (payment.reference) { const duplicate = await prisma.payment.findFirst({ where: { reference: payment.reference, id: { not: payment.id }, organisationId: payment.organisationId, }, }); if (duplicate) { await createFraudFlag({ organisationId: payment.organisationId, paymentId: payment.id, flagType: FraudFlagType.DUPLICATE_REFERENCE, severity: FraudSeverity.TIER1, description: `Reference ${payment.reference} was also submitted on ${duplicate.createdAt}`, evidence: { duplicatePaymentId: duplicate.id }, }); return; } } // Check 2: Evidence similarity (if external payment evidence was attached) if (payment.aiEvidenceSummary) { await this.checkEvidenceSimilarity(payment); } // Check 3: Network-level velocity anomalies await this.checkVelocityAnomalies(payment); } }
Was this page helpful?