Added Attribute Mapping DSL

This commit is contained in:
ricky committed 2026-03-13 08:32:55 -04:00
1 parent eb6954ddf1
commit c87e18810b
4 files changed
+122 -17

No files matched your search

+5 -3
View File
@@ -22,7 +22,9 @@ class InvoiceSyncService < SyncServiceBase
InvoiceAttachmentService.new(local, remote).attach
end
map_attribute :customer, ->(remote) { Customer.find_by(id: remote.customer_ref&.value) }
map_attribute :total_amount, ->(remote) { remote.total }
map_attribute :qbo_updated_at, ->(remote) { remote.meta_data&.last_updated_time }
map_attributes :balance, :doc_number, :due_date, :txn_date
map_attribute :total_amount, :total
map_attribute :qbo_updated_at, "meta_data.last_updated_time"
map_belongs_to :customer
end