Skip to content

Conversation

@ucswift
Copy link
Member

@ucswift ucswift commented Jul 16, 2025

No description provided.

@request-info
Copy link

request-info bot commented Jul 16, 2025

Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details?

@ucswift ucswift requested a review from Copilot July 16, 2025 02:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR expands dispatch settings to include unit-level options, updates the Contacts table schema for longer/nullable fields, and introduces a new API endpoint to delete inbox messages.

  • Add new “Unit Dispatch” options in UI, view model, controller, and settings service
  • Create Contact table migration (M0035) to alter string columns to nullable with max length
  • Implement DeleteMessage endpoint in InboxController and corresponding Novu provider support

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
Workers/Resgrid.Workers.Framework/Logic/SystemQueueLogic.cs Added exception logging and removed an empty else block
Workers/Resgrid.Workers.Framework/Logic/CallBroadcast.cs Fetched new dispatch flags (currently unused) and added an unused import
Web/Resgrid.Web/Areas/User/Views/Department/DispatchSettings.cshtml Switched hardcoded text to localization and added checkboxes for unit dispatch settings
Web/Resgrid.Web/Areas/User/Models/Departments/DispatchSettingsView.cs Added properties for the new unit dispatch settings
Web/Resgrid.Web/Areas/User/Controllers/DepartmentController.cs Persist and load new dispatch settings, renamed regions for clarity
Web/Resgrid.Web.Services/Resgrid.Web.Services.xml Documented new InboxController.DeleteMessage API
Web/Resgrid.Web.Services/Controllers/v4/InboxController.cs Added DeleteMessage endpoint for inbox API
Providers/Resgrid.Providers.Migrations/Migrations/M0035_UpdatingContactsTableAgain.cs Migration to alter Contacts table columns to MaxValue and nullable
Providers/Resgrid.Providers.Messaging/NovuProvider.cs Added DeleteMessage to provider, updated notification payload formatting
Core/Resgrid.Services/PushService.cs Commented out old push registration logic, added exception-safe calls for notifications
Core/Resgrid.Services/DepartmentSettingsService.cs Added methods to read new unit dispatch settings
Core/Resgrid.Model/Services/IDepartmentSettingsService.cs Exposed new unit dispatch getters in the interface
Core/Resgrid.Model/Providers/Models/INovuProvider.cs Added DeleteMessage contract
Core/Resgrid.Model/DepartmentSettingTypes.cs Introduced enum values for new dispatch settings
Core/Resgrid.Localization/Areas/User/Department/Department.resx (and .es/.en) Added resource keys for new dispatch settings and updated schema metadata
.github/copilot-instructions.md Added repository-specific coding guidelines
Comments suppressed due to low confidence (2)

Web/Resgrid.Web.Services/Resgrid.Web.Services.xml:3556

  • The <returns> tag for DeleteMessage is empty; consider documenting the HTTP status codes or return values.
            <returns></returns>

Web/Resgrid.Web.Services/Controllers/v4/InboxController.cs:43

  • [nitpick] Consider using a RESTful route like [HttpDelete("{messageId}")] so the messageId is part of the path rather than a query parameter.
		[HttpDelete("DeleteMessage")]

Comment on lines +14 to 15
using SharpKml.Dom;

Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The SharpKml.Dom import appears unused; please remove it to keep dependencies clean.

Suggested change
using SharpKml.Dom;

Copilot uses AI. Check for mistakes.
if (_unitsService == null)
_unitsService = Bootstrapper.GetKernel().Resolve<IUnitsService>();

bool alsoDispatchToAssignedPersonnel = await _departmentSettingsService.GetUnitDispatchAlsoDispatchToAssignedPersonnelAsync(cqi.Call.DepartmentId);
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting value is retrieved but never used; implement logic to use alsoDispatchToAssignedPersonnel or remove the call.

Copilot uses AI. Check for mistakes.
Comment on lines +155 to +156
bool alsoDispatchToGroup = await _departmentSettingsService.GetUnitDispatchAlsoDispatchToGroupAsync(cqi.Call.DepartmentId);

Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting value is retrieved but never used; implement logic to use alsoDispatchToGroup or remove the call.

Suggested change
bool alsoDispatchToGroup = await _departmentSettingsService.GetUnitDispatchAlsoDispatchToGroupAsync(cqi.Call.DepartmentId);

Copilot uses AI. Check for mistakes.

public override void Down()
{

Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Down method is empty—implement reverse operations or throw NotImplementedException to ensure clean rollbacks.

Suggested change
throw new NotImplementedException("Rollback is not supported for this migration.");

Copilot uses AI. Check for mistakes.
{
try
{
using (var httpClient = new HttpClient())
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a new HttpClient per call can exhaust sockets; consider reusing a singleton or injecting via IHttpClientFactory.

Copilot uses AI. Check for mistakes.
Comment on lines +200 to +207
}//,
//data = new
//{
// title = title,
// message = body,
// eventCode = eventCode,
// type = type
//}
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Remove commented-out payload code to keep the implementation clear and maintainable.

Suggested change
}//,
//data = new
//{
// title = title,
// message = body,
// eventCode = eventCode,
// type = type
//}
}

Copilot uses AI. Check for mistakes.
Comment on lines +11 to 12
using DnsClient;

Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The DnsClient import is unused and can be removed to reduce clutter.

Suggested change
using DnsClient;

Copilot uses AI. Check for mistakes.
Comment on lines +172 to +175
<value />
</data>
<data name="UnitDispatchAlsoDispatchToGroupLabel" xml:space="preserve">
<value />
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This new resource key has an empty <value>—add default text to prevent missing UI labels.

Suggested change
<value />
</data>
<data name="UnitDispatchAlsoDispatchToGroupLabel" xml:space="preserve">
<value />
<value>Also dispatch to assigned personnel</value>
</data>
<data name="UnitDispatchAlsoDispatchToGroupLabel" xml:space="preserve">
<value>Also dispatch to group</value>

Copilot uses AI. Check for mistakes.
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DeleteDepartmentSettingsInfo" xml:space="preserve">
<value />
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Spanish localization is missing entries for the new dispatch settings keys; add translations to match the English .resx.

Suggested change
<value />
<value>Información sobre la configuración de eliminación del departamento</value>

Copilot uses AI. Check for mistakes.
<value>Unit Dispatch Settings</value>
</data>
<data name="UnitDispatchAlsoDispatchToAssignedPersonnelLabel" xml:space="preserve">
<value>Also Dispatch To Assigned Personnel</value>
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] There are two spaces between "Assigned" and "Personnel"; reduce to a single space for consistency.

Suggested change
<value>Also Dispatch To Assigned Personnel</value>
<value>Also Dispatch To Assigned Personnel</value>

Copilot uses AI. Check for mistakes.
@ucswift
Copy link
Member Author

ucswift commented Jul 16, 2025

Approve

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is approved.

@ucswift ucswift merged commit 0e5ad48 into master Jul 16, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants