diff --git a/Marco.Pms.Services/Controllers/TenantController.cs b/Marco.Pms.Services/Controllers/TenantController.cs index fe6e521..d05f0c3 100644 --- a/Marco.Pms.Services/Controllers/TenantController.cs +++ b/Marco.Pms.Services/Controllers/TenantController.cs @@ -352,7 +352,6 @@ namespace Marco.Pms.Services.Controllers return Ok(ApiResponse.SuccessResponse(response, "Tenant profile fetched successfully", 200)); } - // POST api/ [HttpPost("create")] public async Task CreateTenant([FromBody] CreateTenantDto model) @@ -551,6 +550,17 @@ namespace Marco.Pms.Services.Controllers }; _context.Projects.Add(project); + var projectAllocation = new ProjectAllocation + { + ProjectId = project.Id, + EmployeeId = employeeUser.Id, + AllocationDate = model.OnBoardingDate, + IsActive = true, + JobRoleId = adminJobRole.Id, + TenantId = tenant.Id + }; + _context.ProjectAllocations.Add(projectAllocation); + // All entities are now added to the context. Save them all in a single database operation. await _context.SaveChangesAsync();