fix(contribution): 确保 HEADQUARTERS 账户存在后再更新算力

修复 Record to update not found 错误,在调用 addContribution 前
先调用 ensureSystemAccountsExist 确保系统账户记录已创建。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-20 08:42:02 -08:00
parent d844228711
commit 5ec310124d
1 changed files with 2 additions and 0 deletions

View File

@ -285,6 +285,8 @@ export class ContributionCalculationService {
(sum, u) => sum.add(u.amount),
new ContributionAmount(0),
);
// 确保 HEADQUARTERS 账户存在
await this.systemAccountRepository.ensureSystemAccountsExist();
await this.systemAccountRepository.addContribution('HEADQUARTERS', totalUnallocatedAmount);
// 发布 HEADQUARTERS 账户同步事件