Skip to content

Support location-scoped notification subscriptions (location.feed_added) #1779

Description

@davidgamez

Description

location.feed_added alerts a user when a feed is added for a location they follow, so a subscription must carry the list of locations. We'll add a dedicated notification_subscription_location join table and expose the location list through the API.

Notification type in scope

Notification type Target
location.feed_added list of location IDs

Schema changes (docs/UserServiceAPI.yaml)

Add location_ids to the create request and to the subscription response:

CreateNotificationSubscriptionRequest:
  properties:
    # ...notification_id...
    location_ids:
      type: array
      items:
        type: string
      description: Location IDs to subscribe to. Required for location.feed_added.

NotificationSubscription:
  properties:
    # ...existing fields...
    location_ids:
      type: array
      items:
        type: string
      nullable: true
      description: Locations this subscription targets (location.feed_added).

Code changes

  • POST /v1/user/subscriptions creates one subscription referencing all supplied locations and returns it with location_ids populated. _Validation is enforced in code, not the schema. Per-type schema validation would need oneOf/discriminator or JSON Schema if/then/else (3.1 only; this spec is 3.0.0), and union typing was already abandoned here due to openapi-generator limitations (see docs/DatabaseCatalogAPI.yaml SearchFeedItemResult).

DB changes

Add new relation table between user subscriptions and locations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions