fix(admin-service): 修复共管钱包 status 类型不匹配问题

使用 Prisma 生成的类型替代手动定义的接口:
- PrismaCoManagedWalletSession -> @prisma/client
- PrismaCoManagedWallet -> @prisma/client
- status 字段使用 PrismaWalletSessionStatus 枚举类型

🤖 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-28 00:02:18 -08:00
parent e51450d9f9
commit 1af5780b19
1 changed files with 10 additions and 30 deletions

View File

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