Skip to content

Commit c09761a

Browse files
authored
Fix handler typo in billing alerts (#1045)
* fixing typo * changing var name & fixing describe title * updating alerttype
1 parent 2b83e1d commit c09761a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

spec/v2/providers/alerts/billing.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,25 @@ describe('billing', () => {
4343
});
4444
});
4545

46-
describe('onAutomatedPlanUpdatePublished', () => {
46+
describe('onPlanAutomatedUpdatePublished', () => {
4747
it('should create a function with only handler', () => {
48-
const func = billing.onAutomatedPlanUpdatePublished(myHandler);
48+
const func = billing.onPlanAutomatedUpdatePublished(myHandler);
4949

5050
expect(func.__endpoint).to.deep.equal({
5151
platform: 'gcfv2',
5252
labels: {},
5353
eventTrigger: {
5454
eventType: alerts.eventType,
5555
eventFilters: {
56-
alertType: billing.automatedPlanUpdateAlert,
56+
alertType: billing.planAutomatedUpdateAlert,
5757
},
5858
retry: false,
5959
},
6060
});
6161
});
6262

6363
it('should create a function with opts & handler', () => {
64-
const func = billing.onAutomatedPlanUpdatePublished(
64+
const func = billing.onPlanAutomatedUpdatePublished(
6565
{ ...FULL_OPTIONS },
6666
myHandler
6767
);
@@ -71,7 +71,7 @@ describe('billing', () => {
7171
eventTrigger: {
7272
eventType: alerts.eventType,
7373
eventFilters: {
74-
alertType: billing.automatedPlanUpdateAlert,
74+
alertType: billing.planAutomatedUpdateAlert,
7575
},
7676
retry: false,
7777
},

src/v2/providers/alerts/billing.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export type BillingEvent<T> = CloudEvent<FirebaseAlertData<T>, WithAlertType>;
3232
/** @internal */
3333
export const planUpdateAlert = 'billing.planUpdate';
3434
/** @internal */
35-
export const automatedPlanUpdateAlert = 'billing.automatedPlanUpdate';
35+
export const planAutomatedUpdateAlert = 'billing.planAutomatedUpdate';
3636

3737
/**
3838
* Declares a function that can handle a billing plan update event.
@@ -60,18 +60,18 @@ export function onPlanUpdatePublished(
6060
/**
6161
* Declares a function that can handle an automated billing plan update event.
6262
*/
63-
export function onAutomatedPlanUpdatePublished(
63+
export function onPlanAutomatedUpdatePublished(
6464
handler: (
6565
event: BillingEvent<PlanAutomatedUpdatePayload>
6666
) => any | Promise<any>
6767
): CloudFunction<FirebaseAlertData<PlanAutomatedUpdatePayload>>;
68-
export function onAutomatedPlanUpdatePublished(
68+
export function onPlanAutomatedUpdatePublished(
6969
opts: options.EventHandlerOptions,
7070
handler: (
7171
event: BillingEvent<PlanAutomatedUpdatePayload>
7272
) => any | Promise<any>
7373
): CloudFunction<FirebaseAlertData<PlanAutomatedUpdatePayload>>;
74-
export function onAutomatedPlanUpdatePublished(
74+
export function onPlanAutomatedUpdatePublished(
7575
optsOrHandler:
7676
| options.EventHandlerOptions
7777
| ((event: BillingEvent<PlanAutomatedUpdatePayload>) => any | Promise<any>),
@@ -80,7 +80,7 @@ export function onAutomatedPlanUpdatePublished(
8080
) => any | Promise<any>
8181
): CloudFunction<FirebaseAlertData<PlanAutomatedUpdatePayload>> {
8282
return onOperation<PlanAutomatedUpdatePayload>(
83-
automatedPlanUpdateAlert,
83+
planAutomatedUpdateAlert,
8484
optsOrHandler,
8585
handler
8686
);

0 commit comments

Comments
 (0)