asyncapi: 3.0.0
info:
  title: Communications Service Async Contracts
  version: 0.1.0
  description: Internal asynchronous contracts represented over BullMQ/Redis queues.
channels:
  reminders.scan:
    address: reminders.scan
    messages:
      queueReminderScan:
        $ref: '#/components/messages/QueueReminderScan'
  reminders.dispatch:
    address: reminders.dispatch
    messages:
      queueReminderDispatch:
        $ref: '#/components/messages/QueueReminderDispatch'
  notifications.scan:
    address: notifications.scan
    messages:
      queueNotificationScan:
        $ref: '#/components/messages/QueueNotificationScan'
  notifications.dispatch:
    address: notifications.dispatch
    messages:
      queueNotificationDispatch:
        $ref: '#/components/messages/QueueNotificationDispatch'
  push.dispatch:
    address: push.dispatch
    messages:
      queuePushDispatch:
        $ref: '#/components/messages/QueuePushDispatch'
operations:
  enqueueReminderScan:
    action: send
    channel:
      $ref: '#/channels/reminders.scan'
    messages:
      - $ref: '#/channels/reminders.scan/messages/queueReminderScan'
  enqueueReminderDispatch:
    action: send
    channel:
      $ref: '#/channels/reminders.dispatch'
    messages:
      - $ref: '#/channels/reminders.dispatch/messages/queueReminderDispatch'
  enqueueNotificationScan:
    action: send
    channel:
      $ref: '#/channels/notifications.scan'
    messages:
      - $ref: '#/channels/notifications.scan/messages/queueNotificationScan'
  enqueueNotificationDispatch:
    action: send
    channel:
      $ref: '#/channels/notifications.dispatch'
    messages:
      - $ref: '#/channels/notifications.dispatch/messages/queueNotificationDispatch'
  enqueuePushDispatch:
    action: send
    channel:
      $ref: '#/channels/push.dispatch'
    messages:
      - $ref: '#/channels/push.dispatch/messages/queuePushDispatch'
components:
  messages:
    QueueReminderScan:
      payload:
        type: object
        additionalProperties: false
    QueueReminderDispatch:
      payload:
        type: object
        required: [deliveryId]
        properties:
          deliveryId:
            type: string
    QueueNotificationScan:
      payload:
        type: object
        additionalProperties: false
    QueueNotificationDispatch:
      payload:
        type: object
        required: [deliveryId]
        properties:
          deliveryId:
            type: string
    QueuePushDispatch:
      payload:
        type: object
        required: [deliveryId]
        properties:
          deliveryId:
            type: string
