All files / src/modules/quick-rent/workers collect-payment.processor.ts

100% Statements 11/11
75% Branches 3/4
100% Functions 2/2
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2112x   12x 12x           12x 1x 1x   1x   1x          
import { Processor, WorkerHost } from '@nestjs/bullmq';
import { Job } from 'bullmq';
import { Injectable, Logger } from '@nestjs/common';
import { PrismaService } from '@app/modules/prisma/prisma.service';
 
interface PayPayload { requestId: number }
 
@Processor('quick-rent:collect-payment')
@Injectable()
export class QuickRentCollectPaymentProcessor extends WorkerHost {
  private readonly logger = new Logger(QuickRentCollectPaymentProcessor.name);
  constructor(private readonly prisma: PrismaService) { super(); }
  async process(job: Job<PayPayload>): Promise<void> {
    const { requestId } = job.data;
    // Placeholder: create Payment row for winner; integration wired later
    this.logger.log(`Collecting payment for quick-rent request ${requestId}`);
  }
}