diff --git a/backend/services/admin-service/src/infrastructure/persistence/mappers/co-managed-wallet.mapper.ts b/backend/services/admin-service/src/infrastructure/persistence/mappers/co-managed-wallet.mapper.ts index 370aa5bb..4c794bb3 100644 --- a/backend/services/admin-service/src/infrastructure/persistence/mappers/co-managed-wallet.mapper.ts +++ b/backend/services/admin-service/src/infrastructure/persistence/mappers/co-managed-wallet.mapper.ts @@ -1,4 +1,9 @@ import { Injectable } from '@nestjs/common'; +import { + CoManagedWalletSession as PrismaSession, + CoManagedWallet as PrismaWallet, + WalletSessionStatus as PrismaWalletSessionStatus, +} from '@prisma/client'; import { CoManagedWalletSessionEntity, CoManagedWalletEntity, @@ -11,39 +16,14 @@ import { } from '../../../domain/enums/wallet-session-status.enum'; /** - * Prisma 会话模型类型 (需要在 schema.prisma 中定义) + * Prisma 会话模型类型 - 使用 Prisma 生成的类型 */ -export interface PrismaCoManagedWalletSession { - id: string; - walletName: string; - thresholdT: number; - thresholdN: number; - inviteCode: string; - status: string; - participants: string; // JSON string - currentRound: number; - totalRounds: number; - publicKey: string | null; - error: string | null; - createdAt: Date; - updatedAt: Date; - createdBy: string; -} +export type PrismaCoManagedWalletSession = PrismaSession; /** - * Prisma 钱包模型类型 + * Prisma 钱包模型类型 - 使用 Prisma 生成的类型 */ -export interface PrismaCoManagedWallet { - id: string; - sessionId: string; - name: string; - publicKey: string; - thresholdT: number; - thresholdN: number; - participants: string; // JSON string - createdAt: Date; - createdBy: string; -} +export type PrismaCoManagedWallet = PrismaWallet; @Injectable() export class CoManagedWalletMapper { @@ -94,7 +74,7 @@ export class CoManagedWalletMapper { thresholdT: domain.threshold.t, thresholdN: domain.threshold.n, inviteCode: domain.inviteCode, - status: domain.status, + status: domain.status as PrismaWalletSessionStatus, participants: JSON.stringify( domain.participants.map((p) => ({ partyId: p.partyId,