refactor(sync): improve attribute mapping to support dynamic fields and custom transformations

This commit is contained in:
2026-03-12 21:38:06 -04:00
parent be1a69217f
commit eb6954ddf1
5 changed files with 44 additions and 39 deletions

View File

@@ -17,11 +17,6 @@ class EstimateSyncService < SyncServiceBase
Estimate
end
# Map relevant attributes from the QBO Estimate to the local Estimate model
def process_attributes(local, remote)
local.doc_number = remote.doc_number
local.txn_date = remote.txn_date
local.customer = Customer.find_by(id: remote.customer_ref&.value)
end
map_attribute :customer, ->(remote) { Customer.find_by(id: remote.customer_ref&.value) }
end