Bryce 58f6714399 fix(transactions): drop suppressed transactions from the transactions page (#19)
Suppressed transactions were showing up on the transactions page.

## The cause

The SSR transactions page never excluded `:transaction-approval-status/suppressed`. The GraphQL/CLJS transactions page has always excluded them unconditionally (`auto_ap/datomic/transactions.clj`, the `true` branch of its `cond->>`), as do the ledger queries in `auto_ap/ledger.clj`.

The `scan-transactions` ion does no status filtering of its own — it is a bare `index-range` over `:transaction/client+date` — so nothing downstream was dropping them either. Suppressing a transaction is the user's way of saying "stop showing me this", and it stayed visible on the page it was suppressed from.

## Impact

22,813 suppressed transactions exist db-wide out of 621,492. For the worst-affected client, a five-year range returned **14,736 rows against 3,641 real ones** — the other 11,095 were suppressed.

## The fix

One `not` clause in the main scan in `auto_ap/ssr/transaction/common.clj`, applied inside the query rather than after it so the row count and the amount total — both derived from `fetch-ids` — match the rows actually rendered. Measured 6ms -> 29ms on that worst-case client and range.

The three status routes (approved, unapproved, requires-feedback) constrain the status themselves and there is no suppressed route, so no page loses its own rows.

## Note on the commit list

This branch carries `6e7f66a7` (include-in-reports in the register) and its revert. That commit was only ever on a local staging; it never reached this remote. The net diff of this branch against `staging` is exactly the transactions fix below — the add and the revert cancel out. Both are kept so local staging reconciles cleanly after merge.

## Testing

- New `test/clj/auto_ap/ssr/transaction/common_test.clj` — 6 assertions, passing. Covers the suppressed row being dropped from `ids`, `all-ids` and `count`; the approved status route still listing its rows; and an all-suppressed client returning empty.
- `auto-ap.ssr.transaction.import-test` and `auto-ap.ssr.ledger-test` pass, with one exception: `external-import-remove-button-test` fails identically with and without these changes, so it is pre-existing and unrelated.
- `auto-ap.ssr.transaction.edit-test` still has its known `apply-rule does not exist` compile break, untouched here.
- `lein cljfmt check` clean.

## Loose end, not addressed

`:transaction/exclude-from-ledger` is defined in `resources/schema.edn` but read nowhere in the codebase — only `:invoice/exclude-from-ledger` is honored. If anything ever wrote that attribute expecting it to hide transactions, it never did.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #19
Co-authored-by: Bryce <bryce@brycecovertoperations.com>
Co-committed-by: Bryce <bryce@brycecovertoperations.com>
2026-08-16 08:40:47 -07:00
2026-05-30 00:08:27 -07:00
2026-07-29 10:25:04 -07:00
2024-02-08 11:41:03 -08:00
2019-01-26 09:02:28 -08:00
2026-06-23 22:03:26 -07:00
2026-05-27 08:42:42 -07:00
2026-06-04 22:59:51 -07:00
2024-05-02 20:37:13 -07:00
2026-04-26 22:15:05 -07:00
2024-11-17 22:32:43 -08:00
2026-05-19 09:21:28 -07:00
ok.
2026-02-08 08:43:53 -08:00
2022-09-26 16:12:39 -07:00
2023-10-12 21:55:37 -07:00
2026-05-21 11:51:29 -07:00
2023-07-27 09:50:22 -07:00
2026-05-30 00:08:27 -07:00
2018-09-03 13:12:20 -07:00
2019-01-26 09:02:28 -08:00
2022-12-08 08:51:34 -08:00
2019-01-26 09:02:28 -08:00
2019-04-24 21:29:38 -07:00
2026-05-18 15:50:09 -07:00
2026-07-25 21:13:44 -07:00
2023-03-24 10:57:53 -07:00
2023-08-31 23:43:19 -07:00
2026-05-19 09:21:28 -07:00
2026-05-21 11:50:50 -07:00
2026-05-21 11:50:50 -07:00
2026-06-23 22:03:26 -07:00
2021-10-08 16:18:31 -07:00
fix
2022-06-23 08:44:44 -07:00
2026-04-09 14:32:39 -07:00
2025-03-31 10:55:47 -07:00
Description
No description provided
22 MiB
Languages
Clojure 91%
CSS 4.2%
Sass 2.3%
HTML 1.2%
HCL 0.4%
Other 0.7%