fix(contribution-service): fix property mapping in toDto method

The toDto method was accessing non-existent properties on ContributionAccountAggregate:
- teamLevelContribution -> totalLevelPending
- teamBonusContribution -> totalBonusPending
- totalContribution -> effectiveContribution
- isCalculated -> true (always calculated when account exists)
- lastCalculatedAt -> updatedAt

This was causing "Cannot read properties of undefined (reading 'value')" error
on GET /api/v2/contribution/accounts/{accountSequence}

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-12 12:17:31 -08:00
parent 5c76c9f62c
commit 1b3704b68d
1 changed files with 5 additions and 5 deletions

View File

@ -169,15 +169,15 @@ export class GetContributionAccountQuery {
message: '账户正常',
accountSequence: account.accountSequence,
personalContribution: account.personalContribution.value.toString(),
teamLevelContribution: account.teamLevelContribution.value.toString(),
teamBonusContribution: account.teamBonusContribution.value.toString(),
totalContribution: account.totalContribution.value.toString(),
teamLevelContribution: account.totalLevelPending.value.toString(),
teamBonusContribution: account.totalBonusPending.value.toString(),
totalContribution: account.effectiveContribution.value.toString(),
hasAdopted: account.hasAdopted,
directReferralAdoptedCount: account.directReferralAdoptedCount,
unlockedLevelDepth: account.unlockedLevelDepth,
unlockedBonusTiers: account.unlockedBonusTiers,
isCalculated: account.isCalculated,
lastCalculatedAt: account.lastCalculatedAt,
isCalculated: true,
lastCalculatedAt: account.updatedAt,
};
}