refactor(architecture): harden module boundaries
Some checks failed
ci / release-gate (push) Has been cancelled

This commit is contained in:
2026-08-04 12:10:36 +08:00
parent b38f12e60b
commit 33375a38d7
218 changed files with 5124 additions and 3828 deletions

View File

@@ -14,13 +14,13 @@ internal sealed partial class RefundAdministrationService
CancellationToken cancellationToken = default)
{
var provider = NormalizeProvider(command.Provider);
var refund = await dbContext.CommerceRefundRequests.SingleOrDefaultAsync(
var refund = await commercePersistence.CommerceRefundRequests.SingleOrDefaultAsync(
item => item.TenantId == tenantId && item.RefundNo == command.RefundNo,
cancellationToken) ?? throw new CommerceException("Refund request was not found.", "refund_not_found");
var eventId = string.IsNullOrWhiteSpace(command.EventId)
? $"{provider}:{command.RefundNo}:{command.Status}"
: command.EventId.Trim();
var duplicate = await dbContext.PaymentEvents.AnyAsync(
var duplicate = await commercePersistence.PaymentEvents.AnyAsync(
item => item.TenantId == tenantId &&
item.Provider == provider &&
item.EventType == "refund" &&
@@ -28,7 +28,7 @@ internal sealed partial class RefundAdministrationService
cancellationToken);
if (duplicate) return refund;
dbContext.PaymentEvents.Add(new PaymentEvent
commercePersistence.PaymentEvents.Add(new PaymentEvent
{
TenantId = tenantId,
Provider = provider,
@@ -55,7 +55,7 @@ internal sealed partial class RefundAdministrationService
refund.FailedAt = DateTimeOffset.UtcNow;
}
dbContext.CommerceRefundEvents.Add(new CommerceRefundEvent
commercePersistence.CommerceRefundEvents.Add(new CommerceRefundEvent
{
TenantId = tenantId,
RefundRequestId = refund.Id,
@@ -66,7 +66,7 @@ internal sealed partial class RefundAdministrationService
});
}
await dbContext.SaveChangesAsync(cancellationToken);
await unitOfWork.SaveChangesAsync(cancellationToken);
return refund;
}
}