---
id: TST-PFM-DJE-130
title: Activity imports
kind: integration
product_area: platform
module: data-job-engine
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: services-crm
files:
  - modules/data-jobs/tests/integration/services/operations/activity-imports.integration.spec.js
implements: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Suite-owned fixture records, job identifiers and workspace contexts; teardown removes the fixture
  data.
evidence:
  - >-
    services-crm:modules/data-jobs/tests/integration/services/operations/activity-imports.integration.spec.js
assertion_inventory:
  - 'an import of activity types: the tenant’s own and a seeded system type'
  - applies both types of the file
  - >-
    creates the tenant’s own type, with no system code (the read leaves it out) and its outcomes in
    the order the file gave them
  - >-
    updates the seeded system type the file names by its id: its name, icon, colour, field modes and
    outcomes
  - 'keeps the seeded type’s system code, whatever the file says'
  - 'leaves the tenant one postal mail type, never a second beside the seeded one'
  - 'maps the producer’s key to the seeded type, so a later delivery updates it again'
  - >-
    an import of activities: links by key, a missing contact, a rerun, a newer revision, a patch and
    a delete
  - 'applies the activity whose records are loaded, and blocks the one naming a contact never loaded'
  - 'blocks the activity as a missing dependency, naming the link that names the key'
  - >-
    writes no activity for the blocked item, so no activity is created about fewer records than it
    names
  - >-
    links the activity to the three contacts and the organization the keys name, the primary the one
    the file marked
  - takes the moment and whether its time is known as the file gives them
  - records an ordinary import’s activity as the integration’s
  - 'skips the same activity of the same revision delivered again, and blocks the unloaded one again'
  - adds no activity on the second delivery
  - updates the activity a newer revision of the same key delivers
  - 'patches only what an update names, the activity’s links kept'
  - validates the delete of the activity before it is applied
  - deletes the activity the delete job names
  - 'takes the deleted activity’s key with it, so the key delivered again creates an activity'
  - 'an import of activities’ past: kept by an initial import, not by an ordinary one'
  - applies the activity of the initial import
  - records the initial import’s activity as the migration’s
  - 'keeps when the activity was logged and by whom, as the file gives them'
  - 'keeps when the activity was last changed and by whom, as the file gives them'
  - keeps the owner the file names
  - 'keeps the day of an activity whose time was never recorded, as the file gives it'
  - applies the ordinary import’s activity that carries stamps (premise)
  - 'stamps an ordinary import’s activity with its own write, not the stamps the file carries'
  - 'a contact merge after an activity import: the activity’s crosswalk row still names its activity'
  - runs the merge to its end (premise)
  - leaves the activity’s crosswalk row naming the activity it named
  - 'links the imported activity to the survivor once, the primary flag carried to it'
  - 'applies a newer revision naming both keys to the same activity, the two keys now one record'
registration_note: Registration describes existing source; the suite is not executed by this documentation job.
---

# Activity imports

## Verification Boundary

The suite checks the production service or shared engine against its database fixture. The structured assertion inventory records the checks present at the pinned revision.

## What This Suite Proves

The existing checks exercise activity imports. The specification bindings identify the narrower outcomes supported by those assertions.

## What It Does Not Prove

Local execution does not establish deployed queue, storage or service behavior. Independent test cases do not establish a complete cross-feature process.

## Real Dependencies and Test Doubles

The owning service exercises production persistence and domain behavior against real Postgres. The fixture supplies caller contexts; queue delivery, storage and external calls are doubled where the file installs a test port.

## Must Not Be Doubled

The database effects, security context and production operation under examination remain real. Their outcomes cannot be replaced with canned success responses.
