30 lines
949 B
TypeScript
30 lines
949 B
TypeScript
import { DomainEvent } from './domain-event.base';
|
|
|
|
export interface WithdrawalRequestedPayload {
|
|
orderNo: string; // 提现订单号
|
|
accountSequence: string; // 跨服务关联标识
|
|
userId: string;
|
|
walletId: string;
|
|
amount: string; // 提现金额
|
|
fee: string; // 手续费
|
|
netAmount: string; // 实际到账金额 (amount - fee)
|
|
assetType: string; // 资产类型 (USDT)
|
|
chainType: string; // 目标链 (BSC/KAVA)
|
|
toAddress: string; // 提现目标地址
|
|
}
|
|
|
|
export class WithdrawalRequestedEvent extends DomainEvent {
|
|
static readonly EVENT_NAME = 'wallet.withdrawal.requested';
|
|
|
|
constructor(private readonly payload: WithdrawalRequestedPayload) {
|
|
super({
|
|
aggregateId: payload.orderNo,
|
|
aggregateType: 'WithdrawalOrder',
|
|
});
|
|
}
|
|
|
|
getPayload(): WithdrawalRequestedPayload {
|
|
return this.payload;
|
|
}
|
|
}
|