feat(api): En-route client notification and address fallback [AB#266]#305
Merged
Conversation
Added POST /assignments/{id}/en-route endpoint for client en-route notifications and fixed assignment DTO to fall back to client address when assignment has no address set.
Changes:
[1] Added POST en-route endpoint in AssignmentController calling NotifyEnRouteAsync
[2] Added NotifyEnRouteAsync in AssignmentService to send client en-route notification
[3] Added client address fallback in MapToDtoAsync when assignment address fields are empty
[4] Added BuildClientJobTrackingEnRoute notification message builder
[5] Added SendClientJobTrackingEnRouteNotificationAsync to notification service
[6] Updated interfaces and test stub for new notification method
References:
[1] [JobFlow.API/Controllers/AssignmentController.cs:126](https://github.com/Katharix/JobFlow.API/blob/fix/mobile-bugs-backend/JobFlow.API/Controllers/AssignmentController.cs#L126)
[2] [JobFlow.Business/Services/AssignmentService.cs:349](https://github.com/Katharix/JobFlow.API/blob/fix/mobile-bugs-backend/JobFlow.Business/Services/AssignmentService.cs#L349)
[3] [JobFlow.Business/Services/AssignmentService.cs:425](https://github.com/Katharix/JobFlow.API/blob/fix/mobile-bugs-backend/JobFlow.Business/Services/AssignmentService.cs#L425)
[4] [JobFlow.Business/Notifications/Builders/NotificationMessageBuilder.cs:213](https://github.com/Katharix/JobFlow.API/blob/fix/mobile-bugs-backend/JobFlow.Business/Notifications/Builders/NotificationMessageBuilder.cs#L213)
[5] [JobFlow.Business/Notifications/NotificationService.cs:135](https://github.com/Katharix/JobFlow.API/blob/fix/mobile-bugs-backend/JobFlow.Business/Notifications/NotificationService.cs#L135)
[6] [JobFlow.Tests/FollowUpAutomationServiceTests.cs:275](https://github.com/Katharix/JobFlow.API/blob/fix/mobile-bugs-backend/JobFlow.Tests/FollowUpAutomationServiceTests.cs#L275)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a POST /assignments/{id}/en-route endpoint so the mobile app can notify clients when a technician is on the way. Also fixes a bug where assignments with no address fell back to empty strings instead of the client's address.
Type of Change
Changes
API
Notifications
Tests
Testing
Work Item
Closes AB#266 — child of User Story #265
Checklist