fivetran/dbt_twilio

[Feature] Make use of underutilized staging models

Open

#13 opened on Jan 17, 2025

 (1 comment) (0 reactions) (0 assignees) (1 fork)auto 404
good first issuetype:enhancement

Repository metrics

Stars
 (1 star)
PR merge metrics
 (PR metrics pending)

Description

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

We don't actually use 4/8 staging models here in the transform package:

  • address
  • incoming_phone_number
  • call
  • outgoing_caller_id

I'd like to explore using these more by joining them into our pre-existing end models and/or creating new end models.

How would you implement this feature?

Joining into pre-existing end models

Incoming_phone_number

Join this into:

  • twilio__number_overview on the number and direction like '%outbound%'

Add these fields (if they seem valuable to folks)

  • capabilities_mms - this is a boolean so let’s prepend with has_
  • capabilities_sms - this is a boolean so let’s prepend with has_
  • capabilities_voice - this is a boolean so let’s prepend with has_
  • beta - we need to add this to the staging model and rename as is_beta_phone_number
  • friendly_name
  • origin
  • voice_caller_id_lookup - prepend with is_ (or another boolean prefix that makes more sense)
  • emergency_status

Address

Join this into:

  • twilio__account_overview - I think a single account can have multiple addresses, so we’ll just aggregate the:
    • count of addresses per account (limit to verified and validated)
    • count of unverified addresses per account
    • count of unvalidated addresses per account
  • twilio__number_overview - on incoming_phone_number.address_id

Add these fields:

  • street
  • city
  • postal_code
  • region
  • iso_country
  • customer_name
  • friendly_name field (maybe coalesce with friendly_name from incoming_phone_number )
  • validated as is_address_validated
  • verified as is_address_verified

Outgoing_caller_id

Join this into:

  • twilio__number_overview on the number and direction like '%outbound%'

Add friendly_name field (maybe coalesce with friendly_name from incoming_phone_number and address)

Call

(leverage the using_twilio_call to dynamically include this)

Join this into:

  • twilio__number_overview on the phone_number
    • Aggregate:
      • count of calls
      • split by the direction like '%outbound%' and direction like ‘%inbound%’
      • split by the status (values) maybe….
      • split by answered_by (human vs machine)
      • sum up the price. Ideally, we can dynamically split the price columns up by the price_unit
      • average queue_time

Also maybe join this into:

  • twilio__account_overview on the account_id
    • same metrics as above, plus the distinct count of phone numbers who have received or placed calls (2 different columns based on direction)
    • would this be helpful split by status as well? or overkill…

Creating new end models

Call_enhanced

Very similar to twilio__message_enhanced - we’ll likely wanna do the same sort of intermediate model that splits things based on the direction and adds some date dimensions. This would be very simple but something that QS customers could turn off in the UI.

Potentially join in:

  • outgoing_caller_id
  • incoming_phone_number
  • address

Though if we add these to the pre-existing end models (namely twilio__number_overview) it would be pretty easy for customers to join the end models together and grab that info themselves

Describe alternatives you've considered

Leaving them as is

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance.
  • No.

Anything else?

No response

Contributor guide