Skip to content

Notify users about similar found pets within a chosen radius #20

Description

@ismailbarankarasu

Background

A community member requested an alert when a dog of the same or similar breed is found within a selected distance. RescueLink already has location data, matching logic, and notifications, making this a useful extension of the existing workflow.

Goal

Allow the owner of an active lost-pet report to opt in to notifications when a sufficiently similar found report appears within a configurable radius.

Proposed Behavior

  • The owner enables or disables alerts for an active lost report.
  • The owner selects a supported radius rather than entering an unlimited value.
  • When a found report is created or becomes eligible for matching, RescueLink evaluates distance and the existing match criteria.
  • A notification is created only when the configured conditions are satisfied.
  • Duplicate notifications for the same lost/found report pair are prevented.
  • Notifications do not expose private owner or exact-location data.

Design Questions to Resolve

Before implementation, propose:

  • supported radius values and maximum radius;
  • whether the existing match-score threshold is reused;
  • when evaluation runs;
  • how duplicate notifications are prevented;
  • whether the first version is in-app only or also supports external delivery.

The initial implementation should prefer existing in-app notifications. SMS/email/push delivery should be handled separately unless infrastructure already exists and the scope is explicitly approved.

Architecture Guidance

  • Domain: model alert preferences and invariants where appropriate.
  • Application: commands, handlers, validation, and notification orchestration.
  • Persistence: preference storage, migration, and duplicate protection.
  • Infrastructure: do not introduce a new external messaging provider without approval.
  • API: expose opt-in/configuration endpoints through thin controllers.
  • Tests: cover radius boundary, score threshold, disabled alerts, and duplicates.

Acceptance Criteria

  • An owner can enable, configure, and disable alerts for an active lost report.
  • Radius values are validated and bounded.
  • Only eligible found reports trigger evaluation.
  • Distance and similarity requirements are both enforced.
  • Duplicate notifications for the same report pair are not created.
  • Resolved, cancelled, or archived reports do not produce new alerts.
  • No private location or contact data is leaked.
  • Automated tests cover positive, negative, boundary, and duplicate cases.
  • Existing tests continue to pass.
  • dotnet build RescueLink.slnx succeeds.
  • dotnet test RescueLink.slnx succeeds.

Out of Scope

  • Paid SMS providers
  • Marketing notifications
  • Continuous GPS tracking
  • Frontend implementation unless agreed separately

Before Starting

Please comment with the proposed preference model, radius values, trigger point, duplicate-prevention strategy, and test plan. Wait for confirmation before implementation.

Origin

This feature was suggested by a community member who wanted an alert when the same or a similar breed was found within a chosen mileage.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions