---
id: TST-PFM-DJE-037
title: Validate data job request
kind: unit
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: macroservice-libraries
files:
  - packages/data-jobs/src/validate-data-job-request.spec.ts
implements:
  - ATS-PFM-DJE-018-01
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: In-memory fixtures and restored dependency doubles.
evidence:
  - 'macroservice-libraries:packages/data-jobs/src/validate-data-job-request.spec.ts'
assertion_inventory:
  - declaring a data operation
  - answers the contract name a job records
  - accepts the versions declared and no others
  - 'reads a trailing wildcard as the members of that field, one level deep'
  - 'refuses a declaration with no contract version, which could accept no job at all'
  - refuses an object type that is not <service>.<objects>
  - 'refuses an update that does not match by id, which no selection of ids could be run for'
  - 'refuses a delete that declares patchable fields, which a delete never sets'
  - 'refuses a declaration with no submit permission, which would leave a bulk change unguarded'
  - validating a data job request
  - 'freezes a selection of ids as items numbered from one, each carrying the validated patch'
  - 'trims the ids it freezes, because no string is stored with whitespace around it'
  - reads the members of a wildcard field as their own paths
  - refuses a patch that touches a field the operation does not declare patchable
  - 'names every field it refuses, so a caller fixes the whole patch at once'
  - 'refuses a contract version the domain does not accept, naming the ones it does'
  - refuses a request whose object type or operation is not the operation it was submitted to
  - 'refuses more items than the interactive lane carries, saying how many were sent'
  - accepts exactly the cap
  - 'takes a lower cap from the caller, which is how a tenant or an operation tightens it'
  - 'refuses a repeated id, naming the position that repeats it'
  - 'refuses an empty id, which would otherwise name every record or none'
  - 'refuses an input that is neither a selection nor prepared records, and one that is both'
  - 'refuses a selection with no patch for an update, which would change nothing'
  - refuses an item named by the producer's key when the request names no producer
  - 'freezes prepared records with their keys, expected versions and group keys'
  - refuses a prepared record that names neither an id nor a source key
  - refuses a prepared record keyed by something the operation does not match by
  - refuses an expected version that is not a record version
  - 'lets the contract version refuse an item''s values, naming the item'
  - derives a group key from the operation when the caller named none
  - 'takes no patch for a delete, and refuses one'
  - >-
    refuses a delete submitted to be applied, because a delete is validated first and nothing undoes
    one
  - refuses an initial data import the caller has not established the tenant may take
  - 'refuses a mode it does not know, rather than treating it as a validation'
registration_note: Registration describes existing source; the suite is not executed by this documentation job.
---

# Validate data job request

## Verification Boundary

The suite checks an isolated production calculation, declaration or adapter. The structured assertion inventory records the checks present at the pinned revision.

## What This Suite Proves

The existing checks exercise validate data job request. The specification bindings identify the narrower outcomes supported by those assertions.

## What It Does Not Prove

An isolated check does not establish a deployed workflow, database enforcement or complete feature acceptance.

## Real Dependencies and Test Doubles

The production function or declaration is exercised with in-memory inputs and dependency doubles. This boundary does not require a live database.

## Must Not Be Doubled

The production function under examination and its returned decisions remain real; replacing their answers defeats the check.
