Skip to content

simplify wallet-preparation to 1:1, remove random chooser#629

Merged
parkan merged 2 commits intomainfrom
feat/remove-random-wallet-chooser
Feb 26, 2026
Merged

simplify wallet-preparation to 1:1, remove random chooser#629
parkan merged 2 commits intomainfrom
feat/remove-random-wallet-chooser

Conversation

@parkan
Copy link
Collaborator

@parkan parkan commented Feb 26, 2026

  • preparation.wallets many2many → preparation.wallet_id direct FK (1:1)
  • remove WalletChooser interface, RandomWalletChooser, DatacapWalletChooser (dead code)
  • dealpusher reads schedule.Preparation.Wallet directly instead of picking randomly
  • migration backfills wallet_id for single-wallet preps, warns on multi-wallet, drops wallet_assignments

multiple wallets per prep only made sense with DatacapWalletChooser which was never wired. RandomWalletChooser had unclear purpose

@parkan parkan force-pushed the feat/remove-random-wallet-chooser branch 2 times, most recently from 6a81dc4 to 96fa4fc Compare February 26, 2026 15:59
@parkan parkan force-pushed the feat/remove-random-wallet-chooser branch from 96fa4fc to 366e0e5 Compare February 26, 2026 16:03
@parkan parkan requested a review from anjor February 26, 2026 16:30
Copy link
Collaborator

@anjor anjor left a comment

Choose a reason for hiding this comment

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

Approved.

Non-blocking follow-ups:

  1. In migrateWalletAssignments, consider guarding against 0-row UPDATEs for stale/malformed wallet_assignments rows before dropping the table, to avoid silent data loss in edge-case legacy DBs.
  2. Add migration-focused tests for wallet_assignments -> preparations.wallet_id (single wallet, multi-wallet, and malformed legacy rows) to harden this schema transition.

@parkan parkan merged commit 34f33ba into main Feb 26, 2026
1 check passed
@parkan parkan deleted the feat/remove-random-wallet-chooser branch February 26, 2026 20:59
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.

2 participants