---
id: TST-PFM-MTD-058
title: business events
kind: integration
product_area: platform
module: metadata
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js
implements:
  - ATS-PFM-MTD-015-07
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Prepared integration database and the suite fixture records; fixture teardown restores or removes its own
  rows.
evidence:
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#modules/custom-objects/services/persistence/business-events.ts
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#removes
    the old events of every tenant and answers how many
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#keeps
    an old event a queue row still names, so a delivery never loses its envelope
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#keeps
    an event younger than the retention
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#refuses
    a retention shorter than a day
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#is
    refused by the database for want of the privilege
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#leaves
    the event standing
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#are
    exactly the library’s: INSERT and SELECT on the ledger, INSERT, SELECT and DELETE on the queue
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#let
    it update a queue row’s claim and no other column
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#counts
    the tenant’s events under the resource key the participant declares (the premise)
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#removes
    one batch at a time
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#removes
    what is left on the next call, and answers nothing once the tenant is empty
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#leaves
    another tenant’s events alone
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#is
    refused by the database, so the purger is never a delete-by-tenant tool
  - >-
    services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#leaves
    the event standing
fixture_imports:
  - drizzle-orm
  - '@rhythmsoftware/macroservice-testing/stage'
  - ../../../../db/business-events.table
  - ../../../../db/business-event-queue.table
  - ../../../../services/persistence/business-events
  - ../../support
test_doubles: []
limitations: []
unmatched_specification: null
binding_assertions:
  - scenario: ATS-PFM-MTD-015-07
    provenance: test
    source:
      - >-
        services-platform:modules/custom-objects/tests/integration/services/persistence/business-events.integration.spec.js#refuses
        a retention shorter than a day
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
---

# Business events

## Verification Boundary

This integration suite checks custom objects and records within the local test harness. The registered file and pinned revision define its boundary.

## What This Suite Proves

The bindings identify the detailed or feature scenarios whose outcomes have assertions in this suite. Original case references remain attached to the detailed scenarios so a reviewer can inspect the exact assertion. Assertions are evidence of implemented checks; no execution result is claimed.

## What It Does Not Prove

The register does not establish a current passing run or full specification conformance. Behavior outside the suite’s fixtures and assertions remains unverified.

## Real Dependencies and Test Doubles

The fixture uses PostgreSQL and the imported persistence or API code. The fixture imports identify the setup seams; this register makes no broader claim that dependencies are undoubled.

## Must Not Be Doubled

The operation under examination and its asserted stored outcomes must remain real within the declared harness. A fixture cannot replace the write, refusal or transactional effect that the bound scenario checks.
