diff --git a/Tiku.Infrastructure/Commerce/Adjustments/CommerceAdjustmentService.cs b/Tiku.Infrastructure/Commerce/Adjustments/CommerceAdjustmentService.cs index 56dd401..438cc5c 100644 --- a/Tiku.Infrastructure/Commerce/Adjustments/CommerceAdjustmentService.cs +++ b/Tiku.Infrastructure/Commerce/Adjustments/CommerceAdjustmentService.cs @@ -183,9 +183,9 @@ internal sealed class CommerceAdjustmentService(CommerceAdministrationDependenci .SumAsync(item => item.AmountCents, cancellationToken)); } -public async Task GetAnomalySummaryAsync( - CommerceAdminActor actor, - CancellationToken cancellationToken = default) + public async Task GetAnomalySummaryAsync( + CommerceAdminActor actor, + CancellationToken cancellationToken = default) { await AssertAdminAsync(actor, cancellationToken); var openRefunds = await dbContext.CommerceRefundRequests.CountAsync( diff --git a/Tiku.Infrastructure/Commerce/Orders/CommerceOrderAdministrationService.cs b/Tiku.Infrastructure/Commerce/Orders/CommerceOrderAdministrationService.cs index 97f44cb..e305ba9 100644 --- a/Tiku.Infrastructure/Commerce/Orders/CommerceOrderAdministrationService.cs +++ b/Tiku.Infrastructure/Commerce/Orders/CommerceOrderAdministrationService.cs @@ -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); diff --git a/Tiku.Infrastructure/Commerce/Reconciliation/ReconciliationAdministrationService.Operations.cs b/Tiku.Infrastructure/Commerce/Reconciliation/ReconciliationAdministrationService.Operations.cs index 005b46c..ba78293 100644 --- a/Tiku.Infrastructure/Commerce/Reconciliation/ReconciliationAdministrationService.Operations.cs +++ b/Tiku.Infrastructure/Commerce/Reconciliation/ReconciliationAdministrationService.Operations.cs @@ -47,10 +47,10 @@ internal sealed partial class ReconciliationAdministrationService return new TenantReconciliationIssueEventList(events); } -public async Task PreviewReconciliationImportAsync( - CommerceAdminActor actor, - PreviewReconciliationImportCommand command, - CancellationToken cancellationToken = default) + public async Task PreviewReconciliationImportAsync( + CommerceAdminActor actor, + PreviewReconciliationImportCommand command, + CancellationToken cancellationToken = default) { await AssertAdminAsync(actor, cancellationToken); return BuildImportPreview(command.Provider, command.Rows); diff --git a/Tiku.Infrastructure/PlatformAdmin/TenantProvisioning/TenantProvisioningAdministrationService.cs b/Tiku.Infrastructure/PlatformAdmin/TenantProvisioning/TenantProvisioningAdministrationService.cs index 0d12eb0..8d597de 100644 --- a/Tiku.Infrastructure/PlatformAdmin/TenantProvisioning/TenantProvisioningAdministrationService.cs +++ b/Tiku.Infrastructure/PlatformAdmin/TenantProvisioning/TenantProvisioningAdministrationService.cs @@ -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( diff --git a/Tiku.Infrastructure/TenantAdmin/Classes/TenantClassService.cs b/Tiku.Infrastructure/TenantAdmin/Classes/TenantClassService.cs index 56cc325..d41a905 100644 --- a/Tiku.Infrastructure/TenantAdmin/Classes/TenantClassService.cs +++ b/Tiku.Infrastructure/TenantAdmin/Classes/TenantClassService.cs @@ -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); diff --git a/Tiku.Infrastructure/TenantAdmin/Foundation/TenantAdminFoundation.MappingAndValidation.cs b/Tiku.Infrastructure/TenantAdmin/Foundation/TenantAdminFoundation.MappingAndValidation.cs index c26adbe..9742718 100644 --- a/Tiku.Infrastructure/TenantAdmin/Foundation/TenantAdminFoundation.MappingAndValidation.cs +++ b/Tiku.Infrastructure/TenantAdmin/Foundation/TenantAdminFoundation.MappingAndValidation.cs @@ -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" && diff --git a/Tiku.Infrastructure/TenantAdmin/StudentEngagement/TenantStudentEngagementService.cs b/Tiku.Infrastructure/TenantAdmin/StudentEngagement/TenantStudentEngagementService.cs index 741ae13..408f57d 100644 --- a/Tiku.Infrastructure/TenantAdmin/StudentEngagement/TenantStudentEngagementService.cs +++ b/Tiku.Infrastructure/TenantAdmin/StudentEngagement/TenantStudentEngagementService.cs @@ -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"); diff --git a/Tiku.Infrastructure/TenantAdmin/Students/TenantStudentService.cs b/Tiku.Infrastructure/TenantAdmin/Students/TenantStudentService.cs index 3c5d037..7d2b9c2 100644 --- a/Tiku.Infrastructure/TenantAdmin/Students/TenantStudentService.cs +++ b/Tiku.Infrastructure/TenantAdmin/Students/TenantStudentService.cs @@ -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); diff --git a/Tiku.IntegrationTests/PhaseThreeTenantIsolationTests.cs b/Tiku.IntegrationTests/PhaseThreeTenantIsolationTests.cs index cd88758..cc6f05f 100644 --- a/Tiku.IntegrationTests/PhaseThreeTenantIsolationTests.cs +++ b/Tiku.IntegrationTests/PhaseThreeTenantIsolationTests.cs @@ -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