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() {
|
async onModuleInit() {
|
||||||
const brokers = this.configService.get<string>('KAFKA_BROKERS')?.split(',') ||
|
const brokersEnv = this.configService.get<string>('KAFKA_BROKERS');
|
||||||
this.configService.get<string[]>('kafka.brokers') ||
|
const brokersConfig = this.configService.get<string[]>('kafka.brokers');
|
||||||
['localhost:9092'];
|
const brokers: string[] = brokersEnv?.split(',') || brokersConfig || ['localhost:9092'];
|
||||||
const clientId = this.configService.get<string>('kafka.clientId') || 'blockchain-service';
|
const clientId = this.configService.get<string>('kafka.clientId') || 'blockchain-service';
|
||||||
const groupId = 'blockchain-service-deposit-acks';
|
const groupId = 'blockchain-service-deposit-acks';
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ export class DepositAckConsumerService implements OnModuleInit, OnModuleDestroy
|
||||||
|
|
||||||
this.kafka = new Kafka({
|
this.kafka = new Kafka({
|
||||||
clientId,
|
clientId,
|
||||||
brokers: Array.isArray(brokers) ? brokers : brokers.split(','),
|
brokers,
|
||||||
logLevel: logLevel.WARN,
|
logLevel: logLevel.WARN,
|
||||||
retry: {
|
retry: {
|
||||||
initialRetryTime: 100,
|
initialRetryTime: 100,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
import { PrismaService } from '../prisma/prisma.service';
|
import { PrismaService } from '../prisma/prisma.service';
|
||||||
import {
|
import {
|
||||||
IOutboxEventRepository,
|
IOutboxEventRepository,
|
||||||
|
|
@ -19,7 +20,7 @@ export class OutboxEventRepositoryImpl implements IOutboxEventRepository {
|
||||||
eventType: data.eventType,
|
eventType: data.eventType,
|
||||||
aggregateId: data.aggregateId,
|
aggregateId: data.aggregateId,
|
||||||
aggregateType: data.aggregateType,
|
aggregateType: data.aggregateType,
|
||||||
payload: data.payload,
|
payload: data.payload as Prisma.InputJsonValue,
|
||||||
status: OutboxEventStatus.PENDING,
|
status: OutboxEventStatus.PENDING,
|
||||||
retryCount: 0,
|
retryCount: 0,
|
||||||
maxRetries: 10,
|
maxRetries: 10,
|
||||||
|
|
@ -34,7 +35,7 @@ export class OutboxEventRepositoryImpl implements IOutboxEventRepository {
|
||||||
eventType: d.eventType,
|
eventType: d.eventType,
|
||||||
aggregateId: d.aggregateId,
|
aggregateId: d.aggregateId,
|
||||||
aggregateType: d.aggregateType,
|
aggregateType: d.aggregateType,
|
||||||
payload: d.payload,
|
payload: d.payload as Prisma.InputJsonValue,
|
||||||
status: OutboxEventStatus.PENDING,
|
status: OutboxEventStatus.PENDING,
|
||||||
retryCount: 0,
|
retryCount: 0,
|
||||||
maxRetries: 10,
|
maxRetries: 10,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue