Spensara Spensara Knowledge Base & Documentation Repository

Repository Docs & Knowledge Base

Consolidated Spensara documentation repository (722 Markdown & architecture documents in ../repository)
Built Word Documents (.docx): Spensara Overview (.docx) Capability Assessment (.docx) Brink POS Ingestion Analysis (.docx) The Borg Ingestion Architecture (.docx)

Implementation Specs (157)

Detailed engineering and feature implementation specifications.
implementation-specs/specs/BrinkPosOrdersFirstEtlJob/TASK2.4.md 2,952 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

TASK 2.4: Add Unit Tests And Live E2E Validation For Extract Raw

Summary

Add the required verification layer for the first real ETL boundary. This subtask closes TASK 2 by proving both locally and against real integrations that extract_raw works for Brink orders.

The verification split must respect the architectural boundary:

  • Brink integration tests validate the adapter against explicit test connection context
  • Warehouse/ETL tests validate binding resolution, orchestration, S3 persistence, and stage semantics

Dependencies

  • TASK 2.1 - child extract orchestration and business-date resolution
  • TASK 2.2 - Brink raw capture boundary
  • TASK 2.3 - S3 raw persistence and persisted-raw validation

Files to Create

1. Extract-stage test coverage

Create or finalize the test suites needed for:

  • unit coverage of orchestration and validation rules
  • live E2E coverage of real Brink extraction and S3 persistence
  • adapter tests that do not require operational DB coupling inside Kds.Ai.Integrations.BrinkPos

Required Behavior

  • unit tests must cover the final extract_raw flow assembled from TASK 2.1-TASK 2.3
  • live E2E must verify the real integration path whenever Aspire-managed secrets are available
  • the live test should prove that the real Brink call results in a persisted raw S3 object that passes validation
  • integration adapter tests should run with explicit BrinkConnectionDefinition or equivalent bound-client setup rather than repository-backed tenant resolution inside the integration module

Testing

Unit tests

Ensure the final unit suite covers:

  • Warehouse-side binding resolution handoff
  • business-date routing
  • raw-client routing
  • persisted-raw validation semantics
  • diagnostics recording

Live E2E

Add a live E2E test that verifies at least:

  • real Brink connection resolution
  • GetCurrentBusinessDate when no explicit date is provided
  • real GetOrders call
  • persisted raw XML in S3 raw/
  • successful read-back validation of the persisted object
  • the tested ETL path uses Warehouse/app-layer binding resolution rather than DB-coupled resolution inside Kds.Ai.Integrations.BrinkPos

Acceptance Criteria

  • [x] Unit-test coverage exists for the assembled extract_raw flow
  • [x] Live E2E exists for real Brink extraction and S3 raw persistence
  • [x] Live E2E verifies that the persisted object can be validated successfully
  • [x] Integration adapter tests no longer depend on Warehouse/Data-backed connection resolution inside Kds.Ai.Integrations.BrinkPos
  • [x] TASK 2 is verifiable as a completed ETL stage

Notes

  • This subtask is mandatory because extract_raw is a finished ETL boundary.
  • Keep integration-adapter verification separate from Warehouse orchestration verification.
  • If live E2E cannot run in one environment, document the blocker explicitly instead of silently skipping it.