From fddae06e0dba3eb4e88f9c630b310161c5f78cba Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Sat, 2 Nov 2024 17:51:18 +0200 Subject: [PATCH 1/9] chore(translations): create translations --- translations/base.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/translations/base.json b/translations/base.json index 0ffdf8078..9875d8281 100644 --- a/translations/base.json +++ b/translations/base.json @@ -2570,6 +2570,7 @@ "text_1729262241097k3cnpci6p5j": "Prepaid credits", "text_1729262339446mk289ygp31g": "Refund customer", "text_17295725378539prq3x0wpry": "{{invoiceNumber}} for a remaining subtotal of {{subtotal}}", +<<<<<<< HEAD "text_1730132579304cmiwba11ha6": "Received at", "text_1729771640162n696lisyg7u": "Aggregate on", "text_1729771640162c43hsk6e4tg": "Unique field", @@ -2592,5 +2593,19 @@ "text_1729773655417m826qhyr465": "Test expression", "text_17297736554176g6clgo34du": "Define expression", "text_1729864793151rrlucly2t6d": "Invalid expression", - "text_1729864971171gfdioq71rvt": "Not valid" + "text_1729864971171gfdioq71rvt": "Not valid", + "text_1730132579304cmiwba11ha6": "Received at", + "text_1730554642648mbs3upovd2q": "Apply rounding to aggregated total units", + "text_1730554642648xg3fknfme8w": "By default, Lago does not round this data, but you can specify custom rounding rules to adjust the aggregated total units.", + "text_173055464264877451cjmqa1": "Add a rounding rule", + "text_1730554642648npqmnqnsynd": "Search and select a rounding rule", + "text_17305546426481bes2lelpqf": "Ceil", + "text_1730554642648grbu07mq6u3": "Rounds a number up to the nearest integer (e.g. 4.2 = 5)", + "text_1730554642648f6pn2krp9sh": "Floor", + "text_173055464264830liis0ojbc": "Rounds a number down to the nearest integer (e.g. 4.2 = 4)", + "text_1730554642648p1mngqwys8n": "Round", + "text_1730554642648qe9wjveh3fv": "Rounds a number based on the decimals value (e.g. 4.2 = 4 or 4.6 = 5)", + "text_17305547268320wyhpbm8hh0": "Rounding rule", + "text_1730554726832vyn9bep4u0f": "Precision (optional)" } + From 6465d76072d455f63a393af564e1bc6f82024875 Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Sat, 2 Nov 2024 17:51:34 +0200 Subject: [PATCH 2/9] chore(graphql): generate types --- src/generated/graphql.tsx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/generated/graphql.tsx b/src/generated/graphql.tsx index 4455cde6e..2274bacf8 100644 --- a/src/generated/graphql.tsx +++ b/src/generated/graphql.tsx @@ -236,7 +236,6 @@ export type BillableMetric = { deletedAt?: Maybe; description?: Maybe; draftInvoicesCount: Scalars['Int']['output']; - expression?: Maybe; fieldName?: Maybe; filters?: Maybe>; id: Scalars['ID']['output']; @@ -245,6 +244,8 @@ export type BillableMetric = { organization?: Maybe; plansCount: Scalars['Int']['output']; recurring: Scalars['Boolean']['output']; + roundingFunction?: Maybe; + roundingPrecision?: Maybe; subscriptionsCount: Scalars['Int']['output']; updatedAt: Scalars['ISO8601DateTime']['output']; weightedInterval?: Maybe; @@ -1049,11 +1050,12 @@ export type CreateBillableMetricInput = { clientMutationId?: InputMaybe; code: Scalars['String']['input']; description: Scalars['String']['input']; - expression?: InputMaybe; fieldName?: InputMaybe; filters?: InputMaybe>; name: Scalars['String']['input']; recurring?: InputMaybe; + roundingFunction?: InputMaybe; + roundingPrecision?: InputMaybe; weightedInterval?: InputMaybe; }; @@ -2725,6 +2727,7 @@ export enum IntegrationTypeEnum { Netsuite = 'netsuite', Okta = 'okta', ProgressiveBilling = 'progressive_billing', + RevenueAnalytics = 'revenue_analytics', Xero = 'xero' } @@ -4153,6 +4156,7 @@ export enum PremiumIntegrationTypeEnum { Netsuite = 'netsuite', Okta = 'okta', ProgressiveBilling = 'progressive_billing', + RevenueAnalytics = 'revenue_analytics', Xero = 'xero' } @@ -4870,6 +4874,12 @@ export type RevokeMembershipInput = { id: Scalars['ID']['input']; }; +export enum RoundingFunctionEnum { + Ceil = 'ceil', + Floor = 'floor', + Round = 'round' +} + export enum StatusTypeEnum { Active = 'active', Canceled = 'canceled', @@ -5389,12 +5399,13 @@ export type UpdateBillableMetricInput = { clientMutationId?: InputMaybe; code: Scalars['String']['input']; description: Scalars['String']['input']; - expression?: InputMaybe; fieldName?: InputMaybe; filters?: InputMaybe>; id: Scalars['String']['input']; name: Scalars['String']['input']; recurring?: InputMaybe; + roundingFunction?: InputMaybe; + roundingPrecision?: InputMaybe; weightedInterval?: InputMaybe; }; @@ -7659,7 +7670,7 @@ export type GetSingleBillableMetricQueryVariables = Exact<{ }>; -export type GetSingleBillableMetricQuery = { __typename?: 'Query', billableMetric?: { __typename?: 'BillableMetric', id: string, name: string, code: string, expression?: string | null, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, subscriptionsCount: number, plansCount: number, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null } | null }; +export type GetSingleBillableMetricQuery = { __typename?: 'Query', billableMetric?: { __typename?: 'BillableMetric', id: string, name: string, code: string, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, subscriptionsCount: number, plansCount: number, recurring: boolean, roundingFunction?: RoundingFunctionEnum | null, roundingPrecision?: number | null, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null } | null }; export type CreateBillableMetricMutationVariables = Exact<{ input: CreateBillableMetricInput; @@ -7888,7 +7899,7 @@ export type GetTaxesForAddOnFormQueryVariables = Exact<{ export type GetTaxesForAddOnFormQuery = { __typename?: 'Query', taxes: { __typename?: 'TaxCollection', metadata: { __typename?: 'CollectionMetadata', currentPage: number, totalPages: number }, collection: Array<{ __typename?: 'Tax', id: string, name: string, rate: number, code: string }> } }; -export type EditBillableMetricFragment = { __typename?: 'BillableMetric', id: string, name: string, code: string, expression?: string | null, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, subscriptionsCount: number, plansCount: number, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null }; +export type EditBillableMetricFragment = { __typename?: 'BillableMetric', id: string, name: string, code: string, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, subscriptionsCount: number, plansCount: number, recurring: boolean, roundingFunction?: RoundingFunctionEnum | null, roundingPrecision?: number | null, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null }; export type CreateCreditNoteInvoiceFragment = { __typename?: 'Invoice', id: string, currency?: CurrencyEnum | null, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, creditableAmountCents: any, refundableAmountCents: any, subTotalIncludingTaxesAmountCents: any, availableToCreditAmountCents: any, paymentDisputeLostAt?: any | null, invoiceType: InvoiceTypeEnum, couponsAmountCents: any, feesAmountCents: any, versionNumber: number, fees?: Array<{ __typename?: 'Fee', id: string, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxName: string, taxRate: number }> | null }> | null }; @@ -10674,13 +10685,14 @@ export const EditBillableMetricFragmentDoc = gql` id name code - expression description aggregationType fieldName subscriptionsCount plansCount recurring + roundingFunction + roundingPrecision filters { key values From 5cd71e65fd0200409b66585d95696082371a19f9 Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Sat, 2 Nov 2024 17:51:56 +0200 Subject: [PATCH 3/9] feat(ComboBox): add support for containerClassName --- src/components/form/ComboBox/ComboBox.tsx | 2 ++ src/components/form/ComboBox/ComboBoxField.tsx | 4 ++++ src/components/form/ComboBox/types.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/src/components/form/ComboBox/ComboBox.tsx b/src/components/form/ComboBox/ComboBox.tsx index abc87cd29..cceb5105e 100644 --- a/src/components/form/ComboBox/ComboBox.tsx +++ b/src/components/form/ComboBox/ComboBox.tsx @@ -31,6 +31,7 @@ export const ComboBox = ({ error, PopperProps, className, + containerClassName = '', searchQuery, emptyText, disableClearable = false, @@ -91,6 +92,7 @@ export const ComboBox = ({ return ( { diff --git a/src/components/form/ComboBox/ComboBoxField.tsx b/src/components/form/ComboBox/ComboBoxField.tsx index be88fdaa3..01df85f65 100644 --- a/src/components/form/ComboBox/ComboBoxField.tsx +++ b/src/components/form/ComboBox/ComboBoxField.tsx @@ -11,6 +11,7 @@ interface ComboBoxFieldProps extends Omit isEmptyNull?: Boolean // If false, on field reset the combobox will return an empty string + containerClassName?: string } export const ComboBoxField = memo( @@ -20,12 +21,14 @@ export const ComboBoxField = memo( formikProps, renderGroupHeader, data, + containerClassName, ...props }: ComboBoxFieldProps) => { const { setFieldValue, values, errors, touched } = formikProps return renderGroupHeader ? ( ) : ( | undefined }> > + containerClassName?: string } interface GroupedComboboxProps extends Omit { From 712e00fe16424679ae4f7125ba7a08e80c3efe96 Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Sat, 2 Nov 2024 20:54:02 +0200 Subject: [PATCH 4/9] feat(BillableMetric): introduce roundingFunction / roundingPrecision --- src/hooks/useCreateEditBillableMetric.ts | 2 ++ src/pages/CreateBillableMetric.tsx | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/hooks/useCreateEditBillableMetric.ts b/src/hooks/useCreateEditBillableMetric.ts index 9a9d1c843..6a9495c4e 100644 --- a/src/hooks/useCreateEditBillableMetric.ts +++ b/src/hooks/useCreateEditBillableMetric.ts @@ -101,6 +101,8 @@ export const useCreateEditBillableMetric: () => UseCreateEditBillableMetricRetur const mutationInput = (values: CreateBillableMetricInput | UpdateBillableMetricInput) => { return { ...values, + roundingPrecision: values.roundingPrecision ? Number(values.roundingPrecision) : null, + roundingFunction: values.roundingFunction ?? null, weightedInterval: values.aggregationType === AggregationTypeEnum.WeightedSumAgg ? WeightedIntervalEnum.Seconds diff --git a/src/pages/CreateBillableMetric.tsx b/src/pages/CreateBillableMetric.tsx index 9fdb1d99d..a516a37e5 100644 --- a/src/pages/CreateBillableMetric.tsx +++ b/src/pages/CreateBillableMetric.tsx @@ -5,7 +5,7 @@ import _omit from 'lodash/omit' import { useEffect, useRef, useState } from 'react' import { useNavigate } from 'react-router-dom' import styled from 'styled-components' -import { array, bool, object, string } from 'yup' +import { array, bool, number, object, string } from 'yup' import { BillableMetricCodeSnippet } from '~/components/billableMetrics/BillableMetricCodeSnippet' import { @@ -32,7 +32,11 @@ import { import { WarningDialog, WarningDialogRef } from '~/components/WarningDialog' import { FORM_ERRORS_ENUM } from '~/core/constants/form' import { BILLABLE_METRICS_ROUTE } from '~/core/router' -import { AggregationTypeEnum, CreateBillableMetricInput } from '~/generated/graphql' +import { + AggregationTypeEnum, + CreateBillableMetricInput, + RoundingFunctionEnum, +} from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { useCreateEditBillableMetric } from '~/hooks/useCreateEditBillableMetric' import { Card, PageHeader, theme } from '~/styles' @@ -61,6 +65,8 @@ gql` subscriptionsCount plansCount recurring + roundingFunction + roundingPrecision filters { key values @@ -101,6 +107,8 @@ const CreateBillableMetric = () => { aggregateOnTab: billableMetric?.expression ? AggregateOnTab.CustomExpression : AggregateOnTab.UniqueField, + roundingFunction: billableMetric?.roundingFunction || undefined, + roundingPrecision: billableMetric?.roundingPrecision || 0, }, validationSchema: object().shape({ name: string().required(''), @@ -117,6 +125,7 @@ const CreateBillableMetric = () => { then: (schema) => schema.required(''), }), recurring: bool().required(''), + roundingPrecision: number(), filters: array() .of( object().test({ From 4f804d8ebab38e63f8a66682e74b85d76e87c70b Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Sat, 2 Nov 2024 20:54:45 +0200 Subject: [PATCH 5/9] feat(BillableMetric): implement translations map --- src/pages/CreateBillableMetric.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pages/CreateBillableMetric.tsx b/src/pages/CreateBillableMetric.tsx index a516a37e5..efbefd79a 100644 --- a/src/pages/CreateBillableMetric.tsx +++ b/src/pages/CreateBillableMetric.tsx @@ -79,6 +79,24 @@ enum AggregateOnTab { CustomExpression, } +const TRANSLATIONS_MAP_ROUNDING_FUNCTION: Record< + RoundingFunctionEnum, + { label: string; description: string } +> = { + [RoundingFunctionEnum.Round]: { + label: 'text_1730554642648p1mngqwys8n', + description: 'text_1730554642648qe9wjveh3fv', + }, + [RoundingFunctionEnum.Floor]: { + label: 'text_1730554642648f6pn2krp9sh', + description: 'text_173055464264830liis0ojbc', + }, + [RoundingFunctionEnum.Ceil]: { + label: 'text_17305546426481bes2lelpqf', + description: 'text_1730554642648grbu07mq6u3', + }, +} + const CreateBillableMetric = () => { const { translate } = useInternationalization() let navigate = useNavigate() From 81b4c08f7f4b92c7b9a08fab197ed720c5606322 Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Sat, 2 Nov 2024 20:55:13 +0200 Subject: [PATCH 6/9] feat(BillableMetric): add rounding UI --- src/pages/CreateBillableMetric.tsx | 106 +++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/src/pages/CreateBillableMetric.tsx b/src/pages/CreateBillableMetric.tsx index efbefd79a..352ed568e 100644 --- a/src/pages/CreateBillableMetric.tsx +++ b/src/pages/CreateBillableMetric.tsx @@ -602,6 +602,112 @@ const CreateBillableMetric = () => { )} + {!(isEdition && !canBeEdited && !billableMetric?.roundingFunction) && ( +
+
+ + {translate('text_1730554642648mbs3upovd2q')} + + + + {translate('text_1730554642648xg3fknfme8w')} + +
+ + {formikProps.values.roundingFunction === undefined && ( +
+ +
+ )} + + {(formikProps.values.roundingFunction || + formikProps.values.roundingFunction === null) && ( +
+
+ + {translate('text_17305547268320wyhpbm8hh0')} + + } + placeholder={translate('text_1730554642648npqmnqnsynd')} + data={Object.values(RoundingFunctionEnum) + .filter( + (roundingFunction) => + !!TRANSLATIONS_MAP_ROUNDING_FUNCTION[roundingFunction], + ) + .map((roundingFunction) => ({ + label: translate( + TRANSLATIONS_MAP_ROUNDING_FUNCTION[roundingFunction].label, + ), + description: translate( + TRANSLATIONS_MAP_ROUNDING_FUNCTION[roundingFunction] + .description, + ), + value: roundingFunction, + }))} + /> + + {formikProps.values.roundingFunction && ( + + {translate('text_1730554726832vyn9bep4u0f')} + + } + placeholder="0" + formikProps={formikProps} + /> + )} +
+ + {!(isEdition && !canBeEdited) && ( +
+
+ )} +
+ )} + + + {formikProps.values.roundingFunction && + translate( + TRANSLATIONS_MAP_ROUNDING_FUNCTION[ + formikProps.values.roundingFunction + ].description, + )} + +
+ )} +
From 606a7121161aa16ad22b3c7f06dee4b5eb2cba0a Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Mon, 4 Nov 2024 11:43:40 +0200 Subject: [PATCH 7/9] refactor(roundingPrecision): default to empty instead of 0 --- src/pages/CreateBillableMetric.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/CreateBillableMetric.tsx b/src/pages/CreateBillableMetric.tsx index 352ed568e..8fd41cd35 100644 --- a/src/pages/CreateBillableMetric.tsx +++ b/src/pages/CreateBillableMetric.tsx @@ -126,7 +126,7 @@ const CreateBillableMetric = () => { ? AggregateOnTab.CustomExpression : AggregateOnTab.UniqueField, roundingFunction: billableMetric?.roundingFunction || undefined, - roundingPrecision: billableMetric?.roundingPrecision || 0, + roundingPrecision: billableMetric?.roundingPrecision || undefined, }, validationSchema: object().shape({ name: string().required(''), @@ -621,7 +621,6 @@ const CreateBillableMetric = () => { startIcon="plus" onClick={() => { formikProps.setFieldValue('roundingFunction', null) - formikProps.setFieldValue('roundingPrecision', 0) }} > {translate('text_173055464264877451cjmqa1')} @@ -689,7 +688,7 @@ const CreateBillableMetric = () => { e.stopPropagation() formikProps.setFieldValue('roundingFunction', undefined) - formikProps.setFieldValue('roundingPrecision', 0) + formikProps.setFieldValue('roundingPrecision', undefined) }} />
From ae06d892a8e8ee4638c2c8ec7f61346eb266e9ad Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Tue, 5 Nov 2024 16:19:41 +0200 Subject: [PATCH 8/9] fix(translations): conflicts --- translations/base.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/translations/base.json b/translations/base.json index 9875d8281..457a07ba8 100644 --- a/translations/base.json +++ b/translations/base.json @@ -2570,8 +2570,6 @@ "text_1729262241097k3cnpci6p5j": "Prepaid credits", "text_1729262339446mk289ygp31g": "Refund customer", "text_17295725378539prq3x0wpry": "{{invoiceNumber}} for a remaining subtotal of {{subtotal}}", -<<<<<<< HEAD - "text_1730132579304cmiwba11ha6": "Received at", "text_1729771640162n696lisyg7u": "Aggregate on", "text_1729771640162c43hsk6e4tg": "Unique field", "text_1729771640162wd2k9x6mrvh": "Custom expression", @@ -2608,4 +2606,3 @@ "text_17305547268320wyhpbm8hh0": "Rounding rule", "text_1730554726832vyn9bep4u0f": "Precision (optional)" } - From 707ab772649a154d59a373b7e060fdfa76a4eb23 Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Tue, 5 Nov 2024 17:39:35 +0200 Subject: [PATCH 9/9] chore(graphql): generate types --- src/generated/graphql.tsx | 67 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/src/generated/graphql.tsx b/src/generated/graphql.tsx index 2274bacf8..702efb879 100644 --- a/src/generated/graphql.tsx +++ b/src/generated/graphql.tsx @@ -179,6 +179,14 @@ export type AnrokIntegration = { name: Scalars['String']['output']; }; +export type ApiKey = { + __typename?: 'ApiKey'; + createdAt: Scalars['ISO8601DateTime']['output']; + expiresAt?: Maybe; + id: Scalars['ID']['output']; + value: Scalars['String']['output']; +}; + export type AppliedAddOn = { __typename?: 'AppliedAddOn'; addOn: AddOn; @@ -236,6 +244,7 @@ export type BillableMetric = { deletedAt?: Maybe; description?: Maybe; draftInvoicesCount: Scalars['Int']['output']; + expression?: Maybe; fieldName?: Maybe; filters?: Maybe>; id: Scalars['ID']['output']; @@ -1050,6 +1059,7 @@ export type CreateBillableMetricInput = { clientMutationId?: InputMaybe; code: Scalars['String']['input']; description: Scalars['String']['input']; + expression?: InputMaybe; fieldName?: InputMaybe; filters?: InputMaybe>; name: Scalars['String']['input']; @@ -1496,6 +1506,8 @@ export enum CurrencyEnum { Bdt = 'BDT', /** Bulgarian Lev */ Bgn = 'BGN', + /** Bahraini Dinar */ + Bhd = 'BHD', /** Burundian Franc */ Bif = 'BIF', /** Bermudian Dollar */ @@ -1757,6 +1769,7 @@ export type CurrentOrganization = { addressLine2?: Maybe; adyenPaymentProviders?: Maybe>; apiKey?: Maybe; + appliedDunningCampaign?: Maybe; billingConfiguration?: Maybe; city?: Maybe; country?: Maybe; @@ -3247,6 +3260,8 @@ export type Mutation = { revokeInvite?: Maybe; /** Revoke a membership */ revokeMembership?: Maybe; + /** Create new ApiKey while expiring provided */ + rotateApiKey?: Maybe; /** Sync crm integration invoice */ syncCrmIntegrationInvoice?: Maybe; /** Sync integration credit note */ @@ -3687,6 +3702,11 @@ export type MutationRevokeMembershipArgs = { }; +export type MutationRotateApiKeyArgs = { + input: RotateApiKeyInput; +}; + + export type MutationSyncCrmIntegrationInvoiceArgs = { input: SyncCrmIntegrationInvoiceInput; }; @@ -4106,6 +4126,7 @@ export type Plan = { customersCount: Scalars['Int']['output']; description?: Maybe; draftInvoicesCount: Scalars['Int']['output']; + hasOverriddenPlans?: Maybe; id: Scalars['ID']['output']; interval: PlanInterval; invoiceDisplayName?: Maybe; @@ -4229,6 +4250,10 @@ export type Query = { addOn?: Maybe; /** Query add-ons of an organization */ addOns: AddOnCollection; + /** Query the API key */ + apiKey: ApiKey; + /** Query the API keys of current organization */ + apiKeys: SanitizedApiKeyCollection; /** Query a single billable metric of an organization */ billableMetric?: Maybe; /** Query billable metrics of an organization */ @@ -4366,6 +4391,17 @@ export type QueryAddOnsArgs = { }; +export type QueryApiKeyArgs = { + id: Scalars['ID']['input']; +}; + + +export type QueryApiKeysArgs = { + limit?: InputMaybe; + page?: InputMaybe; +}; + + export type QueryBillableMetricArgs = { id: Scalars['ID']['input']; }; @@ -4874,12 +4910,36 @@ export type RevokeMembershipInput = { id: Scalars['ID']['input']; }; +/** Autogenerated input type of RotateApiKey */ +export type RotateApiKeyInput = { + /** A unique identifier for the client performing the mutation. */ + clientMutationId?: InputMaybe; + id: Scalars['ID']['input']; +}; + export enum RoundingFunctionEnum { Ceil = 'ceil', Floor = 'floor', Round = 'round' } +export type SanitizedApiKey = { + __typename?: 'SanitizedApiKey'; + createdAt: Scalars['ISO8601DateTime']['output']; + expiresAt?: Maybe; + id: Scalars['ID']['output']; + value: Scalars['String']['output']; +}; + +/** SanitizedApiKeyCollection type */ +export type SanitizedApiKeyCollection = { + __typename?: 'SanitizedApiKeyCollection'; + /** A collection of paginated SanitizedApiKeyCollection */ + collection: Array; + /** Pagination Metadata for navigating the Pagination */ + metadata: CollectionMetadata; +}; + export enum StatusTypeEnum { Active = 'active', Canceled = 'canceled', @@ -5399,6 +5459,7 @@ export type UpdateBillableMetricInput = { clientMutationId?: InputMaybe; code: Scalars['String']['input']; description: Scalars['String']['input']; + expression?: InputMaybe; fieldName?: InputMaybe; filters?: InputMaybe>; id: Scalars['String']['input']; @@ -5665,6 +5726,7 @@ export type UpdatePlanInput = { amountCents: Scalars['BigInt']['input']; amountCurrency: CurrencyEnum; billChargesMonthly?: InputMaybe; + cascadeUpdates?: InputMaybe; charges: Array; /** A unique identifier for the client performing the mutation. */ clientMutationId?: InputMaybe; @@ -7670,7 +7732,7 @@ export type GetSingleBillableMetricQueryVariables = Exact<{ }>; -export type GetSingleBillableMetricQuery = { __typename?: 'Query', billableMetric?: { __typename?: 'BillableMetric', id: string, name: string, code: string, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, subscriptionsCount: number, plansCount: number, recurring: boolean, roundingFunction?: RoundingFunctionEnum | null, roundingPrecision?: number | null, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null } | null }; +export type GetSingleBillableMetricQuery = { __typename?: 'Query', billableMetric?: { __typename?: 'BillableMetric', id: string, name: string, code: string, expression?: string | null, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, subscriptionsCount: number, plansCount: number, recurring: boolean, roundingFunction?: RoundingFunctionEnum | null, roundingPrecision?: number | null, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null } | null }; export type CreateBillableMetricMutationVariables = Exact<{ input: CreateBillableMetricInput; @@ -7899,7 +7961,7 @@ export type GetTaxesForAddOnFormQueryVariables = Exact<{ export type GetTaxesForAddOnFormQuery = { __typename?: 'Query', taxes: { __typename?: 'TaxCollection', metadata: { __typename?: 'CollectionMetadata', currentPage: number, totalPages: number }, collection: Array<{ __typename?: 'Tax', id: string, name: string, rate: number, code: string }> } }; -export type EditBillableMetricFragment = { __typename?: 'BillableMetric', id: string, name: string, code: string, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, subscriptionsCount: number, plansCount: number, recurring: boolean, roundingFunction?: RoundingFunctionEnum | null, roundingPrecision?: number | null, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null }; +export type EditBillableMetricFragment = { __typename?: 'BillableMetric', id: string, name: string, code: string, expression?: string | null, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, subscriptionsCount: number, plansCount: number, recurring: boolean, roundingFunction?: RoundingFunctionEnum | null, roundingPrecision?: number | null, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null }; export type CreateCreditNoteInvoiceFragment = { __typename?: 'Invoice', id: string, currency?: CurrencyEnum | null, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, creditableAmountCents: any, refundableAmountCents: any, subTotalIncludingTaxesAmountCents: any, availableToCreditAmountCents: any, paymentDisputeLostAt?: any | null, invoiceType: InvoiceTypeEnum, couponsAmountCents: any, feesAmountCents: any, versionNumber: number, fees?: Array<{ __typename?: 'Fee', id: string, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxName: string, taxRate: number }> | null }> | null }; @@ -10685,6 +10747,7 @@ export const EditBillableMetricFragmentDoc = gql` id name code + expression description aggregationType fieldName