From 5d7eb446441ceb2976945bfaf90e709374478cda Mon Sep 17 00:00:00 2001 From: Kelly Phan Date: Thu, 12 Sep 2024 18:31:28 +0200 Subject: [PATCH] feat: request payment page (#1651) * feat: create new route * feat: static UI * feat: connect BE and translations * feat: connect with BE * fix: update customer page queries with integration check and wordings * fix: design qa * fix: update validate email function * fix(lago-289): contact us action * fix(lago-288): handle error for invoice not overdue * fix(qa): update things related to product reviews * feat(permissions): update anayltics permissions * fix(analytics): remove 12 months filter for customer overview page * fix(lago-319): update wording * fix: use env prod for rails codegen * fix: revert env change --- src/components/OverviewCard.tsx | 8 +- .../customers/overview/CustomerOverview.tsx | 190 ++++++---- src/components/graphs/Gross.tsx | 6 +- src/core/apolloClient/graphqlResolvers.tsx | 1 + src/core/router/CustomerRoutes.tsx | 14 + src/core/timezone/utils.ts | 4 + src/generated/graphql.tsx | 341 ++++++++++++++--- src/hooks/usePermissions.ts | 1 + src/pages/CustomerDetails.tsx | 21 ++ .../__tests__/validateEmails.test.ts | 41 +++ .../components/EmailPreview.tsx | 247 +++++++++++++ .../components/FreemiumAlert.tsx | 57 +++ .../components/RequestPaymentForm.tsx | 185 ++++++++++ .../CustomerRequestOverduePayment/index.tsx | 344 ++++++++++++++++++ .../validateEmails.ts | 16 + translations/base.json | 23 +- translations/de.json | 10 +- translations/es.json | 10 +- translations/fr.json | 10 +- translations/it.json | 10 +- translations/nb.json | 10 +- translations/sv.json | 10 +- 22 files changed, 1414 insertions(+), 145 deletions(-) create mode 100644 src/pages/CustomerRequestOverduePayment/__tests__/validateEmails.test.ts create mode 100644 src/pages/CustomerRequestOverduePayment/components/EmailPreview.tsx create mode 100644 src/pages/CustomerRequestOverduePayment/components/FreemiumAlert.tsx create mode 100644 src/pages/CustomerRequestOverduePayment/components/RequestPaymentForm.tsx create mode 100644 src/pages/CustomerRequestOverduePayment/index.tsx create mode 100644 src/pages/CustomerRequestOverduePayment/validateEmails.ts diff --git a/src/components/OverviewCard.tsx b/src/components/OverviewCard.tsx index 549a59eaa..41bd77ccd 100644 --- a/src/components/OverviewCard.tsx +++ b/src/components/OverviewCard.tsx @@ -37,9 +37,9 @@ export const OverviewCard: FC = ({ {title} {tooltipContent && ( - + - + )} @@ -69,3 +69,7 @@ const SkeletonWrapper = styled.div` margin-bottom: ${theme.spacing(8)}; } ` + +const StyledTooltip = styled(Tooltip)` + height: 16px; +` diff --git a/src/components/customers/overview/CustomerOverview.tsx b/src/components/customers/overview/CustomerOverview.tsx index 4f1ccecb3..75f081927 100644 --- a/src/components/customers/overview/CustomerOverview.tsx +++ b/src/components/customers/overview/CustomerOverview.tsx @@ -1,13 +1,18 @@ import { gql } from '@apollo/client' import { Skeleton, Stack } from '@mui/material' -import { FC, useEffect } from 'react' +import { DateTime } from 'luxon' +import { FC, useEffect, useMemo } from 'react' +import { generatePath, useNavigate, useParams } from 'react-router-dom' import { CustomerCoupons } from '~/components/customers/overview/CustomerCoupons' import { CustomerSubscriptionsList } from '~/components/customers/overview/CustomerSubscriptionsList' import { Alert, Button, Typography } from '~/components/designSystem' import { OverviewCard } from '~/components/OverviewCard' import { intlFormatNumber } from '~/core/formats/intlFormatNumber' +import { CUSTOMER_REQUEST_OVERDUE_PAYMENT_ROUTE } from '~/core/router' import { deserializeAmount } from '~/core/serializers/serializeAmount' +import { isSameDay } from '~/core/timezone' +import { LocaleEnum } from '~/core/translations' import { CurrencyEnum, TimezoneEnum, @@ -16,15 +21,22 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { useOrganizationInfos } from '~/hooks/useOrganizationInfos' +import { usePermissions } from '~/hooks/usePermissions' import { SectionHeader } from '~/styles/customer' gql` - query getCustomerGrossRevenues( + query getCustomerOverdueBalances( $externalCustomerId: String! $currency: CurrencyEnum $expireCache: Boolean ) { - grossRevenues( + paymentRequests { + collection { + createdAt + } + } + + overdueBalances( externalCustomerId: $externalCustomerId currency: $currency expireCache: $expireCache @@ -32,28 +44,26 @@ gql` collection { amountCents currency - invoicesCount - month + lagoInvoiceIds } } } - query getCustomerOverdueBalances( + query getCustomerGrossRevenues( $externalCustomerId: String! $currency: CurrencyEnum - $months: Int! $expireCache: Boolean ) { - overdueBalances( + grossRevenues( externalCustomerId: $externalCustomerId currency: $currency - months: $months expireCache: $expireCache ) { collection { amountCents currency - lagoInvoiceIds + invoicesCount + month } } } @@ -73,37 +83,45 @@ export const CustomerOverview: FC = ({ isLoading, }) => { const { translate } = useInternationalization() - const { organization } = useOrganizationInfos() + const { organization, formatTimeOrgaTZ } = useOrganizationInfos() + const { customerId } = useParams() + const navigate = useNavigate() + const { hasPermissions } = usePermissions() const currency = userCurrency ?? organization?.defaultCurrency ?? CurrencyEnum.Usd - const [getGrossRevenues, { data: grossData, error: grossError, loading: grossLoading }] = - useGetCustomerGrossRevenuesLazyQuery({ - variables: { - externalCustomerId: externalCustomerId || '', - currency, - }, - }) - const [getOverdueBalances, { data: overdueData, error: overdueError, loading: overdueLoading }] = - useGetCustomerOverdueBalancesLazyQuery({ - variables: { - externalCustomerId: externalCustomerId || '', - currency, - months: 12, - }, - }) + const [ + getCustomerOverdueBalances, + { data: overdueBalancesData, loading: overdueBalancesLoading, error: overdueBalancesError }, + ] = useGetCustomerOverdueBalancesLazyQuery({ + variables: { + externalCustomerId: externalCustomerId || '', + currency, + }, + }) + const [ + getCustomerGrossRevenues, + { data: grossRevenuesData, loading: grossRevenuesLoading, error: grossRevenuesError }, + ] = useGetCustomerGrossRevenuesLazyQuery({ + variables: { + externalCustomerId: externalCustomerId || '', + currency, + }, + }) useEffect(() => { if (!externalCustomerId) return - getGrossRevenues() - getOverdueBalances() - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [externalCustomerId]) + if (hasPermissions(['analyticsOverdueBalancesView'])) { + getCustomerOverdueBalances() + } - const hasAnyError = grossError || overdueError + if (hasPermissions(['analyticsView'])) { + getCustomerGrossRevenues() + } + }, [externalCustomerId]) - const grossRevenues = (grossData?.grossRevenues.collection || []).reduce( + const grossRevenues = (grossRevenuesData?.grossRevenues.collection || []).reduce( (acc, revenue) => { return { amountCents: acc.amountCents + deserializeAmount(revenue.amountCents, currency), @@ -113,7 +131,7 @@ export const CustomerOverview: FC = ({ { amountCents: 0, invoicesCount: 0 }, ) - const overdueBalances = overdueData?.overdueBalances.collection || [] + const overdueBalances = overdueBalancesData?.overdueBalances.collection || [] const overdueFormattedData = overdueBalances.reduce<{ amountCents: number invoiceCount: number @@ -131,9 +149,16 @@ export const CustomerOverview: FC = ({ ) const hasOverdueInvoices = overdueFormattedData.invoiceCount > 0 + const today = useMemo(() => DateTime.now().toUTC(), []) + const lastPaymentRequestDate = useMemo( + () => DateTime.fromISO(overdueBalancesData?.paymentRequests.collection[0]?.createdAt).toUTC(), + [overdueBalancesData?.paymentRequests], + ) + const hasMadePaymentRequestToday = isSameDay(lastPaymentRequestDate, today) + return ( <> - {!hasAnyError && ( + {(!overdueBalancesError || !grossRevenuesError) && (
{translate('text_6670a7222702d70114cc7954')} @@ -142,62 +167,77 @@ export const CustomerOverview: FC = ({ data-test="refresh-overview" variant="quaternary" onClick={() => { - getGrossRevenues({ + getCustomerOverdueBalances({ variables: { expireCache: true, externalCustomerId: externalCustomerId || '', currency, }, }) - getOverdueBalances({ - variables: { - expireCache: true, - externalCustomerId: externalCustomerId || '', - currency, - months: 12, - }, - }) }} > {translate('text_6670a7222702d70114cc7953')} - {hasOverdueInvoices && !overdueError && ( - - - {overdueLoading ? ( - - - - - ) : ( - - - {translate( - 'text_6670a7222702d70114cc7955', - { - count: overdueFormattedData.invoiceCount, - amount: intlFormatNumber(overdueFormattedData.amountCents, { - currencyDisplay: 'symbol', - currency, + {hasOverdueInvoices && !overdueBalancesError && ( + + navigate( + generatePath(CUSTOMER_REQUEST_OVERDUE_PAYMENT_ROUTE, { + customerId: customerId ?? '', }), - }, - overdueFormattedData.invoiceCount, - )} - - - {translate('text_6670a2a7ae3562006c4ee3db')} - - - )} - + ), + } + : undefined + } + > + {overdueBalancesLoading ? ( + + + + + ) : ( + + + {translate( + 'text_6670a7222702d70114cc7955', + { + count: overdueFormattedData.invoiceCount, + amount: intlFormatNumber(overdueFormattedData.amountCents, { + currencyDisplay: 'symbol', + currency, + }), + }, + overdueFormattedData.invoiceCount, + )} + + + {hasMadePaymentRequestToday + ? translate('text_66b4f00bd67ccc185ea75c70', { + relativeDay: lastPaymentRequestDate.toRelativeCalendar({ + locale: LocaleEnum.en, + }), + time: formatTimeOrgaTZ( + overdueBalancesData?.paymentRequests.collection[0]?.createdAt, + 'HH:mm:ss', + ), + }) + : translate('text_6670a2a7ae3562006c4ee3db')} + + + )} )} - {!grossError && ( + {hasPermissions(['analyticsView']) && !grossRevenuesError && ( = ({ )} /> )} - {!overdueError && ( + {hasPermissions(['analyticsOverdueBalancesView']) && !overdueBalancesError && ( { const { translate } = useInternationalization() const { data, loading, error } = useGetGrossRevenuesQuery({ - variables: { currency: currency, externalCustomerId: externalCustomerId }, + variables: { currency: currency, externalCustomerId: externalCustomerId, months: 12 }, skip: demoMode || blur || !currency, }) diff --git a/src/core/apolloClient/graphqlResolvers.tsx b/src/core/apolloClient/graphqlResolvers.tsx index aec4589ea..2d7159536 100644 --- a/src/core/apolloClient/graphqlResolvers.tsx +++ b/src/core/apolloClient/graphqlResolvers.tsx @@ -30,6 +30,7 @@ export const typeDefs = gql` does_not_match_item_amounts payment_processor_is_currently_handling_payment plan_overlapping + invoices_not_overdue # Object not found plan_not_found diff --git a/src/core/router/CustomerRoutes.tsx b/src/core/router/CustomerRoutes.tsx index 886cd0007..19436b4dc 100644 --- a/src/core/router/CustomerRoutes.tsx +++ b/src/core/router/CustomerRoutes.tsx @@ -19,6 +19,13 @@ const CustomerInvoiceDetails = lazyLoad( import(/* webpackChunkName: 'customer-invoice-details' */ '~/layouts/CustomerInvoiceDetails'), ) +const CustomerRequestOverduePayment = lazyLoad( + () => + import( + /* webpackChunkName: 'customer-request-overdue-payment' */ '~/pages/CustomerRequestOverduePayment/index' + ), +) + // Credit note related const CreateCreditNote = lazyLoad( () => import(/* webpackChunkName: 'create-credit-note' */ '~/pages/CreateCreditNote'), @@ -33,6 +40,7 @@ export const CUSTOMER_DETAILS_ROUTE = '/customer/:customerId' export const CUSTOMER_DETAILS_TAB_ROUTE = `${CUSTOMER_DETAILS_ROUTE}/:tab` export const CUSTOMER_DRAFT_INVOICES_LIST_ROUTE = `${CUSTOMER_DETAILS_ROUTE}/draft-invoices` export const CUSTOMER_INVOICE_DETAILS_ROUTE = `${CUSTOMER_DETAILS_ROUTE}/invoice/:invoiceId/:tab` +export const CUSTOMER_REQUEST_OVERDUE_PAYMENT_ROUTE = `${CUSTOMER_DETAILS_ROUTE}/request-overdue-payment` // Credit note related export const CUSTOMER_INVOICE_CREDIT_NOTE_DETAILS_ROUTE = `${CUSTOMER_DETAILS_ROUTE}/invoice/:invoiceId/credit-notes/:creditNoteId` @@ -79,4 +87,10 @@ export const customerObjectCreationRoutes: CustomRouteObject[] = [ element: , permissions: ['creditNotesCreate'], }, + { + path: CUSTOMER_REQUEST_OVERDUE_PAYMENT_ROUTE, + private: true, + element: , + permissions: ['analyticsOverdueBalancesView'], + }, ] diff --git a/src/core/timezone/utils.ts b/src/core/timezone/utils.ts index bfbb5d838..a37f85f47 100644 --- a/src/core/timezone/utils.ts +++ b/src/core/timezone/utils.ts @@ -37,3 +37,7 @@ export const formatDateToTZ = ( zone: getTimezoneConfig(timezone).name, }).toFormat(format || 'LLL. dd, yyyy') } + +export const isSameDay = (a: DateTime, b: DateTime): boolean => { + return a.hasSame(b, 'day') && a.hasSame(b, 'month') && a.hasSame(b, 'year') +} diff --git a/src/generated/graphql.tsx b/src/generated/graphql.tsx index 3419c5214..c928d4c86 100644 --- a/src/generated/graphql.tsx +++ b/src/generated/graphql.tsx @@ -2742,6 +2742,7 @@ export enum LagoApiError { InviteAlreadyExists = 'invite_already_exists', InviteEmailMistmatch = 'invite_email_mistmatch', InviteNotFound = 'invite_not_found', + InvoicesNotOverdue = 'invoices_not_overdue', NotFound = 'not_found', NotOrganizationMember = 'not_organization_member', OktaUserinfoError = 'okta_userinfo_error', @@ -5578,7 +5579,7 @@ export type XeroIntegration = { export type UserIdentifierQueryVariables = Exact<{ [key: string]: never; }>; -export type UserIdentifierQuery = { __typename?: 'Query', me: { __typename?: 'User', id: string, email?: string | null, premium: boolean, memberships: Array<{ __typename?: 'Membership', id: string, organization: { __typename?: 'Organization', id: string, name: string, logoUrl?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }> }, organization?: { __typename?: 'CurrentOrganization', id: string, name: string, logoUrl?: string | null, timezone?: TimezoneEnum | null, defaultCurrency: CurrencyEnum, premiumIntegrations: Array } | null }; +export type UserIdentifierQuery = { __typename?: 'Query', me: { __typename?: 'User', id: string, email?: string | null, premium: boolean, memberships: Array<{ __typename?: 'Membership', id: string, organization: { __typename?: 'Organization', id: string, name: string, logoUrl?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, analyticsOverdueBalancesView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }> }, organization?: { __typename?: 'CurrentOrganization', id: string, name: string, logoUrl?: string | null, timezone?: TimezoneEnum | null, defaultCurrency: CurrencyEnum, premiumIntegrations: Array } | null }; export type AddOnItemFragment = { __typename?: 'AddOn', id: string, name: string, amountCurrency: CurrencyEnum, amountCents: any, customersCount: number, createdAt: any }; @@ -5952,24 +5953,23 @@ export type RemoveCouponMutationVariables = Exact<{ export type RemoveCouponMutation = { __typename?: 'Mutation', terminateAppliedCoupon?: { __typename?: 'AppliedCoupon', id: string } | null }; -export type GetCustomerGrossRevenuesQueryVariables = Exact<{ +export type GetCustomerOverdueBalancesQueryVariables = Exact<{ externalCustomerId: Scalars['String']['input']; currency?: InputMaybe; expireCache?: InputMaybe; }>; -export type GetCustomerGrossRevenuesQuery = { __typename?: 'Query', grossRevenues: { __typename?: 'GrossRevenueCollection', collection: Array<{ __typename?: 'GrossRevenue', amountCents?: any | null, currency?: CurrencyEnum | null, invoicesCount: any, month: any }> } }; +export type GetCustomerOverdueBalancesQuery = { __typename?: 'Query', paymentRequests: { __typename?: 'PaymentRequestCollection', collection: Array<{ __typename?: 'PaymentRequest', createdAt: any }> }, overdueBalances: { __typename?: 'OverdueBalanceCollection', collection: Array<{ __typename?: 'OverdueBalance', amountCents: any, currency: CurrencyEnum, lagoInvoiceIds: Array }> } }; -export type GetCustomerOverdueBalancesQueryVariables = Exact<{ +export type GetCustomerGrossRevenuesQueryVariables = Exact<{ externalCustomerId: Scalars['String']['input']; currency?: InputMaybe; - months: Scalars['Int']['input']; expireCache?: InputMaybe; }>; -export type GetCustomerOverdueBalancesQuery = { __typename?: 'Query', overdueBalances: { __typename?: 'OverdueBalanceCollection', collection: Array<{ __typename?: 'OverdueBalance', amountCents: any, currency: CurrencyEnum, lagoInvoiceIds: Array }> } }; +export type GetCustomerGrossRevenuesQuery = { __typename?: 'Query', grossRevenues: { __typename?: 'GrossRevenueCollection', collection: Array<{ __typename?: 'GrossRevenue', amountCents?: any | null, currency?: CurrencyEnum | null, invoicesCount: any, month: any }> } }; export type GetCustomerSubscriptionForListQueryVariables = Exact<{ id: Scalars['ID']['input']; @@ -6060,6 +6060,7 @@ export type OrganizationForDatePickerFragment = { __typename?: 'CurrentOrganizat export type GetGrossRevenuesQueryVariables = Exact<{ currency: CurrencyEnum; externalCustomerId?: InputMaybe; + months?: InputMaybe; }>; @@ -7006,18 +7007,18 @@ export type UpdateInviteRoleMutationVariables = Exact<{ export type UpdateInviteRoleMutation = { __typename?: 'Mutation', updateInvite?: { __typename?: 'Invite', id: string, role: MembershipRole, email: string } | null }; -export type MemberForEditRoleForDialogFragment = { __typename?: 'Membership', id: string, role: MembershipRole, user: { __typename?: 'User', id: string, email?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }; +export type MemberForEditRoleForDialogFragment = { __typename?: 'Membership', id: string, role: MembershipRole, user: { __typename?: 'User', id: string, email?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, analyticsOverdueBalancesView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }; export type UpdateMembershipRoleMutationVariables = Exact<{ input: UpdateMembershipInput; }>; -export type UpdateMembershipRoleMutation = { __typename?: 'Mutation', updateMembership?: { __typename?: 'Membership', id: string, role: MembershipRole, user: { __typename?: 'User', id: string, email?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } } | null }; +export type UpdateMembershipRoleMutation = { __typename?: 'Mutation', updateMembership?: { __typename?: 'Membership', id: string, role: MembershipRole, user: { __typename?: 'User', id: string, email?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, analyticsOverdueBalancesView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } } | null }; export type InviteItemFragment = { __typename?: 'Invite', id: string, email: string, token: string, role: MembershipRole, organization: { __typename?: 'Organization', id: string, name: string } }; -export type MembershipItemFragment = { __typename?: 'Membership', id: string, role: MembershipRole, user: { __typename?: 'User', id: string, email?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }; +export type MembershipItemFragment = { __typename?: 'Membership', id: string, role: MembershipRole, user: { __typename?: 'User', id: string, email?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, analyticsOverdueBalancesView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }; export type RevokeInviteMutationVariables = Exact<{ input: RevokeInviteInput; @@ -7108,14 +7109,14 @@ export type CreateSubscriptionMutationVariables = Exact<{ }>; -export type CreateSubscriptionMutation = { __typename?: 'Mutation', createSubscription?: { __typename?: 'Subscription', id: string, customer: { __typename?: 'Customer', id: string, activeSubscriptionsCount: number, name?: string | null, externalId: string, hasActiveWallet: boolean, currency?: CurrencyEnum | null, hasCreditNotes: boolean, creditNotesCreditsAvailableCount: number, creditNotesBalanceAmountCents: any, applicableTimezone: TimezoneEnum, addressLine1?: string | null, addressLine2?: string | null, canEditAttributes: boolean, city?: string | null, country?: CountryCode | null, email?: string | null, externalSalesforceId?: string | null, legalName?: string | null, legalNumber?: string | null, taxIdentificationNumber?: string | null, paymentProvider?: ProviderTypeEnum | null, phone?: string | null, state?: string | null, timezone?: TimezoneEnum | null, zipcode?: string | null, url?: string | null, paymentProviderCode?: string | null, shippingAddress?: { __typename?: 'CustomerAddress', addressLine1?: string | null, addressLine2?: string | null, city?: string | null, country?: CountryCode | null, state?: string | null, zipcode?: string | null } | null, providerCustomer?: { __typename?: 'ProviderCustomer', id: string, providerCustomerId?: string | null, syncWithProvider?: boolean | null, providerPaymentMethods?: Array | null } | null, netsuiteCustomer?: { __typename: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, subsidiaryId?: string | null, syncWithProvider?: boolean | null } | null, anrokCustomer?: { __typename: 'AnrokCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, xeroCustomer?: { __typename: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, key: string, value: string, displayInInvoice: boolean }> | null } } | null }; +export type CreateSubscriptionMutation = { __typename?: 'Mutation', createSubscription?: { __typename?: 'Subscription', id: string, customer: { __typename?: 'Customer', id: string, activeSubscriptionsCount: number, name?: string | null, externalId: string, hasActiveWallet: boolean, currency?: CurrencyEnum | null, hasCreditNotes: boolean, creditNotesCreditsAvailableCount: number, creditNotesBalanceAmountCents: any, applicableTimezone: TimezoneEnum, hasOverdueInvoices: boolean, addressLine1?: string | null, addressLine2?: string | null, canEditAttributes: boolean, city?: string | null, country?: CountryCode | null, email?: string | null, externalSalesforceId?: string | null, legalName?: string | null, legalNumber?: string | null, taxIdentificationNumber?: string | null, paymentProvider?: ProviderTypeEnum | null, phone?: string | null, state?: string | null, timezone?: TimezoneEnum | null, zipcode?: string | null, url?: string | null, paymentProviderCode?: string | null, shippingAddress?: { __typename?: 'CustomerAddress', addressLine1?: string | null, addressLine2?: string | null, city?: string | null, country?: CountryCode | null, state?: string | null, zipcode?: string | null } | null, providerCustomer?: { __typename?: 'ProviderCustomer', id: string, providerCustomerId?: string | null, syncWithProvider?: boolean | null, providerPaymentMethods?: Array | null } | null, netsuiteCustomer?: { __typename: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, subsidiaryId?: string | null, syncWithProvider?: boolean | null } | null, anrokCustomer?: { __typename: 'AnrokCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, xeroCustomer?: { __typename: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, key: string, value: string, displayInInvoice: boolean }> | null } } | null }; export type UpdateSubscriptionMutationVariables = Exact<{ input: UpdateSubscriptionInput; }>; -export type UpdateSubscriptionMutation = { __typename?: 'Mutation', updateSubscription?: { __typename?: 'Subscription', id: string, customer: { __typename?: 'Customer', id: string, activeSubscriptionsCount: number, name?: string | null, externalId: string, hasActiveWallet: boolean, currency?: CurrencyEnum | null, hasCreditNotes: boolean, creditNotesCreditsAvailableCount: number, creditNotesBalanceAmountCents: any, applicableTimezone: TimezoneEnum, addressLine1?: string | null, addressLine2?: string | null, canEditAttributes: boolean, city?: string | null, country?: CountryCode | null, email?: string | null, externalSalesforceId?: string | null, legalName?: string | null, legalNumber?: string | null, taxIdentificationNumber?: string | null, paymentProvider?: ProviderTypeEnum | null, phone?: string | null, state?: string | null, timezone?: TimezoneEnum | null, zipcode?: string | null, url?: string | null, paymentProviderCode?: string | null, shippingAddress?: { __typename?: 'CustomerAddress', addressLine1?: string | null, addressLine2?: string | null, city?: string | null, country?: CountryCode | null, state?: string | null, zipcode?: string | null } | null, providerCustomer?: { __typename?: 'ProviderCustomer', id: string, providerCustomerId?: string | null, syncWithProvider?: boolean | null, providerPaymentMethods?: Array | null } | null, netsuiteCustomer?: { __typename: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, subsidiaryId?: string | null, syncWithProvider?: boolean | null } | null, anrokCustomer?: { __typename: 'AnrokCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, xeroCustomer?: { __typename: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, key: string, value: string, displayInInvoice: boolean }> | null } } | null }; +export type UpdateSubscriptionMutation = { __typename?: 'Mutation', updateSubscription?: { __typename?: 'Subscription', id: string, customer: { __typename?: 'Customer', id: string, activeSubscriptionsCount: number, name?: string | null, externalId: string, hasActiveWallet: boolean, currency?: CurrencyEnum | null, hasCreditNotes: boolean, creditNotesCreditsAvailableCount: number, creditNotesBalanceAmountCents: any, applicableTimezone: TimezoneEnum, hasOverdueInvoices: boolean, addressLine1?: string | null, addressLine2?: string | null, canEditAttributes: boolean, city?: string | null, country?: CountryCode | null, email?: string | null, externalSalesforceId?: string | null, legalName?: string | null, legalNumber?: string | null, taxIdentificationNumber?: string | null, paymentProvider?: ProviderTypeEnum | null, phone?: string | null, state?: string | null, timezone?: TimezoneEnum | null, zipcode?: string | null, url?: string | null, paymentProviderCode?: string | null, shippingAddress?: { __typename?: 'CustomerAddress', addressLine1?: string | null, addressLine2?: string | null, city?: string | null, country?: CountryCode | null, state?: string | null, zipcode?: string | null } | null, providerCustomer?: { __typename?: 'ProviderCustomer', id: string, providerCustomerId?: string | null, syncWithProvider?: boolean | null, providerPaymentMethods?: Array | null } | null, netsuiteCustomer?: { __typename: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, subsidiaryId?: string | null, syncWithProvider?: boolean | null } | null, anrokCustomer?: { __typename: 'AnrokCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, xeroCustomer?: { __typename: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, key: string, value: string, displayInInvoice: boolean }> | null } } | null }; export type GetSinglePlanQueryVariables = Exact<{ id: Scalars['ID']['input']; @@ -7266,12 +7267,12 @@ export type UpdateTaxMutationVariables = Exact<{ export type UpdateTaxMutation = { __typename?: 'Mutation', updateTax?: { __typename?: 'Tax', id: string, code: string, description?: string | null, name: string, rate: number, customersCount: number } | null }; -export type CurrentUserInfosFragment = { __typename?: 'User', id: string, email?: string | null, premium: boolean, memberships: Array<{ __typename?: 'Membership', id: string, organization: { __typename?: 'Organization', id: string, name: string, logoUrl?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }> }; +export type CurrentUserInfosFragment = { __typename?: 'User', id: string, email?: string | null, premium: boolean, memberships: Array<{ __typename?: 'Membership', id: string, organization: { __typename?: 'Organization', id: string, name: string, logoUrl?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, analyticsOverdueBalancesView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }> }; export type GetCurrentUserInfosQueryVariables = Exact<{ [key: string]: never; }>; -export type GetCurrentUserInfosQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, email?: string | null, premium: boolean, memberships: Array<{ __typename?: 'Membership', id: string, organization: { __typename?: 'Organization', id: string, name: string, logoUrl?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }> } }; +export type GetCurrentUserInfosQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, email?: string | null, premium: boolean, memberships: Array<{ __typename?: 'Membership', id: string, organization: { __typename?: 'Organization', id: string, name: string, logoUrl?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, analyticsOverdueBalancesView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }> } }; export type GetEmailSettingsQueryVariables = Exact<{ [key: string]: never; }>; @@ -7300,7 +7301,7 @@ export type GetOrganizationInfosQueryVariables = Exact<{ [key: string]: never; } export type GetOrganizationInfosQuery = { __typename?: 'Query', organization?: { __typename?: 'CurrentOrganization', id: string, name: string, logoUrl?: string | null, timezone?: TimezoneEnum | null, defaultCurrency: CurrencyEnum, premiumIntegrations: Array } | null }; -export type MembershipPermissionsFragment = { __typename?: 'Membership', id: string, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }; +export type MembershipPermissionsFragment = { __typename?: 'Membership', id: string, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, analyticsOverdueBalancesView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }; export type AllInvoiceDetailsForCustomerInvoiceDetailsFragment = { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, issuingDate: any, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | null, name?: string | null, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, deletedAt?: any | null, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | null }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, description?: string | null, feeType: FeeTypesEnum, invoiceDisplayName?: string | null, invoiceName?: string | null, itemName: string, units: number, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, minAmountCents: any, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, minAmountCents: any, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null }; @@ -7496,14 +7497,14 @@ export type SyncIntegrationCreditNoteMutationVariables = Exact<{ export type SyncIntegrationCreditNoteMutation = { __typename?: 'Mutation', syncIntegrationCreditNote?: { __typename?: 'SyncIntegrationCreditNotePayload', creditNoteId?: string | null } | null }; -export type CustomerDetailsFragment = { __typename?: 'Customer', id: string, name?: string | null, externalId: string, hasActiveWallet: boolean, currency?: CurrencyEnum | null, hasCreditNotes: boolean, creditNotesCreditsAvailableCount: number, creditNotesBalanceAmountCents: any, applicableTimezone: TimezoneEnum, addressLine1?: string | null, addressLine2?: string | null, canEditAttributes: boolean, city?: string | null, country?: CountryCode | null, email?: string | null, externalSalesforceId?: string | null, legalName?: string | null, legalNumber?: string | null, taxIdentificationNumber?: string | null, paymentProvider?: ProviderTypeEnum | null, phone?: string | null, state?: string | null, timezone?: TimezoneEnum | null, zipcode?: string | null, url?: string | null, paymentProviderCode?: string | null, shippingAddress?: { __typename?: 'CustomerAddress', addressLine1?: string | null, addressLine2?: string | null, city?: string | null, country?: CountryCode | null, state?: string | null, zipcode?: string | null } | null, providerCustomer?: { __typename?: 'ProviderCustomer', id: string, providerCustomerId?: string | null, syncWithProvider?: boolean | null, providerPaymentMethods?: Array | null } | null, netsuiteCustomer?: { __typename: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, subsidiaryId?: string | null, syncWithProvider?: boolean | null } | null, anrokCustomer?: { __typename: 'AnrokCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, xeroCustomer?: { __typename: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, key: string, value: string, displayInInvoice: boolean }> | null }; +export type CustomerDetailsFragment = { __typename?: 'Customer', id: string, name?: string | null, externalId: string, hasActiveWallet: boolean, currency?: CurrencyEnum | null, hasCreditNotes: boolean, creditNotesCreditsAvailableCount: number, creditNotesBalanceAmountCents: any, applicableTimezone: TimezoneEnum, hasOverdueInvoices: boolean, addressLine1?: string | null, addressLine2?: string | null, canEditAttributes: boolean, city?: string | null, country?: CountryCode | null, email?: string | null, externalSalesforceId?: string | null, legalName?: string | null, legalNumber?: string | null, taxIdentificationNumber?: string | null, paymentProvider?: ProviderTypeEnum | null, phone?: string | null, state?: string | null, timezone?: TimezoneEnum | null, zipcode?: string | null, url?: string | null, paymentProviderCode?: string | null, shippingAddress?: { __typename?: 'CustomerAddress', addressLine1?: string | null, addressLine2?: string | null, city?: string | null, country?: CountryCode | null, state?: string | null, zipcode?: string | null } | null, providerCustomer?: { __typename?: 'ProviderCustomer', id: string, providerCustomerId?: string | null, syncWithProvider?: boolean | null, providerPaymentMethods?: Array | null } | null, netsuiteCustomer?: { __typename: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, subsidiaryId?: string | null, syncWithProvider?: boolean | null } | null, anrokCustomer?: { __typename: 'AnrokCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, xeroCustomer?: { __typename: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, key: string, value: string, displayInInvoice: boolean }> | null }; export type GetCustomerQueryVariables = Exact<{ id: Scalars['ID']['input']; }>; -export type GetCustomerQuery = { __typename?: 'Query', customer?: { __typename?: 'Customer', id: string, name?: string | null, externalId: string, hasActiveWallet: boolean, currency?: CurrencyEnum | null, hasCreditNotes: boolean, creditNotesCreditsAvailableCount: number, creditNotesBalanceAmountCents: any, applicableTimezone: TimezoneEnum, addressLine1?: string | null, addressLine2?: string | null, canEditAttributes: boolean, city?: string | null, country?: CountryCode | null, email?: string | null, externalSalesforceId?: string | null, legalName?: string | null, legalNumber?: string | null, taxIdentificationNumber?: string | null, paymentProvider?: ProviderTypeEnum | null, phone?: string | null, state?: string | null, timezone?: TimezoneEnum | null, zipcode?: string | null, url?: string | null, paymentProviderCode?: string | null, shippingAddress?: { __typename?: 'CustomerAddress', addressLine1?: string | null, addressLine2?: string | null, city?: string | null, country?: CountryCode | null, state?: string | null, zipcode?: string | null } | null, providerCustomer?: { __typename?: 'ProviderCustomer', id: string, providerCustomerId?: string | null, syncWithProvider?: boolean | null, providerPaymentMethods?: Array | null } | null, netsuiteCustomer?: { __typename: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, subsidiaryId?: string | null, syncWithProvider?: boolean | null } | null, anrokCustomer?: { __typename: 'AnrokCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, xeroCustomer?: { __typename: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, key: string, value: string, displayInInvoice: boolean }> | null } | null }; +export type GetCustomerQuery = { __typename?: 'Query', customer?: { __typename?: 'Customer', id: string, name?: string | null, externalId: string, hasActiveWallet: boolean, currency?: CurrencyEnum | null, hasCreditNotes: boolean, creditNotesCreditsAvailableCount: number, creditNotesBalanceAmountCents: any, applicableTimezone: TimezoneEnum, hasOverdueInvoices: boolean, addressLine1?: string | null, addressLine2?: string | null, canEditAttributes: boolean, city?: string | null, country?: CountryCode | null, email?: string | null, externalSalesforceId?: string | null, legalName?: string | null, legalNumber?: string | null, taxIdentificationNumber?: string | null, paymentProvider?: ProviderTypeEnum | null, phone?: string | null, state?: string | null, timezone?: TimezoneEnum | null, zipcode?: string | null, url?: string | null, paymentProviderCode?: string | null, shippingAddress?: { __typename?: 'CustomerAddress', addressLine1?: string | null, addressLine2?: string | null, city?: string | null, country?: CountryCode | null, state?: string | null, zipcode?: string | null } | null, providerCustomer?: { __typename?: 'ProviderCustomer', id: string, providerCustomerId?: string | null, syncWithProvider?: boolean | null, providerPaymentMethods?: Array | null } | null, netsuiteCustomer?: { __typename: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, subsidiaryId?: string | null, syncWithProvider?: boolean | null } | null, anrokCustomer?: { __typename: 'AnrokCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, xeroCustomer?: { __typename: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null, integrationCode?: string | null, integrationType?: IntegrationTypeEnum | null, syncWithProvider?: boolean | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, key: string, value: string, displayInInvoice: boolean }> | null } | null }; export type GenerateCustomerPortalUrlMutationVariables = Exact<{ input: GenerateCustomerPortalUrlInput; @@ -7531,6 +7532,37 @@ export type GetCustomerInfosForDraftInvoicesListQueryVariables = Exact<{ export type GetCustomerInfosForDraftInvoicesListQuery = { __typename?: 'Query', customer?: { __typename?: 'Customer', id: string, name?: string | null, applicableTimezone: TimezoneEnum } | null, customerInvoices: { __typename?: 'InvoiceCollection', metadata: { __typename?: 'CollectionMetadata', totalCount: number } } }; +export type CustomerForRequestOverduePaymentEmailFragment = { __typename?: 'Customer', name?: string | null, paymentProvider?: ProviderTypeEnum | null, netPaymentTerm?: number | null, billingConfiguration?: { __typename?: 'CustomerBillingConfiguration', documentLocale?: string | null } | null }; + +export type OrganizationForRequestOverduePaymentEmailFragment = { __typename?: 'CurrentOrganization', name: string, logoUrl?: string | null, email?: string | null, netPaymentTerm: number, billingConfiguration?: { __typename?: 'OrganizationBillingConfiguration', documentLocale?: string | null } | null }; + +export type InvoicesForRequestOverduePaymentEmailFragment = { __typename?: 'Invoice', id: string, number: string, totalAmountCents: any, currency?: CurrencyEnum | null }; + +export type CustomerForRequestOverduePaymentFormFragment = { __typename?: 'Customer', email?: string | null }; + +export type InvoicesForRequestOverduePaymentFormFragment = { __typename?: 'Invoice', id: string, number: string, totalAmountCents: any, currency?: CurrencyEnum | null, issuingDate: any }; + +export type LastPaymentRequestFragment = { __typename?: 'PaymentRequest', createdAt: any }; + +export type GetRequestOverduePaymentAccessQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetRequestOverduePaymentAccessQuery = { __typename?: 'Query', organization?: { __typename?: 'CurrentOrganization', premiumIntegrations: Array } | null }; + +export type GetRequestOverduePaymentInfosQueryVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type GetRequestOverduePaymentInfosQuery = { __typename?: 'Query', organization?: { __typename?: 'CurrentOrganization', defaultCurrency: CurrencyEnum, name: string, logoUrl?: string | null, email?: string | null, netPaymentTerm: number, billingConfiguration?: { __typename?: 'OrganizationBillingConfiguration', documentLocale?: string | null } | null } | null, customer?: { __typename?: 'Customer', externalId: string, currency?: CurrencyEnum | null, email?: string | null, name?: string | null, paymentProvider?: ProviderTypeEnum | null, netPaymentTerm?: number | null, billingConfiguration?: { __typename?: 'CustomerBillingConfiguration', documentLocale?: string | null } | null } | null, paymentRequests: { __typename?: 'PaymentRequestCollection', collection: Array<{ __typename?: 'PaymentRequest', createdAt: any }> }, invoices: { __typename?: 'InvoiceCollection', collection: Array<{ __typename?: 'Invoice', id: string, number: string, totalAmountCents: any, currency?: CurrencyEnum | null, issuingDate: any }> } }; + +export type CreatePaymentRequestMutationVariables = Exact<{ + input: PaymentRequestCreateInput; +}>; + + +export type CreatePaymentRequestMutation = { __typename?: 'Mutation', createPaymentRequest?: { __typename?: 'PaymentRequest', id: string } | null }; + export type CustomersQueryVariables = Exact<{ page?: InputMaybe; limit?: InputMaybe; @@ -7916,7 +7948,7 @@ export type GetMembersQueryVariables = Exact<{ }>; -export type GetMembersQuery = { __typename?: 'Query', memberships: { __typename?: 'MembershipCollection', metadata: { __typename?: 'Metadata', currentPage: number, totalPages: number, totalCount: number, adminCount: number }, collection: Array<{ __typename?: 'Membership', id: string, role: MembershipRole, user: { __typename?: 'User', id: string, email?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }> } }; +export type GetMembersQuery = { __typename?: 'Query', memberships: { __typename?: 'MembershipCollection', metadata: { __typename?: 'Metadata', currentPage: number, totalPages: number, totalCount: number, adminCount: number }, collection: Array<{ __typename?: 'Membership', id: string, role: MembershipRole, user: { __typename?: 'User', id: string, email?: string | null }, permissions: { __typename?: 'Permissions', addonsCreate: boolean, addonsDelete: boolean, addonsUpdate: boolean, addonsView: boolean, analyticsView: boolean, analyticsOverdueBalancesView: boolean, billableMetricsCreate: boolean, billableMetricsDelete: boolean, billableMetricsUpdate: boolean, billableMetricsView: boolean, couponsAttach: boolean, couponsCreate: boolean, couponsDelete: boolean, couponsDetach: boolean, couponsUpdate: boolean, couponsView: boolean, creditNotesCreate: boolean, creditNotesView: boolean, creditNotesVoid: boolean, customerSettingsUpdateGracePeriod: boolean, customerSettingsUpdateLang: boolean, customerSettingsUpdatePaymentTerms: boolean, customerSettingsUpdateTaxRates: boolean, customerSettingsView: boolean, customersCreate: boolean, customersDelete: boolean, customersUpdate: boolean, customersView: boolean, developersKeysManage: boolean, developersManage: boolean, draftInvoicesUpdate: boolean, invoicesCreate: boolean, invoicesSend: boolean, invoicesUpdate: boolean, invoicesView: boolean, invoicesVoid: boolean, organizationEmailsUpdate: boolean, organizationEmailsView: boolean, organizationIntegrationsCreate: boolean, organizationIntegrationsDelete: boolean, organizationIntegrationsUpdate: boolean, organizationIntegrationsView: boolean, organizationInvoicesUpdate: boolean, organizationInvoicesView: boolean, organizationMembersCreate: boolean, organizationMembersDelete: boolean, organizationMembersUpdate: boolean, organizationMembersView: boolean, organizationTaxesUpdate: boolean, organizationTaxesView: boolean, organizationUpdate: boolean, organizationView: boolean, plansCreate: boolean, plansDelete: boolean, plansUpdate: boolean, plansView: boolean, subscriptionsCreate: boolean, subscriptionsUpdate: boolean, subscriptionsView: boolean, walletsCreate: boolean, walletsTerminate: boolean, walletsTopUp: boolean, walletsUpdate: boolean } }> } }; export type NetsuiteIntegrationDetailsFragment = { __typename?: 'NetsuiteIntegration', id: string, name: string, accountId?: string | null, clientId?: string | null, clientSecret?: string | null, code: string, scriptEndpointUrl: string, syncCreditNotes?: boolean | null, syncInvoices?: boolean | null, syncPayments?: boolean | null, syncSalesOrders?: boolean | null, tokenId?: string | null, tokenSecret?: string | null }; @@ -8985,6 +9017,7 @@ export const MembershipPermissionsFragmentDoc = gql` addonsUpdate addonsView analyticsView + analyticsOverdueBalancesView billableMetricsCreate billableMetricsDelete billableMetricsUpdate @@ -10341,11 +10374,60 @@ export const CustomerDetailsFragmentDoc = gql` creditNotesCreditsAvailableCount creditNotesBalanceAmountCents applicableTimezone + hasOverdueInvoices ...AddCustomerDrawer ...CustomerMainInfos } ${AddCustomerDrawerFragmentDoc} ${CustomerMainInfosFragmentDoc}`; +export const CustomerForRequestOverduePaymentEmailFragmentDoc = gql` + fragment CustomerForRequestOverduePaymentEmail on Customer { + name + paymentProvider + netPaymentTerm + billingConfiguration { + documentLocale + } +} + `; +export const OrganizationForRequestOverduePaymentEmailFragmentDoc = gql` + fragment OrganizationForRequestOverduePaymentEmail on CurrentOrganization { + name + logoUrl + email + netPaymentTerm + billingConfiguration { + documentLocale + } +} + `; +export const InvoicesForRequestOverduePaymentEmailFragmentDoc = gql` + fragment InvoicesForRequestOverduePaymentEmail on Invoice { + id + number + totalAmountCents + currency +} + `; +export const CustomerForRequestOverduePaymentFormFragmentDoc = gql` + fragment CustomerForRequestOverduePaymentForm on Customer { + email +} + `; +export const InvoicesForRequestOverduePaymentFormFragmentDoc = gql` + fragment InvoicesForRequestOverduePaymentForm on Invoice { + id + number + totalAmountCents + currency + issuingDate +} + `; +export const LastPaymentRequestFragmentDoc = gql` + fragment LastPaymentRequest on PaymentRequest { + createdAt +} + `; export const NetsuiteIntegrationInfosForInvoiceOverviewFragmentDoc = gql` fragment NetsuiteIntegrationInfosForInvoiceOverview on NetsuiteIntegration { id @@ -12434,9 +12516,14 @@ export function useRemoveCouponMutation(baseOptions?: Apollo.MutationHookOptions export type RemoveCouponMutationHookResult = ReturnType; export type RemoveCouponMutationResult = Apollo.MutationResult; export type RemoveCouponMutationOptions = Apollo.BaseMutationOptions; -export const GetCustomerGrossRevenuesDocument = gql` - query getCustomerGrossRevenues($externalCustomerId: String!, $currency: CurrencyEnum, $expireCache: Boolean) { - grossRevenues( +export const GetCustomerOverdueBalancesDocument = gql` + query getCustomerOverdueBalances($externalCustomerId: String!, $currency: CurrencyEnum, $expireCache: Boolean) { + paymentRequests { + collection { + createdAt + } + } + overdueBalances( externalCustomerId: $externalCustomerId currency: $currency expireCache: $expireCache @@ -12444,24 +12531,23 @@ export const GetCustomerGrossRevenuesDocument = gql` collection { amountCents currency - invoicesCount - month + lagoInvoiceIds } } } `; /** - * __useGetCustomerGrossRevenuesQuery__ + * __useGetCustomerOverdueBalancesQuery__ * - * To run a query within a React component, call `useGetCustomerGrossRevenuesQuery` and pass it any options that fit your needs. - * When your component renders, `useGetCustomerGrossRevenuesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `useGetCustomerOverdueBalancesQuery` and pass it any options that fit your needs. + * When your component renders, `useGetCustomerOverdueBalancesQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = useGetCustomerGrossRevenuesQuery({ + * const { data, loading, error } = useGetCustomerOverdueBalancesQuery({ * variables: { * externalCustomerId: // value for 'externalCustomerId' * currency: // value for 'currency' @@ -12469,74 +12555,73 @@ export const GetCustomerGrossRevenuesDocument = gql` * }, * }); */ -export function useGetCustomerGrossRevenuesQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetCustomerGrossRevenuesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { +export function useGetCustomerOverdueBalancesQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetCustomerOverdueBalancesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetCustomerGrossRevenuesDocument, options); + return Apollo.useQuery(GetCustomerOverdueBalancesDocument, options); } -export function useGetCustomerGrossRevenuesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useGetCustomerOverdueBalancesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetCustomerGrossRevenuesDocument, options); + return Apollo.useLazyQuery(GetCustomerOverdueBalancesDocument, options); } -export function useGetCustomerGrossRevenuesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { +export function useGetCustomerOverdueBalancesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GetCustomerGrossRevenuesDocument, options); + return Apollo.useSuspenseQuery(GetCustomerOverdueBalancesDocument, options); } -export type GetCustomerGrossRevenuesQueryHookResult = ReturnType; -export type GetCustomerGrossRevenuesLazyQueryHookResult = ReturnType; -export type GetCustomerGrossRevenuesSuspenseQueryHookResult = ReturnType; -export type GetCustomerGrossRevenuesQueryResult = Apollo.QueryResult; -export const GetCustomerOverdueBalancesDocument = gql` - query getCustomerOverdueBalances($externalCustomerId: String!, $currency: CurrencyEnum, $months: Int!, $expireCache: Boolean) { - overdueBalances( +export type GetCustomerOverdueBalancesQueryHookResult = ReturnType; +export type GetCustomerOverdueBalancesLazyQueryHookResult = ReturnType; +export type GetCustomerOverdueBalancesSuspenseQueryHookResult = ReturnType; +export type GetCustomerOverdueBalancesQueryResult = Apollo.QueryResult; +export const GetCustomerGrossRevenuesDocument = gql` + query getCustomerGrossRevenues($externalCustomerId: String!, $currency: CurrencyEnum, $expireCache: Boolean) { + grossRevenues( externalCustomerId: $externalCustomerId currency: $currency - months: $months expireCache: $expireCache ) { collection { amountCents currency - lagoInvoiceIds + invoicesCount + month } } } `; /** - * __useGetCustomerOverdueBalancesQuery__ + * __useGetCustomerGrossRevenuesQuery__ * - * To run a query within a React component, call `useGetCustomerOverdueBalancesQuery` and pass it any options that fit your needs. - * When your component renders, `useGetCustomerOverdueBalancesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `useGetCustomerGrossRevenuesQuery` and pass it any options that fit your needs. + * When your component renders, `useGetCustomerGrossRevenuesQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = useGetCustomerOverdueBalancesQuery({ + * const { data, loading, error } = useGetCustomerGrossRevenuesQuery({ * variables: { * externalCustomerId: // value for 'externalCustomerId' * currency: // value for 'currency' - * months: // value for 'months' * expireCache: // value for 'expireCache' * }, * }); */ -export function useGetCustomerOverdueBalancesQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetCustomerOverdueBalancesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { +export function useGetCustomerGrossRevenuesQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetCustomerGrossRevenuesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetCustomerOverdueBalancesDocument, options); + return Apollo.useQuery(GetCustomerGrossRevenuesDocument, options); } -export function useGetCustomerOverdueBalancesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useGetCustomerGrossRevenuesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetCustomerOverdueBalancesDocument, options); + return Apollo.useLazyQuery(GetCustomerGrossRevenuesDocument, options); } -export function useGetCustomerOverdueBalancesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { +export function useGetCustomerGrossRevenuesSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GetCustomerOverdueBalancesDocument, options); + return Apollo.useSuspenseQuery(GetCustomerGrossRevenuesDocument, options); } -export type GetCustomerOverdueBalancesQueryHookResult = ReturnType; -export type GetCustomerOverdueBalancesLazyQueryHookResult = ReturnType; -export type GetCustomerOverdueBalancesSuspenseQueryHookResult = ReturnType; -export type GetCustomerOverdueBalancesQueryResult = Apollo.QueryResult; +export type GetCustomerGrossRevenuesQueryHookResult = ReturnType; +export type GetCustomerGrossRevenuesLazyQueryHookResult = ReturnType; +export type GetCustomerGrossRevenuesSuspenseQueryHookResult = ReturnType; +export type GetCustomerGrossRevenuesQueryResult = Apollo.QueryResult; export const GetCustomerSubscriptionForListDocument = gql` query getCustomerSubscriptionForList($id: ID!) { customer(id: $id) { @@ -12923,8 +13008,12 @@ export type RetryWebhookMutationHookResult = ReturnType; export type RetryWebhookMutationOptions = Apollo.BaseMutationOptions; export const GetGrossRevenuesDocument = gql` - query getGrossRevenues($currency: CurrencyEnum!, $externalCustomerId: String) { - grossRevenues(currency: $currency, externalCustomerId: $externalCustomerId) { + query getGrossRevenues($currency: CurrencyEnum!, $externalCustomerId: String, $months: Int) { + grossRevenues( + currency: $currency + externalCustomerId: $externalCustomerId + months: $months + ) { collection { amountCents currency @@ -12948,6 +13037,7 @@ export const GetGrossRevenuesDocument = gql` * variables: { * currency: // value for 'currency' * externalCustomerId: // value for 'externalCustomerId' + * months: // value for 'months' * }, * }); */ @@ -19493,6 +19583,141 @@ export type GetCustomerInfosForDraftInvoicesListQueryHookResult = ReturnType; export type GetCustomerInfosForDraftInvoicesListSuspenseQueryHookResult = ReturnType; export type GetCustomerInfosForDraftInvoicesListQueryResult = Apollo.QueryResult; +export const GetRequestOverduePaymentAccessDocument = gql` + query getRequestOverduePaymentAccess { + organization { + premiumIntegrations + } +} + `; + +/** + * __useGetRequestOverduePaymentAccessQuery__ + * + * To run a query within a React component, call `useGetRequestOverduePaymentAccessQuery` and pass it any options that fit your needs. + * When your component renders, `useGetRequestOverduePaymentAccessQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetRequestOverduePaymentAccessQuery({ + * variables: { + * }, + * }); + */ +export function useGetRequestOverduePaymentAccessQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetRequestOverduePaymentAccessDocument, options); + } +export function useGetRequestOverduePaymentAccessLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetRequestOverduePaymentAccessDocument, options); + } +export function useGetRequestOverduePaymentAccessSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetRequestOverduePaymentAccessDocument, options); + } +export type GetRequestOverduePaymentAccessQueryHookResult = ReturnType; +export type GetRequestOverduePaymentAccessLazyQueryHookResult = ReturnType; +export type GetRequestOverduePaymentAccessSuspenseQueryHookResult = ReturnType; +export type GetRequestOverduePaymentAccessQueryResult = Apollo.QueryResult; +export const GetRequestOverduePaymentInfosDocument = gql` + query getRequestOverduePaymentInfos($id: ID!) { + organization { + defaultCurrency + ...OrganizationForRequestOverduePaymentEmail + } + customer(id: $id) { + externalId + currency + ...CustomerForRequestOverduePaymentForm + ...CustomerForRequestOverduePaymentEmail + } + paymentRequests { + collection { + ...LastPaymentRequest + } + } + invoices(paymentOverdue: true, customerId: $id) { + collection { + ...InvoicesForRequestOverduePaymentEmail + ...InvoicesForRequestOverduePaymentForm + } + } +} + ${OrganizationForRequestOverduePaymentEmailFragmentDoc} +${CustomerForRequestOverduePaymentFormFragmentDoc} +${CustomerForRequestOverduePaymentEmailFragmentDoc} +${LastPaymentRequestFragmentDoc} +${InvoicesForRequestOverduePaymentEmailFragmentDoc} +${InvoicesForRequestOverduePaymentFormFragmentDoc}`; + +/** + * __useGetRequestOverduePaymentInfosQuery__ + * + * To run a query within a React component, call `useGetRequestOverduePaymentInfosQuery` and pass it any options that fit your needs. + * When your component renders, `useGetRequestOverduePaymentInfosQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetRequestOverduePaymentInfosQuery({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useGetRequestOverduePaymentInfosQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetRequestOverduePaymentInfosQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetRequestOverduePaymentInfosDocument, options); + } +export function useGetRequestOverduePaymentInfosLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetRequestOverduePaymentInfosDocument, options); + } +export function useGetRequestOverduePaymentInfosSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetRequestOverduePaymentInfosDocument, options); + } +export type GetRequestOverduePaymentInfosQueryHookResult = ReturnType; +export type GetRequestOverduePaymentInfosLazyQueryHookResult = ReturnType; +export type GetRequestOverduePaymentInfosSuspenseQueryHookResult = ReturnType; +export type GetRequestOverduePaymentInfosQueryResult = Apollo.QueryResult; +export const CreatePaymentRequestDocument = gql` + mutation createPaymentRequest($input: PaymentRequestCreateInput!) { + createPaymentRequest(input: $input) { + id + } +} + `; +export type CreatePaymentRequestMutationFn = Apollo.MutationFunction; + +/** + * __useCreatePaymentRequestMutation__ + * + * To run a mutation, you first call `useCreatePaymentRequestMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCreatePaymentRequestMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [createPaymentRequestMutation, { data, loading, error }] = useCreatePaymentRequestMutation({ + * variables: { + * input: // value for 'input' + * }, + * }); + */ +export function useCreatePaymentRequestMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreatePaymentRequestDocument, options); + } +export type CreatePaymentRequestMutationHookResult = ReturnType; +export type CreatePaymentRequestMutationResult = Apollo.MutationResult; +export type CreatePaymentRequestMutationOptions = Apollo.BaseMutationOptions; export const CustomersDocument = gql` query customers($page: Int, $limit: Int, $searchTerm: String) { customers(page: $page, limit: $limit, searchTerm: $searchTerm) { diff --git a/src/hooks/usePermissions.ts b/src/hooks/usePermissions.ts index 0c2a31696..7bb47b8f3 100644 --- a/src/hooks/usePermissions.ts +++ b/src/hooks/usePermissions.ts @@ -13,6 +13,7 @@ gql` addonsUpdate addonsView analyticsView + analyticsOverdueBalancesView billableMetricsCreate billableMetricsDelete billableMetricsUpdate diff --git a/src/pages/CustomerDetails.tsx b/src/pages/CustomerDetails.tsx index 5ab49f33d..870b3ef29 100644 --- a/src/pages/CustomerDetails.tsx +++ b/src/pages/CustomerDetails.tsx @@ -39,6 +39,7 @@ import { CREATE_WALLET_ROUTE, CUSTOMER_DETAILS_ROUTE, CUSTOMER_DETAILS_TAB_ROUTE, + CUSTOMER_REQUEST_OVERDUE_PAYMENT_ROUTE, CUSTOMERS_LIST_ROUTE, } from '~/core/router' import { @@ -64,6 +65,7 @@ gql` creditNotesCreditsAvailableCount creditNotesBalanceAmountCents applicableTimezone + hasOverdueInvoices ...AddCustomerDrawer ...CustomerMainInfos } @@ -135,6 +137,7 @@ const CustomerDetails = () => { externalId, hasActiveWallet, hasCreditNotes, + hasOverdueInvoices, name, applicableTimezone, } = data?.customer || {} @@ -193,6 +196,23 @@ const CustomerDetails = () => { > {({ closePopper }) => ( + {hasOverdueInvoices && ( + + )} + {hasPermissions(['subscriptionsCreate']) && (