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:
parent
d844228711
commit
5ec310124d
|
|
@ -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 账户同步事件
|
||||
|
|
|
|||
Loading…
Reference in New Issue