Skip to content

Commit 0f3015e

Browse files
authored
Merge pull request #214 from Resgrid/develop
CU-868dmcr4g Removing old messaging plan check code.
2 parents 97b6e26 + 0f20520 commit 0f3015e

File tree

4 files changed

+15
-50
lines changed

4 files changed

+15
-50
lines changed

Core/Resgrid.Services/CommunicationService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,8 @@ private async Task<bool> CanSendToUser(string userId, int departmentId)
526526
var supressStaffingInfo = await _departmentSettingsService.GetDepartmentStaffingSuppressInfoAsync(departmentId);
527527
var lastUserStaffing = await _userStateService.GetLastUserStateByUserIdAsync(userId);
528528

529-
if (lastUserStaffing == null && supressStaffingInfo != null)
529+
// Looks like this was a bug, lastUserStaffing was going through here == null. -SJ
530+
if (lastUserStaffing != null && supressStaffingInfo != null)
530531
{
531532
if (supressStaffingInfo.EnableSupressStaffing)
532533
{

Core/Resgrid.Services/QueueService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ public async Task<List<QueueItem>> GetAllPendingDeleteDepartmentQueueItemsAsync(
119119
if (!String.IsNullOrWhiteSpace(mqi.Message.ReceivingUserId))
120120
{
121121
var dm = await _departmentsService.GetDepartmentMemberAsync(mqi.Message.ReceivingUserId, mqi.DepartmentId);
122-
string departmentNumber = await _departmentSettingsService.GetTextToCallNumberForDepartmentAsync(dm.DepartmentId);
123-
mqi.DepartmentTextNumber = departmentNumber;
122+
//string departmentNumber = await _departmentSettingsService.GetTextToCallNumberForDepartmentAsync(dm.DepartmentId);
123+
//mqi.DepartmentTextNumber = departmentNumber;
124124

125125
if (mqi.Message.ReceivingUser == null)
126126
{
@@ -133,8 +133,8 @@ public async Task<List<QueueItem>> GetAllPendingDeleteDepartmentQueueItemsAsync(
133133
else if (!String.IsNullOrWhiteSpace(mqi.Message.SendingUserId))
134134
{
135135
var dm = await _departmentsService.GetDepartmentMemberAsync(mqi.Message.SendingUserId, mqi.DepartmentId);
136-
string departmentNumber = await _departmentSettingsService.GetTextToCallNumberForDepartmentAsync(dm.DepartmentId);
137-
mqi.DepartmentTextNumber = departmentNumber;
136+
//string departmentNumber = await _departmentSettingsService.GetTextToCallNumberForDepartmentAsync(dm.DepartmentId);
137+
//mqi.DepartmentTextNumber = departmentNumber;
138138
}
139139

140140
return await _outboundQueueProvider.EnqueueMessage(mqi);

Core/Resgrid.Services/SubscriptionsService.cs

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -388,31 +388,10 @@ public bool CanPlanSendMessageSms(int planId)
388388
{
389389
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
390390
{
391-
if (planId == 4 // Professional
392-
|| planId == 5 // Ultimate
393-
|| planId == 9 // Unlimited
394-
|| planId == 10 // Enterprise
395-
|| planId == 14 // Professional Monthly
396-
|| planId == 15 // Ultimate Monthly
397-
|| planId == 16 // Enterprise Monthly
398-
|| planId == 17 // Enterprise+
399-
|| planId == 18 // Enterprise+ Monthly
400-
|| planId == 20 // Univeral
401-
|| planId == 21 // Univeral Monthly
402-
|| planId == 26 // Professional
403-
|| planId == 27 // Professional Monthly
404-
|| planId == 28 // Ultimate
405-
|| planId == 29 // Ultimate Monthly
406-
|| planId == 30 // Enterprise
407-
|| planId == 31 // Enterprise Monthly
408-
|| planId == 32 // Enterprise+
409-
|| planId == 32 // Enterprise+ Monthly
410-
|| planId == 34 // Unified
411-
|| planId == 35 // Unified Monthly
412-
)
413-
return true;
414-
415-
return false;
391+
if (planId == 1)
392+
return false;
393+
394+
return true;
416395
}
417396

418397
return true;

Providers/Resgrid.Providers.Bus/OutboundQueueProvider.cs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,27 @@ public OutboundQueueProvider()
1818

1919
public async Task<bool> EnqueueCall(CallQueueItem callQueue)
2020
{
21-
if (SystemBehaviorConfig.ServiceBusType == ServiceBusTypes.Rabbit)
22-
return await _rabbitOutboundQueueProvider.EnqueueCall(callQueue);
23-
24-
return false;
21+
return await _rabbitOutboundQueueProvider.EnqueueCall(callQueue);
2522
}
2623

2724
public async Task<bool> EnqueueMessage(MessageQueueItem messageQueue)
2825
{
29-
if (SystemBehaviorConfig.ServiceBusType == ServiceBusTypes.Rabbit)
30-
return await _rabbitOutboundQueueProvider.EnqueueMessage(messageQueue);
31-
32-
return false;
26+
return await _rabbitOutboundQueueProvider.EnqueueMessage(messageQueue);
3327
}
3428

3529
public async Task<bool> EnqueueDistributionList(DistributionListQueueItem distributionListQueue)
3630
{
37-
if (SystemBehaviorConfig.ServiceBusType == ServiceBusTypes.Rabbit)
38-
return await _rabbitOutboundQueueProvider.EnqueueDistributionList(distributionListQueue);
39-
40-
return false;
31+
return await _rabbitOutboundQueueProvider.EnqueueDistributionList(distributionListQueue);
4132
}
4233

4334
public async Task<bool> EnqueueNotification(NotificationItem notificationQueue)
4435
{
45-
if (SystemBehaviorConfig.ServiceBusType == ServiceBusTypes.Rabbit)
46-
return await _rabbitOutboundQueueProvider.EnqueueNotification(notificationQueue);
47-
48-
return false;
36+
return await _rabbitOutboundQueueProvider.EnqueueNotification(notificationQueue);
4937
}
5038

5139
public async Task<bool> EnqueueShiftNotification(ShiftQueueItem shiftQueueItem)
5240
{
53-
if (SystemBehaviorConfig.ServiceBusType == ServiceBusTypes.Rabbit)
54-
return await _rabbitOutboundQueueProvider.EnqueueShiftNotification(shiftQueueItem);
55-
56-
return false;
41+
return await _rabbitOutboundQueueProvider.EnqueueShiftNotification(shiftQueueItem);
5742
}
5843

5944
public async Task<bool> EnqueueAuditEvent(AuditEvent auditEvent)

0 commit comments

Comments
 (0)