Skip to content

Commit 162b8ca

Browse files
feat: Add ACH related hooks (#3662)
1 parent a910857 commit 162b8ca

File tree

22 files changed

+540
-23
lines changed

22 files changed

+540
-23
lines changed

src/pages/PlanPage/subRoutes/CancelPlanPage/CancelPlanPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
useAvailablePlans,
1010
usePlanData,
1111
} from 'services/account'
12+
import { Provider } from 'shared/api/helpers'
1213
import { BillingRate, shouldDisplayTeamCard } from 'shared/utils/billing'
1314
import Spinner from 'ui/Spinner'
1415

@@ -25,7 +26,7 @@ const Loader = () => (
2526

2627
function CancelPlanPage() {
2728
const { provider, owner } = useParams<{
28-
provider: string
29+
provider: Provider
2930
owner: string
3031
}>()
3132
const { data: accountDetailsData } = useAccountDetails({ provider, owner })

src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/BillingDetails.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { useParams } from 'react-router-dom'
22

33
import { useAccountDetails } from 'services/account'
4+
import { Provider } from 'shared/api/helpers'
45

56
import AddressCard from './Address/AddressCard'
67
import EmailAddress from './EmailAddress'
78
import PaymentCard from './PaymentCard'
89

910
interface URLParams {
10-
provider: string
11+
provider: Provider
1112
owner: string
1213
}
1314

src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/EmailAddress/EmailAddress.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useParams } from 'react-router-dom'
55
import { z } from 'zod'
66

77
import { useAccountDetails, useUpdateBillingEmail } from 'services/account'
8+
import { Provider } from 'shared/api/helpers'
89
import A from 'ui/A'
910
import Button from 'ui/Button'
1011
import Icon from 'ui/Icon'
@@ -18,7 +19,7 @@ const emailSchema = z.object({
1819
})
1920

2021
interface URLParams {
21-
provider: string
22+
provider: Provider
2223
owner: string
2324
}
2425

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useParams } from 'react-router-dom'
33

44
import { usePlanUpdatedNotification } from 'pages/PlanPage/context'
55
import { useAccountDetails, usePlanData } from 'services/account'
6+
import { Provider } from 'shared/api/helpers'
67
import { getScheduleStart } from 'shared/plan/ScheduledPlanDetails/ScheduledPlanDetails'
78
import A from 'ui/A'
89
import { Alert } from 'ui/Alert'
@@ -16,7 +17,7 @@ import LatestInvoiceCard from './LatestInvoiceCard'
1617
import { EnterpriseAccountDetailsQueryOpts } from './queries/EnterpriseAccountDetailsQueryOpts'
1718

1819
interface URLParams {
19-
provider: string
20+
provider: Provider
2021
owner: string
2122
}
2223

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/CurrentPlanCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { useParams } from 'react-router-dom'
22

33
import { useAccountDetails, usePlanData } from 'services/account'
4+
import { Provider } from 'shared/api/helpers'
45
import { CollectionMethods } from 'shared/utils/billing'
56

67
import EnterprisePlanCard from './EnterprisePlanCard'
78
import FreePlanCard from './FreePlanCard'
89
import PaidPlanCard from './PaidPlanCard'
910

1011
interface URLParams {
11-
provider: string
12+
provider: Provider
1213
owner: string
1314
}
1415

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/PaidPlanCard/PaidPlanCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { useParams } from 'react-router-dom'
44

55
import { PlanPageDataQueryOpts } from 'pages/PlanPage/queries/PlanPageDataQueryOpts'
66
import { useAccountDetails, usePlanData } from 'services/account'
7+
import { Provider } from 'shared/api/helpers'
78
import BenefitList from 'shared/plan/BenefitList'
89
import ScheduledPlanDetails from 'shared/plan/ScheduledPlanDetails'
910

1011
import ActionsBilling from '../shared/ActionsBilling/ActionsBilling'
1112
import PlanPricing from '../shared/PlanPricing'
1213

1314
type URLParams = {
14-
provider: string
15+
provider: Provider
1516
owner: string
1617
}
1718

src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/ProPlanController/PriceCallout/PriceCallout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
useAccountDetails,
88
useAvailablePlans,
99
} from 'services/account'
10+
import { Provider } from 'shared/api/helpers'
1011
import {
1112
BillingRate,
1213
findProPlans,
@@ -32,7 +33,7 @@ const PriceCallout: React.FC<PriceCalloutProps> = ({
3233
seats,
3334
setFormValue,
3435
}) => {
35-
const { provider, owner } = useParams<{ provider: string; owner: string }>()
36+
const { provider, owner } = useParams<{ provider: Provider; owner: string }>()
3637
const { data: plans } = useAvailablePlans({ provider, owner })
3738
const { proPlanMonth, proPlanYear } = findProPlans({ plans })
3839
const perMonthPrice = calculatePriceProPlan({

src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/ProPlanController/UserCount/UserCount.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import isNumber from 'lodash/isNumber'
22
import { useParams } from 'react-router-dom'
33

44
import { useAccountDetails } from 'services/account'
5+
import { Provider } from 'shared/api/helpers'
56

67
interface StudentTextProps {
78
activatedStudents?: number
@@ -41,7 +42,7 @@ const UserText: React.FC<UserTextProps> = ({
4142
}
4243

4344
const UserCount: React.FC = () => {
44-
const { provider, owner } = useParams<{ provider: string; owner: string }>()
45+
const { provider, owner } = useParams<{ provider: Provider; owner: string }>()
4546
const { data: accountDetails } = useAccountDetails({ provider, owner })
4647

4748
const activatedStudentCount = accountDetails?.activatedStudentCount

src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/SentryPlanController/PriceCallout/PriceCallout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
useAccountDetails,
88
useAvailablePlans,
99
} from 'services/account'
10+
import { Provider } from 'shared/api/helpers'
1011
import {
1112
BillingRate,
1213
findSentryPlans,
@@ -33,7 +34,7 @@ const PriceCallout: React.FC<PriceCalloutProps> = ({
3334
seats,
3435
setFormValue,
3536
}) => {
36-
const { provider, owner } = useParams<{ provider: string; owner: string }>()
37+
const { provider, owner } = useParams<{ provider: Provider; owner: string }>()
3738
const { data: plans } = useAvailablePlans({ provider, owner })
3839
const { sentryPlanMonth, sentryPlanYear } = findSentryPlans({ plans })
3940
const perMonthPrice = calculatePriceSentryPlan({

src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/SentryPlanController/UserCount/UserCount.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import isNumber from 'lodash/isNumber'
22
import { useParams } from 'react-router-dom'
33

44
import { useAccountDetails } from 'services/account'
5+
import { Provider } from 'shared/api/helpers'
56

67
interface StudentTextProps {
78
activatedStudents?: number
@@ -30,7 +31,7 @@ const UserText: React.FC = () => {
3031
}
3132

3233
const UserCount: React.FC = () => {
33-
const { provider, owner } = useParams<{ provider: string; owner: string }>()
34+
const { provider, owner } = useParams<{ provider: Provider; owner: string }>()
3435
const { data: accountDetails } = useAccountDetails({ provider, owner })
3536

3637
const activatedStudentCount = accountDetails?.activatedStudentCount

0 commit comments

Comments
 (0)