Skip to content

CRM / campaigns / enrichment: minor cleanup & test-coverage backlog #271

Description

@pdovhomilja

Consolidated minor follow-ups deferred during recent CRM/campaign/enrichment work. None is user-impacting on its own; grouped for tracking. Split any item out if picked up.

Data integrity / correctness

  • Contacts: account existence / soft-delete not validated before linking contact.accountsIDs; no test for the accountsIDs-set-but-zero-open-opps branch.
  • Enrichment idempotency: TOCTOU race on the idempotency check (findFirst + create not transactional; currently best-effort de-dup).
  • import-targets: emails array not deduped before findMany; suppression assignments on valid: any[] are not type-checked (pre-existing any).

Cleanup

  • actions/crm/products/import-products.ts is still Papa-only — candidate for the shared CSV parser.
  • Delivery-deadline picker reuses closeDatePlaceholder copy — add a dedicated i18n key.
  • Seed: add a comment rationale for the "Signing" → purchase_order mapping.

Test coverage

  • No automated test for updateOpportunity delivery_deadline (create path covered only).
  • Campaign send: failure-path test doesn't assert console.error was called, nor that the per-send DB update happened first.
  • Line-item wrapper tests assert the parent findFirst was called, but not that it was called with the resolved parent id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions