Skip to content

PM-4686: block challenge activation for invalid billing accounts#86

Merged
jmgasper merged 1 commit intodevelopfrom
PM-4686
Apr 2, 2026
Merged

PM-4686: block challenge activation for invalid billing accounts#86
jmgasper merged 1 commit intodevelopfrom
PM-4686

Conversation

@jmgasper
Copy link
Copy Markdown
Contributor

@jmgasper jmgasper commented Apr 2, 2026

What was broken
Challenges tied to projects could still be activated when the linked billing account was inactive, expired, or had no remaining budget.

Root cause
Activation validation only checked whether a project billing account id existed. It did not verify billing-account lifecycle state or remaining funds against the billing account data.

What was changed
Added billing-account detail lookup support in the project helper, including normalized active, end-date, status, and remaining-budget fields.
Updated challenge activation validation to block project-backed launches when the billing account is missing, inactive, expired, not found, or has no remaining funds.
Wired the billing account validation into challenge status updates while preserving the existing project billing-account persistence flow.

Any added/updated tests
Added focused unit coverage for the new activation billing-account validation paths.
Updated challenge service tests to cover inactive, expired, insufficient-funds, and valid billing-account activation scenarios.
Validation notes: pnpm lint passed. pnpm build could not run because this repo has no build script. pnpm test still fails in pre-existing TimelineTemplateService tests unrelated to this change, while the focused billing-account unit tests pass.

What was broken
Challenges tied to projects could still be activated when the linked billing account was inactive, expired, or had no remaining budget.

Root cause
Activation validation only checked whether a project billing account id existed. It did not verify billing-account lifecycle state or remaining funds against the billing account data.

What was changed
Added billing-account detail lookup support in the project helper, including normalized active, end-date, status, and remaining-budget fields.
Updated challenge activation validation to block project-backed launches when the billing account is missing, inactive, expired, not found, or has no remaining funds.
Wired the billing account validation into challenge status updates while preserving the existing project billing-account persistence flow.

Any added/updated tests
Added focused unit coverage for the new activation billing-account validation paths.
Updated challenge service tests to cover inactive, expired, insufficient-funds, and valid billing-account activation scenarios.
@jmgasper jmgasper merged commit b8190e6 into develop Apr 2, 2026
6 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