chore: add documentation comments and stylecop rules

This commit is contained in:
2025-12-04 11:25:01 +08:00
parent 17d143a351
commit 8e4c2b0e45
142 changed files with 1309 additions and 439 deletions

View File

@@ -16,11 +16,13 @@ public sealed class CreateTenantBillingCommandHandler(ITenantBillingRepository b
{
public async Task<TenantBillingDto> Handle(CreateTenantBillingCommand request, CancellationToken cancellationToken)
{
// 1. 校验账单编号
if (string.IsNullOrWhiteSpace(request.StatementNo))
{
throw new BusinessException(ErrorCodes.BadRequest, "账单编号不能为空");
}
// 2. 构建账单实体
var bill = new TenantBillingStatement
{
TenantId = request.TenantId,
@@ -34,9 +36,11 @@ public sealed class CreateTenantBillingCommandHandler(ITenantBillingRepository b
LineItemsJson = request.LineItemsJson
};
// 3. 持久化账单
await billingRepository.AddAsync(bill, cancellationToken);
await billingRepository.SaveChangesAsync(cancellationToken);
// 4. 返回 DTO
return bill.ToDto();
}
}