fix: "wa_source_id" function return value (#5451)
- Fix contact inbox builder returning invalid WhatsApp source id - Add specs to cover source id validations Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -15,6 +15,8 @@ def generate_source_id(contact_inbox)
|
||||
contact_inbox.inbox.channel.medium == 'sms' ? Faker::PhoneNumber.cell_phone_in_e164 : "whatsapp:#{Faker::PhoneNumber.cell_phone_in_e164}"
|
||||
when 'Channel::Email'
|
||||
"#{SecureRandom.uuid}@acme.inc"
|
||||
when 'Channel::Whatsapp'
|
||||
Faker::PhoneNumber.cell_phone_in_e164.delete('+')
|
||||
else
|
||||
SecureRandom.uuid
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user