Skip to content

feat(api): En-route client notification and address fallback [AB#266]#305

Merged
bllr777 merged 1 commit into
mainfrom
fix/mobile-bugs-backend
May 18, 2026
Merged

feat(api): En-route client notification and address fallback [AB#266]#305
bllr777 merged 1 commit into
mainfrom
fix/mobile-bugs-backend

Conversation

@bllr777
Copy link
Copy Markdown
Collaborator

@bllr777 bllr777 commented May 18, 2026

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

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation / chore

Changes

API

  • Added POST /assignments/{id}/en-route endpoint in AssignmentController
  • Added NotifyEnRouteAsync in AssignmentService to fetch assignment with client and send en-route notification
  • Added client address fallback in MapToDtoAsync — when assignment address fields are empty, falls back to the client's address

Notifications

  • Added BuildClientJobTrackingEnRoute to NotificationMessageBuilder and interface
  • Added SendClientJobTrackingEnRouteNotificationAsync to NotificationService and interface

Tests

  • Updated FollowUpAutomationServiceTests stub to implement new INotificationService method

Testing

  • Unit tests added/updated
  • Manual testing performed
  • Screenshots attached (for UI changes)

Work Item

Closes AB#266 — child of User Story #265

Checklist

  • Self-review performed
  • No new lint warnings introduced
  • Tests pass locally

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)
@bllr777 bllr777 merged commit 2f41f24 into main May 18, 2026
6 checks passed
@bllr777 bllr777 deleted the fix/mobile-bugs-backend branch May 18, 2026 23:25
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.

1 participant