Skip to content

refactor(lore-0141): move the settle reasons into their own file [structure only] - #183

Merged
karolko9 merged 1 commit into
developfrom
lore-0141-settle-reasons
Nov 13, 2026
Merged

karolko9 merged 1 commit into
developfrom
lore-0141-settle-reasons

Conversation

@karolko9

Copy link
Copy Markdown
Collaborator

Summary

settle.ts holds over 1,400 lines, and every new /settle code made it grow. This moves the reason
table to its own file, before task 0141 adds a code to it (#182 stacks on this).

 apps/facilitator/src/settlement/
+├── reasons.ts   # SETTLE_REASONS, UNSENT_REASONS, UNSENT, NOT_SIGN_AGAIN (moved verbatim)
 └── settle.ts    # 1409 → 1245 lines

Importers of SETTLE_REASONS (3 source files, 8 test files) now import it from reasons.ts.
UNSENT and NOT_SIGN_AGAIN gain export, since settle.ts reads them from the new file.

Evidence

Lines added that were not moved (move purity check, whitespace-insensitive):

export const NOT_SIGN_AGAIN = new Set<string>([
export const UNSENT = new Set(UNSENT_REASONS);
import { NOT_SIGN_AGAIN, SETTLE_REASONS, UNSENT, UNSENT_REASONS } from "./reasons.js";
import { PAYER_AUTH_REASON, UNSUPPORTED_CREDENTIAL_REASON } from "./verify.js";
import { SETTLE_REASONS } from "…/reasons.js";            (11 importers)
import { createSettler, … } from "…/settle.js";          (5 importers, SETTLE_REASONS dropped)
  • Before / after: facilitator tests 1012 passed | 3 skipped, no test assertion changed; typecheck,
    lint and format clean.

Merge Danger

Door: two-way

Blast Radius: none

🤖 Generated with Claude Code

settle.ts is past 1,400 lines and every new settle code grew it. The
reason table (SETTLE_REASONS, UNSENT_REASONS, UNSENT, NOT_SIGN_AGAIN)
moves verbatim to reasons.ts; importers point there. No behaviour change.

Co-Authored-By: Claude <209825114+claude[bot]@users.noreply.github.com>
@karolko9
karolko9 merged commit 4b09cba into develop Nov 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant