Added Attribute Mapping DSL

This commit is contained in:
2026-03-13 08:32:55 -04:00
parent eb6954ddf1
commit c87e18810b
4 changed files with 122 additions and 17 deletions

View File

@@ -22,8 +22,8 @@ class CustomerSyncService < SyncServiceBase
!remote.active?
end
map_attribute :name, ->(remote) { remote.display_name }
map_attribute :phone_number, ->(remote) { remote.primary_phone&.free_form_number&.gsub(/\D/, '') }
map_attribute :mobile_phone_number, ->(remote) { remote.mobile_phone&.free_form_number&.gsub(/\D/, '') }
map_attribute :name, :display_name
map_phone :phone_number, :primary_phone
map_phone :mobile_phone_number, :mobile_phone
end