Feature_Directory #90
@ -6,5 +6,6 @@
|
||||
public string? Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public List<Guid>? EmployeeIds { get; set; }
|
||||
public int NumberOfContacts { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1034,14 +1034,16 @@ namespace Marco.Pms.Services.Helpers
|
||||
List<AssignBucketVM> bucketVMs = new List<AssignBucketVM>();
|
||||
if (bucketList.Any())
|
||||
{
|
||||
bucketIds = bucketList.Select(b => b.Id).ToList();
|
||||
List<ContactBucketMapping>? contactBucketMappings = await _context.ContactBucketMappings.Where(cb => bucketIds.Contains(cb.BucketId)).ToListAsync();
|
||||
foreach (var bucket in bucketList)
|
||||
{
|
||||
List<EmployeeBucketMapping> employeeBucketMappings = employeeBuckets.Where(eb => eb.BucketId == bucket.Id).ToList();
|
||||
var emplyeeIds = employeeBucketMappings.Select(eb => eb.EmployeeId).ToList();
|
||||
|
||||
List<ContactBucketMapping>? contactBuckets = contactBucketMappings.Where(cb => cb.BucketId == bucket.Id).ToList();
|
||||
AssignBucketVM bucketVM = bucket.ToAssignBucketVMFromBucket();
|
||||
bucketVM.EmployeeIds = emplyeeIds;
|
||||
|
||||
bucketVM.NumberOfContacts = contactBuckets.Count;
|
||||
bucketVMs.Add(bucketVM);
|
||||
}
|
||||
}
|
||||
@ -1150,8 +1152,10 @@ namespace Marco.Pms.Services.Helpers
|
||||
|
||||
AssignBucketVM bucketVM = bucket.ToAssignBucketVMFromBucket();
|
||||
List<EmployeeBucketMapping> employeeBucketMappings = employeeBuckets.Where(eb => eb.BucketId == bucket.Id).ToList();
|
||||
List<ContactBucketMapping> contactBuckets = await _context.ContactBucketMappings.Where(eb => eb.BucketId == bucket.Id).ToListAsync();
|
||||
var employeeIds = employeeBucketMappings.Select(eb => eb.EmployeeId).ToList();
|
||||
bucketVM.EmployeeIds = employeeIds;
|
||||
bucketVM.NumberOfContacts = contactBuckets.Count;
|
||||
|
||||
_logger.LogInfo("Employee Id {LoggedInEmployeeId} Updated new bucket {BucketId}", LoggedInEmployee.Id, bucket.Id);
|
||||
return ApiResponse<object>.SuccessResponse(bucketVM, "Bucket update successFully", 200);
|
||||
@ -1239,9 +1243,10 @@ namespace Marco.Pms.Services.Helpers
|
||||
|
||||
AssignBucketVM bucketVM = bucket.ToAssignBucketVMFromBucket();
|
||||
List<EmployeeBucketMapping> employeeBucketMappings = await _context.EmployeeBucketMappings.Where(eb => eb.BucketId == bucket.Id).ToListAsync();
|
||||
List<ContactBucketMapping> contactBuckets = await _context.ContactBucketMappings.Where(eb => eb.BucketId == bucket.Id).ToListAsync();
|
||||
employeeIds = employeeBucketMappings.Select(eb => eb.EmployeeId).ToList();
|
||||
bucketVM.EmployeeIds = employeeIds;
|
||||
|
||||
bucketVM.NumberOfContacts = contactBuckets.Count;
|
||||
|
||||
if (assignedEmployee > 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user