Files
calendar/packages/app-store
Joe Au-YeungGitHubjoe@cal.com <j.auyeung419@gmail.com>joe@cal.com <j.auyeung419@gmail.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
654a865007 refactor: Salesforce getContacts (#24235)
* lint fixes

* Create getContactOrLeadFromEmail method

* Use getContactOrLeadFromEmail in getContacts

* Move normal getContact query

* fix: correct return type in getContactOrLeadFromEmail and add search mock

- Fix getContactOrLeadFromEmail to return single ContactRecord instead of array
- Add conn.search() implementation to salesforceMock for integration tests
- Ensure id field is always string with proper fallbacks for AccountId and Id
- Fix Owner.Email to use undefined instead of null in mock

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* test: add comprehensive tests for getContactOrLeadFromEmail method

- Add 6 new unit tests covering all key scenarios
- Test contact lookup, lead fallback, and preference logic
- Test both roundRobinSkipFallbackToLeadOwner and createEventOnLeadCheckForContact code paths
- Add search mock support to mockConnection in beforeEach
- All 34 tests passing, type-check clean

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

* Implement change to error from #24090

* Address feedback

* Type fix

* test: update SOQL query expectations to include Account.OwnerId

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-10-03 14:53:00 -04:00
..
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00
2025-09-24 22:20:49 +09:00