Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21367: [Spike] Nightly job to filter and sync contacts #241

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

VSydor
Copy link
Contributor

@VSydor VSydor commented Aug 28, 2024

No description provided.

@VSydor VSydor requested a review from brmeyer August 28, 2024 21:54
@VSydor VSydor self-assigned this Aug 28, 2024
@VSydor VSydor force-pushed the feature/21367-nightly-job-to-filter-and-sync-contacts branch from 65c65d1 to 36ff8f1 Compare September 2, 2024 21:39
@VSydor VSydor changed the title WIP: 21367: Initial commit 21367: [Spike] Nightly job to filter and sync contacts Sep 2, 2024
@VSydor VSydor force-pushed the feature/21367-nightly-job-to-filter-and-sync-contacts branch from 30a8db5 to 7bcf057 Compare September 10, 2024 20:24
@VSydor VSydor requested a review from brmeyer September 11, 2024 20:51
@VSydor VSydor force-pushed the feature/21367-nightly-job-to-filter-and-sync-contacts branch from ea1d1f8 to 75ef24c Compare September 11, 2024 22:14
public void syncTransactions(Calendar updatedAfter) throws Exception {
List<CrmDonation> crmDonations = env.primaryCrmService().getDonations(updatedAfter);
if (env.accountingPlatformService().isPresent()) {
//TODO: get all contacts ids for crm contacts and do bulk update instead?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safe to skip the updateOrCreateContacts step here! My goal is to schedule the contact sync first, then follow up with the transaction sync later, separated by at least an hour. Assume the contacts already exist and have been updated?

Copy link
Contributor Author

@VSydor VSydor Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.
We may have one missing piece here: we have crmDonation and crmContact, but we need to have contact id (xero one) to assign transaction to contact.
It seems to me that we need to have smth like getContactForCrmContact (getByAccountNumber, etc) method in the Xero service to complete the flow. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good point! That was one benefit of doing the real time sync, where we had everything about the contact and transaction in a single shot. Makes sense!

} else {
// Organization
//TODO: Three different record types to include: AU ORGANISATION, AU CHURCH, AU SCHOOL?
contact.setName(crmContact.account.name + " " + supporterId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VSydor Look through the doc I put together and DR AU's data mapping sheet to verify this one. Are organization record types supposed to use supporterId, or was supporterId for household contacts only and organizations simply use accountId?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants