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:
parent
e51450d9f9
commit
1af5780b19
|
|
@ -1,4 +1,9 @@
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
|
import {
|
||||||
|
CoManagedWalletSession as PrismaSession,
|
||||||
|
CoManagedWallet as PrismaWallet,
|
||||||
|
WalletSessionStatus as PrismaWalletSessionStatus,
|
||||||
|
} from '@prisma/client';
|
||||||
import {
|
import {
|
||||||
CoManagedWalletSessionEntity,
|
CoManagedWalletSessionEntity,
|
||||||
CoManagedWalletEntity,
|
CoManagedWalletEntity,
|
||||||
|
|
@ -11,39 +16,14 @@ import {
|
||||||
} from '../../../domain/enums/wallet-session-status.enum';
|
} from '../../../domain/enums/wallet-session-status.enum';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prisma 会话模型类型 (需要在 schema.prisma 中定义)
|
* Prisma 会话模型类型 - 使用 Prisma 生成的类型
|
||||||
*/
|
*/
|
||||||
export interface PrismaCoManagedWalletSession {
|
export type PrismaCoManagedWalletSession = PrismaSession;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prisma 钱包模型类型
|
* Prisma 钱包模型类型 - 使用 Prisma 生成的类型
|
||||||
*/
|
*/
|
||||||
export interface PrismaCoManagedWallet {
|
export type PrismaCoManagedWallet = PrismaWallet;
|
||||||
id: string;
|
|
||||||
sessionId: string;
|
|
||||||
name: string;
|
|
||||||
publicKey: string;
|
|
||||||
thresholdT: number;
|
|
||||||
thresholdN: number;
|
|
||||||
participants: string; // JSON string
|
|
||||||
createdAt: Date;
|
|
||||||
createdBy: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CoManagedWalletMapper {
|
export class CoManagedWalletMapper {
|
||||||
|
|
@ -94,7 +74,7 @@ export class CoManagedWalletMapper {
|
||||||
thresholdT: domain.threshold.t,
|
thresholdT: domain.threshold.t,
|
||||||
thresholdN: domain.threshold.n,
|
thresholdN: domain.threshold.n,
|
||||||
inviteCode: domain.inviteCode,
|
inviteCode: domain.inviteCode,
|
||||||
status: domain.status,
|
status: domain.status as PrismaWalletSessionStatus,
|
||||||
participants: JSON.stringify(
|
participants: JSON.stringify(
|
||||||
domain.participants.map((p) => ({
|
domain.participants.map((p) => ({
|
||||||
partyId: p.partyId,
|
partyId: p.partyId,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue