---
id: ADR-COM-ORD-015
title: Replacements carry the complete record at the version read
product_area: commerce
module: orders
revision: 1
status: proposed
design_intent: proposed
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
decision: >-
  Propose complete replacement payloads with version checks for purchasing records as an extension of the CRM
  decision, pending authority for this scope.
constrains:
  - SVC-COM-ORD-purchasing
  - DOM-COM-ORD-006
origin: >-
  OQ-CRM-ENT-001 decided 2026-10-22 by Andrew: A (complete payloads for CRM records), applied here by
  extension
alternatives:
  - option: Retain omission-driven clearing as the permanent replacement contract
    why_not: A client accidentally omitting a value would silently clear stored data.
  - option: Replace whole-record writes with patches
    why_not: Patch semantics would replace the current versioned whole-record operation.
consequences:
  - The proposed complete-payload rule would require explicit empty values for clearing.
  - Current optional replacement fields leave the proposed rule unenforced.
supersedes: []
evidence:
  - >-
    services-commerce at c8b66a98: modules/purchasing/aws/api/purchasing.schemas.ts, purchasing-api-mapper.ts;
    services/persistence/vendors.ts, purchase-orders.ts, business-unit-settings.ts.
---

# Replacements carry the complete record at the version read

## Context

Replacement omission can silently erase data when an editor fails to send it.

## Decision

The design proposes complete payload validation for purchasing replacement alongside existing version checks. The recorded CRM decision supplies precedent, not approval for Commerce.

## Alternatives Considered

Documented omission clearing remains vulnerable to incomplete clients. Switching to patch semantics would change the existing replacement contract.

## Consequences

Current purchasing schemas still permit omission. Making absence an error needs a scoped product decision and subsequent implementation, rather than claiming it is already enforced.
