fix(blockchain): fix TypeScript compilation errors
- Fix brokers type narrowing issue in deposit-ack-consumer.service.ts - Add Prisma.InputJsonValue type cast for payload in outbox-event.repository.impl.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2bf5ca933e
commit
49fc68297b
|
|
@ -36,9 +36,9 @@ export class DepositAckConsumerService implements OnModuleInit, OnModuleDestroy
|
|||
) {}
|
||||
|
||||
async onModuleInit() {
|
||||
const brokers = this.configService.get<string>('KAFKA_BROKERS')?.split(',') ||
|
||||
this.configService.get<string[]>('kafka.brokers') ||
|
||||
['localhost:9092'];
|
||||
const brokersEnv = this.configService.get<string>('KAFKA_BROKERS');
|
||||
const brokersConfig = this.configService.get<string[]>('kafka.brokers');
|
||||
const brokers: string[] = brokersEnv?.split(',') || brokersConfig || ['localhost:9092'];
|
||||
const clientId = this.configService.get<string>('kafka.clientId') || 'blockchain-service';
|
||||
const groupId = 'blockchain-service-deposit-acks';
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ export class DepositAckConsumerService implements OnModuleInit, OnModuleDestroy
|
|||
|
||||
this.kafka = new Kafka({
|
||||
clientId,
|
||||
brokers: Array.isArray(brokers) ? brokers : brokers.split(','),
|
||||
brokers,
|
||||
logLevel: logLevel.WARN,
|
||||
retry: {
|
||||
initialRetryTime: 100,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
import {
|
||||
IOutboxEventRepository,
|
||||
|
|
@ -19,7 +20,7 @@ export class OutboxEventRepositoryImpl implements IOutboxEventRepository {
|
|||
eventType: data.eventType,
|
||||
aggregateId: data.aggregateId,
|
||||
aggregateType: data.aggregateType,
|
||||
payload: data.payload,
|
||||
payload: data.payload as Prisma.InputJsonValue,
|
||||
status: OutboxEventStatus.PENDING,
|
||||
retryCount: 0,
|
||||
maxRetries: 10,
|
||||
|
|
@ -34,7 +35,7 @@ export class OutboxEventRepositoryImpl implements IOutboxEventRepository {
|
|||
eventType: d.eventType,
|
||||
aggregateId: d.aggregateId,
|
||||
aggregateType: d.aggregateType,
|
||||
payload: d.payload,
|
||||
payload: d.payload as Prisma.InputJsonValue,
|
||||
status: OutboxEventStatus.PENDING,
|
||||
retryCount: 0,
|
||||
maxRetries: 10,
|
||||
|
|
|
|||
Loading…
Reference in New Issue