diff --git a/docs/api/pos-transaction-workflows.md b/docs/api/pos-transaction-workflows.md index 00e92b1..dff254a 100644 --- a/docs/api/pos-transaction-workflows.md +++ b/docs/api/pos-transaction-workflows.md @@ -25,5 +25,6 @@ This BFF exposes POS summary, transaction detail, recent payment activity, and p ## Notes -- Transaction detail is currently derived from the recent payment snapshot returned by `operations-service`. +- POS summary and detail are derived from payable restaurant checks exposed by `operations-service`, not from an independent payment event store. +- Transaction detail is currently derived from the payable-check snapshot returned by `operations-service`. - Correlation IDs are preserved through Thalos session checks and operations-service calls. diff --git a/docs/roadmap/feature-epics.md b/docs/roadmap/feature-epics.md index d997620..9098a96 100644 --- a/docs/roadmap/feature-epics.md +++ b/docs/roadmap/feature-epics.md @@ -9,11 +9,10 @@ pos-transactions-bff - Epic 3: Improve observability and operational readiness for demo compose environments. ## Domain-Specific Candidate Features -- Order lifecycle consistency and state transitions. -- Kitchen queue and dispatch optimization hooks. +- POS projection over shared restaurant payable-check rules. +- POS transaction detail and recent payment activity views that stay aligned with served-and-payable restaurant state. +- Cross-app continuity from kitchen completion to payment eligibility and final capture. - Operations control-plane policies (flags, service windows, overrides). -- POS closeout and settlement summary alignment. -- POS transaction detail and recent payment activity views that stay aligned with operations-service workflows. ## Documentation Contract Any code change in this repository must include docs updates in the same branch. diff --git a/docs/runbooks/containerization.md b/docs/runbooks/containerization.md index 1c93680..7bd0311 100644 --- a/docs/runbooks/containerization.md +++ b/docs/runbooks/containerization.md @@ -39,5 +39,6 @@ docker run --rm -p 8080:8080 --name pos-transactions-bff agilewebs/pos-transacti - Integration artifact path: `greenfield/demo/restaurant/docker-compose.yml` ## Known Limitations -- Pos-transactions now delegates workflow snapshots to `operations-service`, but the upstream operations adapter still serves deterministic demo data rather than database-backed state. +- Pos-transactions now delegates workflow snapshots to `operations-service`, which projects payable shared-lifecycle checks from `operations-dal`. +- Transaction detail remains a summary projection until a dedicated payable-check detail contract is exposed upstream. - Demo PostgreSQL seeds validate integration contracts and smoke determinism, but do not yet imply full persistence implementation parity. diff --git a/src/Pos.Transactions.Bff.Application/Adapters/OperationsPosTransactionsServiceClient.cs b/src/Pos.Transactions.Bff.Application/Adapters/OperationsPosTransactionsServiceClient.cs index ea64a25..b59c9da 100644 --- a/src/Pos.Transactions.Bff.Application/Adapters/OperationsPosTransactionsServiceClient.cs +++ b/src/Pos.Transactions.Bff.Application/Adapters/OperationsPosTransactionsServiceClient.cs @@ -22,7 +22,7 @@ public sealed class OperationsPosTransactionsServiceClient(HttpClient httpClient public async Task FetchDetailAsync(GetPosTransactionDetailRequest request, CancellationToken cancellationToken) { var payload = await GetSummaryPayloadAsync(request.ContextId, cancellationToken); - // operations-service currently exposes recent-payment snapshots rather than a dedicated transaction detail endpoint. + // POS detail remains a projection over the payable-check summary until operations-service exposes a dedicated detail route. var payment = MapPayments(payload.RecentPayments).FirstOrDefault(activity => activity.TransactionId == request.TransactionId); return new GetPosTransactionDetailResponse( diff --git a/tests/Pos.Transactions.Bff.Application.UnitTests/OperationsPosTransactionsServiceClientTests.cs b/tests/Pos.Transactions.Bff.Application.UnitTests/OperationsPosTransactionsServiceClientTests.cs index baf2d22..173e89d 100644 --- a/tests/Pos.Transactions.Bff.Application.UnitTests/OperationsPosTransactionsServiceClientTests.cs +++ b/tests/Pos.Transactions.Bff.Application.UnitTests/OperationsPosTransactionsServiceClientTests.cs @@ -24,10 +24,11 @@ public sealed class OperationsPosTransactionsServiceClientTests { var adapter = new OperationsPosTransactionsServiceClient(CreateClient(SummaryPayload)); - var response = await adapter.FetchDetailAsync(new GetPosTransactionDetailRequest("demo-context", "POS-9001"), CancellationToken.None); + var response = await adapter.FetchDetailAsync(new GetPosTransactionDetailRequest("demo-context", "CHK-1002"), CancellationToken.None); Assert.NotNull(response.Transaction); - Assert.Equal("POS-9001", response.Transaction!.TransactionId); + Assert.Equal("CHK-1002", response.Transaction!.TransactionId); + Assert.Equal("awaiting-payment", response.Transaction.Status); } [Fact] @@ -84,24 +85,24 @@ public sealed class OperationsPosTransactionsServiceClientTests private const string SummaryPayload = """ { "contextId": "demo-context", - "summary": "Open POS balance reflects one captured payment and one pending settlement.", + "summary": "2 payable checks are waiting for POS capture.", "openBalance": 37.50, "currency": "USD", "recentPayments": [ { - "transactionId": "POS-9001", - "paymentMethod": "card", + "transactionId": "CHK-1002", + "paymentMethod": "check", "amount": 25.50, "currency": "USD", - "status": "captured", + "status": "awaiting-payment", "capturedAtUtc": "2026-03-31T13:30:00Z" }, { - "transactionId": "POS-9002", - "paymentMethod": "wallet", + "transactionId": "CHK-1003", + "paymentMethod": "check", "amount": 12.00, "currency": "USD", - "status": "pending", + "status": "partial-payment", "capturedAtUtc": "2026-03-31T13:42:00Z" } ]