Skip to content

WIP: Add codegen to make adding new bank account locations easier#168

Draft
ezraripps wants to merge 15 commits intomainfrom
feature/start-supporting-more-rails
Draft

WIP: Add codegen to make adding new bank account locations easier#168
ezraripps wants to merge 15 commits intomainfrom
feature/start-supporting-more-rails

Conversation

@ezraripps
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a small codegen pipeline for asset-movement bank-account “address” types/schemas, so new bank account location schemas can be added by dropping in a new file rather than manually editing large union types.

Changes:

  • Introduces JSON-schema-like definitions for bank account address variants and shared schema fragments.
  • Adds scripts + Makefile rules to generate index.generated.ts and types.generated.ts for address schemas.
  • Updates asset-movement/common.ts to re-export and consume the generated address types.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
utils/run-ts Improves selection of the compiled JS entrypoint when tsc emits multiple files.
src/services/asset-movement/lib/data/types.ts Adds BankAccountAddressSchema + shared schema fragments/references.
src/services/asset-movement/lib/data/json-schema.ts Adds a minimal JSON-schema type subset used by schema definitions.
src/services/asset-movement/lib/data/scripts/generator.ts Generates TypeScript types + exported JSON schema from address definitions.
src/services/asset-movement/lib/data/scripts/generate-index.sh Generates an index module aggregating all address schema files.
src/services/asset-movement/lib/data/addresses/{us,pix,interac,iban-swift,clabe}.ts Defines per-location bank-account schema fragments.
src/services/asset-movement/common.ts Switches bank account address types to generated ones; re-exports generated artifacts.
Makefile Adds generation steps and cleans generated address files.
.gitignore Ignores generated asset-movement address .generated.ts files.
package.json / package-lock.json Adds json-schema-to-typescript as a dev dependency.
.cspell.config.mjs Adds interac to dictionary.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 16 changed files in this pull request and generated 5 comments.

Makefile Outdated
Comment on lines 57 to 58
rm -f ./src/services/asset-movement/lib/data/addresses/index.generated.ts
mv ./src/services/asset-movement/lib/data/addresses/index.generated.ts.tmp ./src/services/asset-movement/lib/data/addresses/index.generated.ts
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rule always deletes and rewrites index.generated.ts even if the content didn’t change, which can force unnecessary downstream rebuilds. Consider writing to a temp file and only replacing the target when the contents differ (e.g., cmp -s), otherwise keep the existing file.

Suggested change
rm -f ./src/services/asset-movement/lib/data/addresses/index.generated.ts
mv ./src/services/asset-movement/lib/data/addresses/index.generated.ts.tmp ./src/services/asset-movement/lib/data/addresses/index.generated.ts
@if [ -f ./src/services/asset-movement/lib/data/addresses/index.generated.ts ] && cmp -s ./src/services/asset-movement/lib/data/addresses/index.generated.ts.tmp ./src/services/asset-movement/lib/data/addresses/index.generated.ts; then \
rm ./src/services/asset-movement/lib/data/addresses/index.generated.ts.tmp; \
else \
mv ./src/services/asset-movement/lib/data/addresses/index.generated.ts.tmp ./src/services/asset-movement/lib/data/addresses/index.generated.ts; \
fi

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

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