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:
hailin 2025-12-09 22:11:28 -08:00
parent 2bf5ca933e
commit 49fc68297b
2 changed files with 7 additions and 6 deletions

View File

@ -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,

View File

@ -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,