Corrected adding the subscription after payment

This commit is contained in:
ashutosh.nehete 2025-10-29 14:44:54 +05:30
parent 86b37549eb
commit 4916a95eb4
2 changed files with 2 additions and 3 deletions

View File

@ -933,7 +933,6 @@ namespace Marco.Pms.Services.Controllers
} }
var industry = await context.Industries.FirstOrDefaultAsync(i => i.Id == model.IndustryId); var industry = await context.Industries.FirstOrDefaultAsync(i => i.Id == model.IndustryId);
if (industry == null) if (industry == null)
{ {
_logger.LogWarning("Industry not found while creating the tenant enquire"); _logger.LogWarning("Industry not found while creating the tenant enquire");

View File

@ -310,11 +310,11 @@ namespace Marco.Pms.Services.Service
var tenantVM = _mapper.Map<TenantVM>(tenant); var tenantVM = _mapper.Map<TenantVM>(tenant);
tenantVM.CreatedBy = _mapper.Map<BasicEmployeeVM>(employeeUser); tenantVM.CreatedBy = _mapper.Map<BasicEmployeeVM>(employeeUser);
await AddSubscriptionAsync(tenantId, employeeId, paymentDetailId, planId);
// Commit the transaction as all operations were successful. // Commit the transaction as all operations were successful.
await transaction.CommitAsync(); await transaction.CommitAsync();
await AddSubscriptionAsync(tenantId, employeeId, paymentDetailId, planId);
_logger.LogInfo("Successfully created tenant {TenantId} for organization {OrganizationName}.", tenant.Id, tenant.Name); _logger.LogInfo("Successfully created tenant {TenantId} for organization {OrganizationName}.", tenant.Id, tenant.Name);
return ApiResponse<object>.SuccessResponse(tenantVM, "Tenant created successfully.", 201); return ApiResponse<object>.SuccessResponse(tenantVM, "Tenant created successfully.", 201);
} }