version: 2

models:
  - name: int_grouped_notifications_individualized
    description: Grouped notifications that have been fanned out to be one row per notification.
    config:
      group: notifications
      tags: ["cadence=daily", "dbt"]
    columns:
      - name: notification_id
        description: Notification ID, not necessarily unique
      - name: sender_user_id
        description: User ID of the sender
      - name: target_user_id
        description: User ID of the target
      - name: updated_at
        description: Timestamp of the notification update
      - name: sent_at
        description: Timestamp of the notification send
      - name: is_read
        description: Whether the notification has been read
      - name: type
        description: Type of the notification
      - name: content_id
        description: Content ID
      - name: secondary_content_id
        description: Secondary content ID
      - name: n_grouped_notifications
        description: Number of grouped notifications
      - name: p_date
        description: Date of the notification
  - name: int_user_notifications_sent_daily
    description: Daily notifications sent by each user-category.
    config:
      group: notifications
      tags: ["cadence=daily", "dbt"]
    columns:
      - name: sender_user_id
        description: User ID of the sender
      - name: p_date
        description: Date of the notification
      - name: notification_category
        description: Category of the notification
      - name: n_notifications_sent_in_category
        description: Number of notifications sent in the category
      - name: n_notifications_sent_on_day
        description: Number of notifications sent on the day
  - name: int_user_sent_notifications
    description: Aggregated current user metrics as of today regarding sent notifications.
    config:
      group: notifications
      tags: ["cadence=daily", "dbt"]
    columns:
      - name: sender_user_id
        description: User ID
      - name: max_daily_notifications_sent_on_day
        description: Maximum number of notifications the user has sent in a day
      - name: max_daily_notifications_sent_clip_like
        description: Maximum number of notifications the user has sent in a day for clip likes
      - name: n_days_notifications_sent_clip_like
        description: Number of days the user has sent notifications for clip likes
      - name: total_notifications_sent_clip_like
        description: Total number of notifications the user has sent for clip likes
      - name: max_daily_notifications_sent_follow
        description: Maximum number of notifications the user has sent in a day for follow
      - name: n_days_notifications_sent_follow
        description: Number of days the user has sent notifications for follow
      - name: total_notifications_sent_follow
        description: Total number of notifications the user has sent for follow
      - name: max_daily_notifications_sent_comment_related
        description: Maximum number of notifications the user has sent in a day for comment related
      - name: n_days_notifications_sent_comment_related
        description: Number of days the user has sent notifications for comment related
      - name: total_notifications_sent_comment_related
        description: Total number of notifications the user has sent for comment related
      - name: max_daily_notifications_sent_other
        description: Maximum number of notifications the user has sent in a day for other
      - name: n_days_notifications_sent_other
        description: Number of days the user has sent notifications for other
