diff --git a/src/graphql/advertiser.generated.tsx b/src/graphql/advertiser.generated.tsx index 09b5c837d..ba5f553aa 100644 --- a/src/graphql/advertiser.generated.tsx +++ b/src/graphql/advertiser.generated.tsx @@ -280,10 +280,25 @@ export function useAdvertiserLazyQuery( options, ); } +export function useAdvertiserSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserQuery, + AdvertiserQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + AdvertiserDocument, + options, + ); +} export type AdvertiserQueryHookResult = ReturnType; export type AdvertiserLazyQueryHookResult = ReturnType< typeof useAdvertiserLazyQuery >; +export type AdvertiserSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserSuspenseQuery +>; export type AdvertiserQueryResult = Apollo.QueryResult< AdvertiserQuery, AdvertiserQueryVariables @@ -392,12 +407,27 @@ export function useAdvertiserCampaignsLazyQuery( AdvertiserCampaignsQueryVariables >(AdvertiserCampaignsDocument, options); } +export function useAdvertiserCampaignsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserCampaignsQuery, + AdvertiserCampaignsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AdvertiserCampaignsQuery, + AdvertiserCampaignsQueryVariables + >(AdvertiserCampaignsDocument, options); +} export type AdvertiserCampaignsQueryHookResult = ReturnType< typeof useAdvertiserCampaignsQuery >; export type AdvertiserCampaignsLazyQueryHookResult = ReturnType< typeof useAdvertiserCampaignsLazyQuery >; +export type AdvertiserCampaignsSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserCampaignsSuspenseQuery +>; export type AdvertiserCampaignsQueryResult = Apollo.QueryResult< AdvertiserCampaignsQuery, AdvertiserCampaignsQueryVariables @@ -458,12 +488,27 @@ export function useAdvertiserImagesLazyQuery( AdvertiserImagesQueryVariables >(AdvertiserImagesDocument, options); } +export function useAdvertiserImagesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserImagesQuery, + AdvertiserImagesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AdvertiserImagesQuery, + AdvertiserImagesQueryVariables + >(AdvertiserImagesDocument, options); +} export type AdvertiserImagesQueryHookResult = ReturnType< typeof useAdvertiserImagesQuery >; export type AdvertiserImagesLazyQueryHookResult = ReturnType< typeof useAdvertiserImagesLazyQuery >; +export type AdvertiserImagesSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserImagesSuspenseQuery +>; export type AdvertiserImagesQueryResult = Apollo.QueryResult< AdvertiserImagesQuery, AdvertiserImagesQueryVariables @@ -524,12 +569,27 @@ export function useAdvertiserPricesLazyQuery( AdvertiserPricesQueryVariables >(AdvertiserPricesDocument, options); } +export function useAdvertiserPricesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserPricesQuery, + AdvertiserPricesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AdvertiserPricesQuery, + AdvertiserPricesQueryVariables + >(AdvertiserPricesDocument, options); +} export type AdvertiserPricesQueryHookResult = ReturnType< typeof useAdvertiserPricesQuery >; export type AdvertiserPricesLazyQueryHookResult = ReturnType< typeof useAdvertiserPricesLazyQuery >; +export type AdvertiserPricesSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserPricesSuspenseQuery +>; export type AdvertiserPricesQueryResult = Apollo.QueryResult< AdvertiserPricesQuery, AdvertiserPricesQueryVariables diff --git a/src/graphql/analytics-overview.generated.tsx b/src/graphql/analytics-overview.generated.tsx index e7a45bebb..4e65134a6 100644 --- a/src/graphql/analytics-overview.generated.tsx +++ b/src/graphql/analytics-overview.generated.tsx @@ -220,12 +220,27 @@ export function useAnalyticOverviewLazyQuery( AnalyticOverviewQueryVariables >(AnalyticOverviewDocument, options); } +export function useAnalyticOverviewSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AnalyticOverviewQuery, + AnalyticOverviewQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AnalyticOverviewQuery, + AnalyticOverviewQueryVariables + >(AnalyticOverviewDocument, options); +} export type AnalyticOverviewQueryHookResult = ReturnType< typeof useAnalyticOverviewQuery >; export type AnalyticOverviewLazyQueryHookResult = ReturnType< typeof useAnalyticOverviewLazyQuery >; +export type AnalyticOverviewSuspenseQueryHookResult = ReturnType< + typeof useAnalyticOverviewSuspenseQuery +>; export type AnalyticOverviewQueryResult = Apollo.QueryResult< AnalyticOverviewQuery, AnalyticOverviewQueryVariables @@ -289,12 +304,27 @@ export function useEngagementOverviewLazyQuery( EngagementOverviewQueryVariables >(EngagementOverviewDocument, options); } +export function useEngagementOverviewSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + EngagementOverviewQuery, + EngagementOverviewQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + EngagementOverviewQuery, + EngagementOverviewQueryVariables + >(EngagementOverviewDocument, options); +} export type EngagementOverviewQueryHookResult = ReturnType< typeof useEngagementOverviewQuery >; export type EngagementOverviewLazyQueryHookResult = ReturnType< typeof useEngagementOverviewLazyQuery >; +export type EngagementOverviewSuspenseQueryHookResult = ReturnType< + typeof useEngagementOverviewSuspenseQuery +>; export type EngagementOverviewQueryResult = Apollo.QueryResult< EngagementOverviewQuery, EngagementOverviewQueryVariables diff --git a/src/graphql/campaign.generated.tsx b/src/graphql/campaign.generated.tsx index b212b0ec3..82425b8b3 100644 --- a/src/graphql/campaign.generated.tsx +++ b/src/graphql/campaign.generated.tsx @@ -560,12 +560,27 @@ export function useLoadCampaignLazyQuery( options, ); } +export function useLoadCampaignSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + LoadCampaignQuery, + LoadCampaignQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + LoadCampaignDocument, + options, + ); +} export type LoadCampaignQueryHookResult = ReturnType< typeof useLoadCampaignQuery >; export type LoadCampaignLazyQueryHookResult = ReturnType< typeof useLoadCampaignLazyQuery >; +export type LoadCampaignSuspenseQueryHookResult = ReturnType< + typeof useLoadCampaignSuspenseQuery +>; export type LoadCampaignQueryResult = Apollo.QueryResult< LoadCampaignQuery, LoadCampaignQueryVariables @@ -624,12 +639,27 @@ export function useLoadCampaignAdsLazyQuery( LoadCampaignAdsQueryVariables >(LoadCampaignAdsDocument, options); } +export function useLoadCampaignAdsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + LoadCampaignAdsQuery, + LoadCampaignAdsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + LoadCampaignAdsQuery, + LoadCampaignAdsQueryVariables + >(LoadCampaignAdsDocument, options); +} export type LoadCampaignAdsQueryHookResult = ReturnType< typeof useLoadCampaignAdsQuery >; export type LoadCampaignAdsLazyQueryHookResult = ReturnType< typeof useLoadCampaignAdsLazyQuery >; +export type LoadCampaignAdsSuspenseQueryHookResult = ReturnType< + typeof useLoadCampaignAdsSuspenseQuery +>; export type LoadCampaignAdsQueryResult = Apollo.QueryResult< LoadCampaignAdsQuery, LoadCampaignAdsQueryVariables diff --git a/src/graphql/common.generated.tsx b/src/graphql/common.generated.tsx index 216734e0e..4ad041a7c 100644 --- a/src/graphql/common.generated.tsx +++ b/src/graphql/common.generated.tsx @@ -83,12 +83,27 @@ export function useActiveGeocodesLazyQuery( options, ); } +export function useActiveGeocodesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + ActiveGeocodesQuery, + ActiveGeocodesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + ActiveGeocodesQuery, + ActiveGeocodesQueryVariables + >(ActiveGeocodesDocument, options); +} export type ActiveGeocodesQueryHookResult = ReturnType< typeof useActiveGeocodesQuery >; export type ActiveGeocodesLazyQueryHookResult = ReturnType< typeof useActiveGeocodesLazyQuery >; +export type ActiveGeocodesSuspenseQueryHookResult = ReturnType< + typeof useActiveGeocodesSuspenseQuery +>; export type ActiveGeocodesQueryResult = Apollo.QueryResult< ActiveGeocodesQuery, ActiveGeocodesQueryVariables @@ -145,10 +160,25 @@ export function useSegmentsLazyQuery( options, ); } +export function useSegmentsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + SegmentsQuery, + SegmentsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + SegmentsDocument, + options, + ); +} export type SegmentsQueryHookResult = ReturnType; export type SegmentsLazyQueryHookResult = ReturnType< typeof useSegmentsLazyQuery >; +export type SegmentsSuspenseQueryHookResult = ReturnType< + typeof useSegmentsSuspenseQuery +>; export type SegmentsQueryResult = Apollo.QueryResult< SegmentsQuery, SegmentsQueryVariables diff --git a/src/graphql/creative.generated.tsx b/src/graphql/creative.generated.tsx index 72f8bfb45..101fa7d1d 100644 --- a/src/graphql/creative.generated.tsx +++ b/src/graphql/creative.generated.tsx @@ -365,12 +365,27 @@ export function useAdvertiserCreativesLazyQuery( AdvertiserCreativesQueryVariables >(AdvertiserCreativesDocument, options); } +export function useAdvertiserCreativesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + AdvertiserCreativesQuery, + AdvertiserCreativesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + AdvertiserCreativesQuery, + AdvertiserCreativesQueryVariables + >(AdvertiserCreativesDocument, options); +} export type AdvertiserCreativesQueryHookResult = ReturnType< typeof useAdvertiserCreativesQuery >; export type AdvertiserCreativesLazyQueryHookResult = ReturnType< typeof useAdvertiserCreativesLazyQuery >; +export type AdvertiserCreativesSuspenseQueryHookResult = ReturnType< + typeof useAdvertiserCreativesSuspenseQuery +>; export type AdvertiserCreativesQueryResult = Apollo.QueryResult< AdvertiserCreativesQuery, AdvertiserCreativesQueryVariables @@ -532,12 +547,27 @@ export function useLoadCreativeLazyQuery( options, ); } +export function useLoadCreativeSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + LoadCreativeQuery, + LoadCreativeQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + LoadCreativeDocument, + options, + ); +} export type LoadCreativeQueryHookResult = ReturnType< typeof useLoadCreativeQuery >; export type LoadCreativeLazyQueryHookResult = ReturnType< typeof useLoadCreativeLazyQuery >; +export type LoadCreativeSuspenseQueryHookResult = ReturnType< + typeof useLoadCreativeSuspenseQuery +>; export type LoadCreativeQueryResult = Apollo.QueryResult< LoadCreativeQuery, LoadCreativeQueryVariables @@ -598,12 +628,27 @@ export function useCampaignsForCreativeLazyQuery( CampaignsForCreativeQueryVariables >(CampaignsForCreativeDocument, options); } +export function useCampaignsForCreativeSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + CampaignsForCreativeQuery, + CampaignsForCreativeQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + CampaignsForCreativeQuery, + CampaignsForCreativeQueryVariables + >(CampaignsForCreativeDocument, options); +} export type CampaignsForCreativeQueryHookResult = ReturnType< typeof useCampaignsForCreativeQuery >; export type CampaignsForCreativeLazyQueryHookResult = ReturnType< typeof useCampaignsForCreativeLazyQuery >; +export type CampaignsForCreativeSuspenseQueryHookResult = ReturnType< + typeof useCampaignsForCreativeSuspenseQuery +>; export type CampaignsForCreativeQueryResult = Apollo.QueryResult< CampaignsForCreativeQuery, CampaignsForCreativeQueryVariables diff --git a/src/graphql/types.ts b/src/graphql/types.ts index ae387a3c1..0e3d2a090 100644 --- a/src/graphql/types.ts +++ b/src/graphql/types.ts @@ -58,8 +58,7 @@ export type ApproveCampaignInput = { export enum BillingType { Cpc = "CPC", Cpm = "CPM", - Cpqv = "CPQV", - Cpv = "CPV", + Cpsv = "CPSV", } export type CampaignFilter = { @@ -333,7 +332,7 @@ export type FocalPointInput = { export type GeocodeInput = { code: Scalars["String"]["input"]; - name: Scalars["String"]["input"]; + name?: InputMaybe; }; export type InPagePayloadInput = { diff --git a/src/graphql/url.generated.tsx b/src/graphql/url.generated.tsx index 4ca1df76e..7a4592e6c 100644 --- a/src/graphql/url.generated.tsx +++ b/src/graphql/url.generated.tsx @@ -72,12 +72,27 @@ export function useValidateTargetUrlLazyQuery( ValidateTargetUrlQueryVariables >(ValidateTargetUrlDocument, options); } +export function useValidateTargetUrlSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + ValidateTargetUrlQuery, + ValidateTargetUrlQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + ValidateTargetUrlQuery, + ValidateTargetUrlQueryVariables + >(ValidateTargetUrlDocument, options); +} export type ValidateTargetUrlQueryHookResult = ReturnType< typeof useValidateTargetUrlQuery >; export type ValidateTargetUrlLazyQueryHookResult = ReturnType< typeof useValidateTargetUrlLazyQuery >; +export type ValidateTargetUrlSuspenseQueryHookResult = ReturnType< + typeof useValidateTargetUrlSuspenseQuery +>; export type ValidateTargetUrlQueryResult = Apollo.QueryResult< ValidateTargetUrlQuery, ValidateTargetUrlQueryVariables diff --git a/src/graphql/user.generated.tsx b/src/graphql/user.generated.tsx index 39cb4e855..352e7d6c4 100644 --- a/src/graphql/user.generated.tsx +++ b/src/graphql/user.generated.tsx @@ -80,10 +80,25 @@ export function useLoadUserLazyQuery( options, ); } +export function useLoadUserSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + LoadUserQuery, + LoadUserQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + LoadUserDocument, + options, + ); +} export type LoadUserQueryHookResult = ReturnType; export type LoadUserLazyQueryHookResult = ReturnType< typeof useLoadUserLazyQuery >; +export type LoadUserSuspenseQueryHookResult = ReturnType< + typeof useLoadUserSuspenseQuery +>; export type LoadUserQueryResult = Apollo.QueryResult< LoadUserQuery, LoadUserQueryVariables diff --git a/src/user/library/index.test.ts b/src/user/library/index.test.ts index df4cabae6..582f501f7 100644 --- a/src/user/library/index.test.ts +++ b/src/user/library/index.test.ts @@ -182,9 +182,9 @@ describe("pricing logic (write)", () => { expect(result).toEqual("9"); }); - it("should not convert CPQV to per-impression values when populating a CPQV creative", () => { + it("should not convert CPSV to per-impression values when populating a CPSV creative", () => { const result = transformPrice({ - billingType: "cpqv", + billingType: "cpsv", price: "9", }); diff --git a/src/user/views/adsManager/types/index.ts b/src/user/views/adsManager/types/index.ts index 2e8437ca0..703010b0a 100644 --- a/src/user/views/adsManager/types/index.ts +++ b/src/user/views/adsManager/types/index.ts @@ -3,7 +3,7 @@ import { defaultEndDate, defaultStartDate } from "form/DateFieldHelpers"; import { MIN_PER_CAMPAIGN } from "validation/CampaignSchema"; import { AdvertiserWithPrices } from "user/hooks/useAdvertiserWithPrices"; -export type Billing = "cpm" | "cpc" | "cpqv"; +export type Billing = "cpm" | "cpc" | "cpsv"; export type CampaignForm = { id?: string; diff --git a/src/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField.tsx b/src/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField.tsx index 55c85482b..5d888364e 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField.tsx @@ -106,9 +106,9 @@ export function BudgetField(props: { prices: AdvertiserPriceFragment[] }) { disabled: isBillingTypeDisabled("cpc") && !isDraft, }, { - value: "cpqv", - label: uiLabelsForBillingType("cpqv").longLabel, - disabled: isBillingTypeDisabled("cpqv") && !isDraft, + value: "cpsv", + label: uiLabelsForBillingType("cpsv").longLabel, + disabled: isBillingTypeDisabled("cpsv") && !isDraft, }, ]} /> diff --git a/src/util/billingType.ts b/src/util/billingType.ts index 6ac716d15..24ffc18d3 100644 --- a/src/util/billingType.ts +++ b/src/util/billingType.ts @@ -7,7 +7,7 @@ interface BillingTypeLabels { const BILLING_TYPES = [ { value: "cpm", shortLabel: "CPM", longLabel: "CPM (Views)" }, { value: "cpc", shortLabel: "CPC", longLabel: "CPC (Clicks)" }, - { value: "cpqv", shortLabel: "CPQV", longLabel: "CPQV (Qualified Visits)" }, + { value: "cpsv", shortLabel: "CPSV", longLabel: "CPsV (Site Visits)" }, ]; export function uiLabelsForBillingType( billingType: string | undefined | null, diff --git a/src/validation/CampaignSchema.tsx b/src/validation/CampaignSchema.tsx index 35e02e4c5..c1da31beb 100644 --- a/src/validation/CampaignSchema.tsx +++ b/src/validation/CampaignSchema.tsx @@ -119,15 +119,15 @@ export const CampaignSchema = (prices: AdvertiserPriceFragment[]) => findPrice( prices, [CampaignFormat.NewsDisplayAd, CampaignFormat.PushNotification], - BillingType.Cpqv, - "1.5", + BillingType.Cpsv, + "3", schema, ), }) .required("Price is a required field"), billingType: string() .label("Pricing Type") - .oneOf(["cpm", "cpc", "cpqv"]) + .oneOf(["cpm", "cpc", "cpsv"]) .required("Pricing type is a required field"), adSets: array() .min(1)