Skip to content

Commit cbf0e7a

Browse files
authored
ref(billing): Use Reservations type in CheckoutAPIData (#103910)
Closes https://linear.app/getsentry/issue/BIL-956/dynamic-reservations Continues from #103855. Replaces template literal type `Partial<Record<`reserved${Capitalize<DataCategory>}`, number>>` with the new `Reservations` mapped type introduced in BIL-956.
1 parent 1fa6e7a commit cbf0e7a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

static/gsApp/views/amCheckout/types.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {Client} from 'sentry/api';
22
import type {DataCategory} from 'sentry/types/core';
33
import type {Organization} from 'sentry/types/organization';
44

5+
import type {Reservations} from 'getsentry/components/upgradeNowModal/types';
56
import type {
67
AddOnCategory,
78
BillingConfig,
@@ -29,7 +30,7 @@ export type CheckoutAPIData = Omit<BaseCheckoutData, 'addOns'> & {
2930
paymentIntent?: string;
3031
previewToken?: string;
3132
referrer?: string;
32-
} & Partial<Record<`reserved${Capitalize<DataCategory>}`, number>> &
33+
} & Partial<Reservations> &
3334
Partial<Record<`addOn${Capitalize<AddOnCategory>}`, boolean>>;
3435

3536
type BaseStepProps = {

static/gsApp/views/amCheckout/utils.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {toTitleCase} from 'sentry/utils/string/toTitleCase';
2020
import normalizeUrl from 'sentry/utils/url/normalizeUrl';
2121
import useApi from 'sentry/utils/useApi';
2222

23+
import type {Reservations} from 'getsentry/components/upgradeNowModal/types';
2324
import {
2425
DEFAULT_TIER,
2526
MONTHLY,
@@ -541,7 +542,7 @@ export function getCheckoutAPIData({
541542
})}`,
542543
formatReservedData(value),
543544
])
544-
) satisfies Partial<Record<`reserved${Capitalize<DataCategory>}`, number>>;
545+
) satisfies Partial<Reservations>;
545546

546547
const onDemandMaxSpend = shouldUpdateOnDemand
547548
? (formData.onDemandMaxSpend ?? 0)

0 commit comments

Comments
 (0)