title: Order Quantity Evaluation
type: object
x-tags:
  - Models
description: Immutable first capture evaluation and its optional terminal full-void correction. This is audit information, not a balance movement. Program identity/name are current; configuration and tier UUID are frozen at evaluation. Base and bonus ledger entries can be found through the source-order history filters.
required:
  - loyalty_program
  - configuration_snapshot
  - customer_tier_uuid
  - observed_quantity
  - awarded_quantity
  - invalidated_quantity
  - deducted_quantity
  - undeducted_quantity
  - voided_at
properties:
  loyalty_program:
    $ref: ./LoyaltyProgramReference.yaml
  configuration_snapshot:
    $ref: ./QuantityConfiguration.yaml
  customer_tier_uuid:
    type: [string, 'null']
    format: uuid
    description: Tier resulting from capture progression, or null when no tier was held. Retained if the tier is later removed.
  observed_quantity:
    type: integer
    minimum: 0
    description: Calculated base entitlement plus any applicable awarded bonus. Tier-ineligible captures can observe base entitlement while awarding zero.
  awarded_quantity:
    type: integer
    minimum: 0
    description: Base and bonus units actually granted, including a frozen zero result.
  invalidated_quantity:
    type: [integer, 'null']
    minimum: 0
    description: Awarded entitlement invalidated by a full void, or null before void correction.
  deducted_quantity:
    type: [integer, 'null']
    minimum: 0
    description: Actual units recovered from the unexpired pool on full void. Zero is a completed correction, distinct from null.
  undeducted_quantity:
    type: [integer, 'null']
    minimum: 0
    description: Invalidated units minus actual deductions. This shortfall is permanently written off, never recovered from future earning. Null before void correction.
  voided_at:
    type: [string, 'null']
    format: date-time
    description: When the full-void correction was recorded, including zero deductions; null before correction.
