Skip to content

feat(payment_terms): Backfill customers and billing_entities - #6142

Open
D1353L wants to merge 1 commit into
feat-payment-terms-aliasfrom
feat-payment-terms-backfill
Open

feat(payment_terms): Backfill customers and billing_entities#6142
D1353L wants to merge 1 commit into
feat-payment-terms-aliasfrom
feat-payment-terms-backfill

Conversation

@D1353L

@D1353L D1353L commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Context

The new payment_term field needs to be backfilled for existing customers and billing entities. Equivalent:
Legacy net_payment_terms: N days -> { term_type: "net", days: N }

Description

  • Migration for backfilling customers and billing_entities tables.
  • As the customers table is large, updates are processed in batches of 10k records.
  • MigrationCustomer is used as an ActiveRecord stub to avoid "Undeclared attribute type for enum" errors.

Stack created with GitHub Stacks CLIGive Feedback 💬

@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch 2 times, most recently from 83b45f2 to be4262e Compare August 13, 2026 15:53
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from be4262e to 2b7d431 Compare August 13, 2026 15:55
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch 3 times, most recently from 9c2c4a4 to 0815404 Compare August 17, 2026 18:29
@D1353L
D1353L changed the base branch from feat-payment-terms-graphql to feat-payment-terms-services August 18, 2026 08:52
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 0815404 to 1969ae9 Compare August 19, 2026 10:03
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 1969ae9 to fde53e8 Compare August 19, 2026 11:26
@D1353L
D1353L changed the base branch from feat-payment-terms-services to feat-payment-terms-alias August 19, 2026 11:26
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from fde53e8 to 78f4a8d Compare August 19, 2026 11:40
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 78f4a8d to 9592c88 Compare August 19, 2026 11:55
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch 2 times, most recently from 78f4a8d to 5c1f42a Compare August 19, 2026 13:47
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 5c1f42a to 35a63fa Compare August 19, 2026 15:33
@D1353L D1353L changed the title feat(payment_terms): Backfill and nullable column migrations feat(payment_terms): Backfill customers and billing_entities Aug 19, 2026
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch 2 times, most recently from de9658a to 54540eb Compare August 19, 2026 16:06
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 54540eb to 9a8b665 Compare August 19, 2026 17:16
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 9a8b665 to 8480c3e Compare August 19, 2026 17:58
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch 2 times, most recently from 586b907 to 75b667c Compare August 21, 2026 14:53
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 75b667c to 5bb2faf Compare August 21, 2026 16:02
@D1353L
D1353L marked this pull request as ready for review August 24, 2026 13:29
@lago-claude-ai-agent

This comment was marked as low quality.

@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 2963b6e to 4226370 Compare August 25, 2026 13:09
@lago-claude-ai-agent

This comment was marked as outdated.

@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 4226370 to be94d6a Compare August 25, 2026 14:21
@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from be94d6a to 5d5d3ec Compare August 25, 2026 14:22
@lago-claude-ai-agent

Copy link
Copy Markdown
Contributor

Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green

HOLD — The new data migration has no test coverage.

  • Add a migration spec covering both customers and billing entities, including backfilling legacy values while preserving existing payment_term values and customer rows whose legacy value is null.

@D1353L
D1353L force-pushed the feat-payment-terms-backfill branch from 5d5d3ec to 0b50560 Compare August 26, 2026 16:24
@lago-claude-ai-agent

Copy link
Copy Markdown
Contributor

Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green

HOLD — the backfill matches the structured net representation and preserves existing JSONB values, but the migration has no behavioral coverage.

  • Add an executable migration spec covering both customers and billing entities, including null legacy terms and pre-existing payment_term values, so the backfill and skip conditions are protected.

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