chore: Refactor Contact Inbox Builders (#5617)

- Remove duplicate code and move everything to builders
- fixes: #4680
This commit is contained in:
Sojan Jose
2022-10-13 15:12:04 -07:00
committed by GitHub
parent 1f271356ca
commit e310230f62
21 changed files with 234 additions and 210 deletions

View File

@@ -46,8 +46,13 @@ unless Rails.env.production?
inbox = Inbox.create!(channel: web_widget, account: account, name: 'Acme Support')
InboxMember.create!(user: user, inbox: inbox)
contact = Contact.create!(name: 'jane', email: 'jane@example.com', phone_number: '+2320000', account: account)
contact_inbox = ContactInbox.create!(inbox: inbox, contact: contact, source_id: user.id, hmac_verified: true)
contact = ::ContactInboxWithContactBuilder.new(
source_id: user.id,
inbox: inbox,
hmac_verified: true,
contact_attributes: { name: 'jane', email: 'jane@example.com', phone_number: '+2320000' }
).perform&.contact
conversation = Conversation.create!(
account: account,
inbox: inbox,