Skip to content

CAP-COM-FUL-020Import Commerce history and reconcile source records

Markdown

CAP-COM-FUL-020

Import Commerce history and reconcile source records

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaCommerceModuleFulfillment, Shipping and InventoryRevision1

Read atservices-commerce c8b66a98

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Imported Commerce history supplies the migrating workspace's opening records.Source identities support reconciliation with original historical records.
Surfaces
apijob

Controls

45 controls apply, from the corpus control catalogue.

TC-IAM-006 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-AZ-006 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-TEN-004 TC-SEC-001 TC-SEC-002 TC-SEC-003 TC-SEC-004 TC-CRY-001 TC-CRY-004 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-CHG-001 TC-CHG-002 TC-CHG-003 TC-CHG-004 TC-CHG-007 TC-AVL-004 TC-MON-001 TC-MON-002 TC-MON-004 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-004 TC-PI-005 TC-VEN-001 TC-VEN-002 TC-VEN-003 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
commerce.inventory.bulkapitenant
commerce.inventory.updateapitenant

Business Rules

13 rules, 11 to be proved before approval. A rule's product intent is derived from its origin: 0 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01
Proposed
Migration serves twelve collections with eleven job operations each: stores, ordering profiles, orders, promotions, redemptions, categories, listings, merchandise option sets, merchandise, warehouses, locations and stock items.
policyapitest
02must prove
Proposed
Submission accepts up to 500 prepared records in validate or apply mode with insert, upsert or update semantics, rejects patch selections, and requires a source key or identity per record and a source system for keyed records.
validationapitest
services-commerce:modules/data-operations/tests/unit/api/data-jobs-schemas.spec.js#refuses a selection with a patch: no Commerce operation changes records in place by id
03must prove
Proposed
Data jobs require collection bulk authority and recheck record-write authority, rejecting read-only job callers and portal members.
permissionapi, servicetest
services-commerce:modules/data-operations/tests/e2e/data-jobs.e2e.spec.js#refuses a principal holding the read key alone on every data-job route of the collection, 403 permission_missing
04must prove
Proposed
Repeating an identical submission under its idempotency key returns the existing job marked reused.
invariantservicetest
services-commerce:modules/data-operations/tests/e2e/data-jobs.e2e.spec.js#answers a second submission of the same body under the same Idempotency-Key with the same job, reused
05must prove
Proposed
Validation records impact without writes, and apply rejects an absent or mismatched validation-impact digest.
validationservicetest
services-commerce:modules/data-operations/tests/integration/services/jobs/data-jobs.integration.spec.js#refuses an apply that echoes a digest other than the validation recorded, impact_digest_mismatch
06must prove
Proposed
Bulk-key holders can inspect all jobs in their collection and other callers only their own, while cross-collection job reads and mismatched collection submissions are rejected.
permissionservicetest
services-commerce:modules/data-operations/tests/integration/services/jobs/data-jobs.integration.spec.js#lists only the jobs a caller submitted themselves when they lack the collection’s bulk key
07must prove
Proposed
Initial import requires an implementation workspace in loading state, where job routes remain available and ordinary routes are closed.
policyapi, servicetest
08must prove
Proposed
Batch execution reloads the submitter's permissions, fails the job if authority was revoked, avoids duplicate application on redelivery and dead-letters unreadable messages.
permissionservicetest
services-commerce:modules/data-operations/tests/integration/services/queue/data-job-worker.integration.spec.js#acknowledges the message as access_revoked and fails the job whole with that code, nothing left on the queue
09must prove
Proposed
Missing references defer records with the dependency field identified, typed failures retain their code, duplicate errors disclose constraint names rather than colliding values, and dropped connections are transient.
policyservicetest
services-commerce:modules/data-operations/tests/unit/operations/error-classification.spec.js#blocks an item whose reference nobody has loaded, on the engine’s dependency_missing, at the field that names it
10must prove
Proposed
Readback accepts up to 100 source keys, returns imported shapes and missing-key lists and excludes records from other workspaces.
permissionservicetest
services-commerce:modules/data-operations/tests/e2e/data-jobs.e2e.spec.js#answers the key missing before the apply, and the store as its load carried it once the job is applied and run
11must prove
Proposed
Migrated orders preserve original numbers, arrive accepted, billed and marked migrated, create completed or blocked item-line obligations and defer unresolved invoice linking for a later same-key relink.
origin: D-C-04 (build decision, not a product ruling): services-commerce:docs/migrations/data-operations/README.md
policyservicetest
services-commerce:modules/data-operations/tests/integration/services/operations/order-import.integration.spec.js#creates one obligation per item line in its final state: completed and open for the fulfilled line, blocked for the other
12must prove
Proposed
Migrated stock opening uses count-correction and damage ledger entries instead of direct balance writes, rejecting repeat keys and inactive destinations.
invariantservicetest
services-commerce:modules/data-operations/tests/integration/services/operations/inventory-import.integration.spec.js#opens the mug’s item through the ledger: a count correction of twelve and a damage of two, so the trigger holds ten available
13
Proposed
Pause, resume, cancellation and retry take effect between batches, and cancellation preserves and reports already committed records.
lifecycleapi, serviceobserved

Scenarios

IdGivenWhenThenProvenance
01A prepared store import has passed validation.Apply its recorded impact digest and execute the queued batch.The created store is available through its original source key in imported shape.test
services-commerce:modules/data-operations/tests/e2e/data-jobs.e2e.spec.js#answers the key missing before the apply, and the store as its load carried it once the job is applied and run

Edge Cases

IdGivenWhenThenProvenance
02A listing references a product not yet imported.Execute its import batch.The item waits on the identified missing dependency without being written.test
services-commerce:modules/data-operations/tests/integration/services/operations/catalog-import.integration.spec.js#blocks a listing whose product nothing has loaded as dependency_missing, naming the product source key, and writes nothing

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.