iachat/spec/enterprise/jobs
Vinay Keerthi 1fbdd68222
feat: Add company auto-association for contacts (CW-5726 Part 2) (#12711)
## Description

Implements real-time company auto-association for contacts based on
email domains. This is **Part 2** of the company model production
rollout (CW-5726).

**Task:**
- When a contact is created with a business email, automatically create
and associate a company from the email domain
- When a contact is updated with an email for the first time (email was
previously nil), associate with a company
- Preserve existing company associations when email changes to avoid
user confusion
- Skip free email providers and disposable domains

**Dependencies:**
⚠️ Requires PR #12657 (Part 1: Backfill migration) to be merged first

**Linear ticket:**
[CW-5726](https://linear.app/chatwoot/issue/CW-5726/company-model-setting-it-up-on-production)

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

- Service specs: Tests business email detection, company creation,
association logic, edge cases (existing companies, free emails, nil
emails)
- Integration specs: Tests full callback flow for contact create/update
scenarios
- All tests passing: 10 examples, 0 failures
- RuboCop: 0 offenses

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules (PR #12657 pending)

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2025-11-03 20:36:13 +05:30
..
captain fix: Captain response builder not getting triggered (#12729) 2025-10-28 18:31:08 -07:00
enterprise chore: Automate SSL with Cloudflare (#12021) 2025-07-24 13:09:06 +04:00
inboxes fix: Disable IMAP inboxes that requires authorization (#12092) 2025-08-01 16:32:29 -07:00
messages feat(ee): Add transcription support for audio messages (#11670) 2025-06-05 18:29:37 -05:00
migration feat: Add company auto-association for contacts (CW-5726 Part 2) (#12711) 2025-11-03 20:36:13 +05:30
saml feat: update users on SAML setup and destroy [CW-2958][CW-5612] (#12346) 2025-09-15 21:20:22 +05:30
sla chore: [Snyk] Security upgrade rspec-rails from 6.1.4 to 6.1.5 (#10066) 2024-09-16 09:44:07 +05:30