Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/billing-web/e2e/fixtures/scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export function capabilitiesWith(
can_reactivate: false,
can_revert_scheduled_change: false,
can_run_workflows: true,
can_set_budgets: false,
can_set_hard_caps: false,
can_subscribe_self_serve: true,
can_top_up: true,
can_upgrade: true,
Expand Down
1 change: 1 addition & 0 deletions apps/billing-web/src/checkout/endingScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const REFUSAL_COPY: Readonly<Record<CapabilityDenialReason, RefusalCopy>> = {
no_upgrade_available: 'unknown',
partner_governance_not_entitled: 'unknown',
plan_ending: 'unknown',
plan_not_enterprise: 'unknown',
project_cap_exceeded: 'unknown',
rollout_disabled: 'unknown',
sales_managed: 'sales_managed',
Expand Down
2 changes: 2 additions & 0 deletions apps/billing-web/src/session/billingWebClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ describe('createHandoffBillingClient', () => {
can_reactivate: false,
can_revert_scheduled_change: false,
can_run_workflows: true,
can_set_budgets: false,
can_set_hard_caps: false,
can_subscribe_self_serve: true,
can_top_up: true,
can_upgrade: true,
Expand Down
2 changes: 2 additions & 0 deletions apps/billing-web/src/test/fakeBillingClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ export function createFakeBillingClient(
can_reactivate: false,
can_revert_scheduled_change: false,
can_run_workflows: false,
can_set_budgets: false,
can_set_hard_caps: false,
can_subscribe_self_serve: false,
can_top_up: false,
can_upgrade: false,
Expand Down
1 change: 1 addition & 0 deletions browser_tests/fixtures/data/autoTopUpAtCheckout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const FIFTY_DOLLAR_QUOTE: TopupQuoteResponse = {
}

export const AUTO_TOP_UP_OFF: AutoReloadSettings = {
auto_top_up_conflict: false,
card_expiry: null,
configured: false,
cycle_resets_at: null,
Expand Down
2 changes: 2 additions & 0 deletions browser_tests/fixtures/data/billingCapabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export function createBillingCapabilities(
can_manage_subscription: true,
can_open_plans: true,
can_run_workflows: false,
can_set_budgets: false,
can_set_hard_caps: false,
can_upgrade: false,
can_reactivate: false,
can_revert_scheduled_change: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ describe('autoTopUpActivationFor', () => {

function settings(status: AutoReloadSettings['status']): AutoReloadSettings {
return {
auto_top_up_conflict: false,
card_expiry: null,
configured: false,
cycle_resets_at: null,
Expand Down
1 change: 1 addition & 0 deletions packages/account-core/src/core/billing/autoTopUp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function fakeSession(initial: SessionSnapshot = authenticated(credential())) {
}

const SETTINGS = {
auto_top_up_conflict: false,
card_expiring_soon: false,
card_expiry: { expired: false, month: 4, year: 2030 },
configured: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
} from './autoTopUpCard'

const settings: AutoReloadSettings = {
auto_top_up_conflict: false,
card_expiry: null,
configured: true,
cycle_resets_at: null,
Expand Down
2 changes: 2 additions & 0 deletions packages/account-core/src/core/billing/capabilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const CAPABILITIES = {
can_manage_subscription: false,
can_open_plans: false,
can_run_workflows: false,
can_set_budgets: false,
can_set_hard_caps: false,
can_upgrade: false,
can_subscribe_self_serve: false,
can_top_up: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const NO_RIGHTS: BillingCapabilities = {
can_reactivate: false,
can_revert_scheduled_change: false,
can_run_workflows: false,
can_set_budgets: false,
can_set_hard_caps: false,
can_subscribe_self_serve: false,
can_top_up: false,
can_upgrade: false
Expand Down
2 changes: 2 additions & 0 deletions packages/account-core/src/core/billing/capabilityDenials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export type CapabilityDenialReason =
| 'no_upgrade_available'
| 'partner_governance_not_entitled'
| 'plan_ending'
| 'plan_not_enterprise'
| 'project_cap_exceeded'
| 'rollout_disabled'
| 'sales_managed'
Expand Down Expand Up @@ -107,6 +108,7 @@ const KNOWN_REASONS: Readonly<
no_upgrade_available: true,
partner_governance_not_entitled: true,
plan_ending: true,
plan_not_enterprise: true,
project_cap_exceeded: true,
rollout_disabled: true,
sales_managed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function capabilities(): Capabilities {
can_reactivate: false,
can_revert_scheduled_change: false,
can_run_workflows: true,
can_set_budgets: false,
can_set_hard_caps: false,
can_subscribe_self_serve: true,
can_top_up: true,
can_upgrade: true
Expand Down Expand Up @@ -81,6 +83,8 @@ expectTypeOf<Capabilities>().toEqualTypeOf<{
can_reactivate: boolean
can_revert_scheduled_change: boolean
can_run_workflows: boolean
can_set_budgets: boolean
can_set_hard_caps: boolean
can_subscribe_self_serve: boolean
can_top_up: boolean
can_upgrade: boolean
Expand Down
3 changes: 3 additions & 0 deletions packages/account-core/src/core/billing/scopedReader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const PLAN = {
}

const AUTO_TOP_UP_OFF = {
auto_top_up_conflict: false,
card_expiry: null,
configured: false,
cycle_resets_at: null,
Expand Down Expand Up @@ -184,6 +185,8 @@ function capabilitiesBody(overrides: Record<string, unknown> = {}) {
can_manage_subscription: false,
can_open_plans: false,
can_run_workflows: false,
can_set_budgets: false,
can_set_hard_caps: false,
can_upgrade: false,
can_subscribe_self_serve: false,
can_top_up: true
Expand Down
2 changes: 2 additions & 0 deletions packages/account-core/src/core/billing/topup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ const CAPABILITIES = {
can_manage_subscription: false,
can_open_plans: false,
can_run_workflows: false,
can_set_budgets: false,
can_set_hard_caps: false,
can_upgrade: false,
can_subscribe_self_serve: false,
can_top_up: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export const CAPABILITIES = {
can_manage_subscription: false,
can_open_plans: false,
can_run_workflows: false,
can_set_budgets: false,
can_set_hard_caps: false,
can_upgrade: false,
can_subscribe_self_serve: true,
can_top_up: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type AutoReloadSettings = Extract<
>['settings']

export const configuredSettings: AutoReloadSettings = {
auto_top_up_conflict: false,
card_expiry: null,
configured: true,
cycle_resets_at: '2026-11-28T00:00:00Z',
Expand Down
12 changes: 8 additions & 4 deletions packages/ingest-types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export type {
BillingOpCancelResponse,
BillingOpChargeBreakdown,
BillingOpChargeReason,
BillingOpOutcomeResponse,
BillingOpReceiptPlan,
BillingOpStatusResponse,
BillingPlansResponse,
Expand Down Expand Up @@ -712,6 +713,11 @@ export type {
GetBillingEventsErrors,
GetBillingEventsResponse,
GetBillingEventsResponses,
GetBillingOpOutcomeData,
GetBillingOpOutcomeError,
GetBillingOpOutcomeErrors,
GetBillingOpOutcomeResponse,
GetBillingOpOutcomeResponses,
GetBillingOpStatusData,
GetBillingOpStatusError,
GetBillingOpStatusErrors,
Expand All @@ -733,14 +739,12 @@ export type {
GetBillingUsageTimeSeriesResponse,
GetBillingUsageTimeSeriesResponses,
GetCatalogAgentInstructionsData,
GetCatalogAgentInstructionsError,
GetCatalogAgentInstructionsErrors,
GetCatalogAgentInstructionsResponse,
GetCatalogAgentInstructionsResponses,
GetCatalogDocsData,
GetCatalogDocsErrors,
GetCatalogDocsResponse,
GetCatalogDocsResponses,
GetCatalogOpenApiData,
GetCatalogOpenApiError,
GetCatalogOpenApiErrors,
GetCatalogOpenApiResponse,
GetCatalogOpenApiResponses,
Expand Down
Loading
Loading