This commit is contained in:
@@ -183,9 +183,9 @@ internal sealed class CommerceAdjustmentService(CommerceAdministrationDependenci
|
||||
.SumAsync(item => item.AmountCents, cancellationToken));
|
||||
}
|
||||
|
||||
public async Task<TenantCommerceAnomalySummary> GetAnomalySummaryAsync(
|
||||
CommerceAdminActor actor,
|
||||
CancellationToken cancellationToken = default)
|
||||
public async Task<TenantCommerceAnomalySummary> GetAnomalySummaryAsync(
|
||||
CommerceAdminActor actor,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
await AssertAdminAsync(actor, cancellationToken);
|
||||
var openRefunds = await dbContext.CommerceRefundRequests.CountAsync(
|
||||
|
||||
@@ -46,10 +46,10 @@ internal sealed class CommerceOrderAdministrationService(CommerceAdministrationD
|
||||
order => order.UserId == actor.UserId,
|
||||
order => order.RegionId.HasValue && regionIds.Contains(order.RegionId.Value));
|
||||
var payments = from payment in dbContext.Payments.AsNoTracking()
|
||||
join order in scopedOrders
|
||||
on new { payment.TenantId, payment.OrderId } equals new { order.TenantId, OrderId = order.Id }
|
||||
where payment.TenantId == actor.TenantId
|
||||
select new { payment, order.OrderNo };
|
||||
join order in scopedOrders
|
||||
on new { payment.TenantId, payment.OrderId } equals new { order.TenantId, OrderId = order.Id }
|
||||
where payment.TenantId == actor.TenantId
|
||||
select new { payment, order.OrderNo };
|
||||
if (!string.IsNullOrWhiteSpace(query.Provider))
|
||||
{
|
||||
var provider = NormalizeProvider(query.Provider);
|
||||
|
||||
@@ -47,10 +47,10 @@ internal sealed partial class ReconciliationAdministrationService
|
||||
return new TenantReconciliationIssueEventList(events);
|
||||
}
|
||||
|
||||
public async Task<ReconciliationImportPreview> PreviewReconciliationImportAsync(
|
||||
CommerceAdminActor actor,
|
||||
PreviewReconciliationImportCommand command,
|
||||
CancellationToken cancellationToken = default)
|
||||
public async Task<ReconciliationImportPreview> PreviewReconciliationImportAsync(
|
||||
CommerceAdminActor actor,
|
||||
PreviewReconciliationImportCommand command,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
await AssertAdminAsync(actor, cancellationToken);
|
||||
return BuildImportPreview(command.Provider, command.Rows);
|
||||
|
||||
@@ -448,7 +448,11 @@ internal sealed class TenantProvisioningAdministrationService(PlatformAdministra
|
||||
AddAudit(dbContext, actor, "platform.tenant_owner_activation.issued", tenant.Id,
|
||||
new
|
||||
{
|
||||
grant.Id, DomainId = primaryDomain.Id, grant.ExpiresAt, command.ReplaceExisting, command.Reason
|
||||
grant.Id,
|
||||
DomainId = primaryDomain.Id,
|
||||
grant.ExpiresAt,
|
||||
command.ReplaceExisting,
|
||||
command.Reason
|
||||
});
|
||||
await dbContext.SaveChangesAsync(cancellationToken);
|
||||
return new PlatformOwnerActivationLinkResult(
|
||||
|
||||
@@ -93,7 +93,7 @@ internal sealed class TenantClassService(TenantAdminServiceDependencies dependen
|
||||
throw new TenantAdminDirectException("Class was not found.", "class_not_found");
|
||||
|
||||
item ??= new TenantClass
|
||||
{ Id = command.Id ?? Guid.NewGuid(), TenantId = actor.TenantId, CreatedBy = actor.UserId };
|
||||
{ Id = command.Id ?? Guid.NewGuid(), TenantId = actor.TenantId, CreatedBy = actor.UserId };
|
||||
item.RegionId = command.RegionId;
|
||||
item.LegacyId = Normalize(command.LegacyId);
|
||||
item.Code = Normalize(command.Code);
|
||||
|
||||
@@ -415,7 +415,7 @@ internal abstract partial class TenantAdminServiceBase
|
||||
from binding in dbContext.TenantBackendUserRoles.AsNoTracking()
|
||||
join backendRole in dbContext.TenantBackendRoles.AsNoTracking()
|
||||
on new { binding.TenantId, binding.RoleId } equals new
|
||||
{ backendRole.TenantId, RoleId = backendRole.Id }
|
||||
{ backendRole.TenantId, RoleId = backendRole.Id }
|
||||
where binding.TenantId == actor.TenantId &&
|
||||
binding.UserId == actor.UserId &&
|
||||
backendRole.Code == "tenant_owner" &&
|
||||
|
||||
@@ -81,7 +81,9 @@ internal sealed class TenantStudentEngagementService(TenantAdminServiceDependenc
|
||||
var isNew = item is null;
|
||||
item ??= new TenantStudentNote
|
||||
{
|
||||
Id = command.Id ?? Guid.NewGuid(), TenantId = actor.TenantId, StudentUserId = command.StudentUserId,
|
||||
Id = command.Id ?? Guid.NewGuid(),
|
||||
TenantId = actor.TenantId,
|
||||
StudentUserId = command.StudentUserId,
|
||||
CreatedBy = actor.UserId
|
||||
};
|
||||
item.NoteType = ParseEnum(command.NoteType, StudentNoteType.General, "invalid_student_note_type");
|
||||
|
||||
@@ -98,7 +98,11 @@ internal sealed class TenantStudentService(TenantAdminServiceDependencies depend
|
||||
orderby tenantClass.SortOrder, tenantClass.CreatedAt descending
|
||||
select new
|
||||
{
|
||||
member.UserId, member.MemberType, member.JoinedAt, ClassId = tenantClass.Id, tenantClass.Name,
|
||||
member.UserId,
|
||||
member.MemberType,
|
||||
member.JoinedAt,
|
||||
ClassId = tenantClass.Id,
|
||||
tenantClass.Name,
|
||||
tenantClass.Code
|
||||
})
|
||||
.ToArrayAsync(cancellationToken);
|
||||
|
||||
@@ -173,7 +173,10 @@ public sealed class PhaseThreeTenantIsolationTests
|
||||
},
|
||||
new SaasOffering
|
||||
{
|
||||
Id = offeringId, Code = "standard", Name = "Standard", Type = SaasOfferingType.BasePlan,
|
||||
Id = offeringId,
|
||||
Code = "standard",
|
||||
Name = "Standard",
|
||||
Type = SaasOfferingType.BasePlan,
|
||||
Status = SaasOfferingStatus.Active
|
||||
},
|
||||
new SaasOfferingVersion
|
||||
|
||||
Reference in New Issue
Block a user