@greatapps/common 1.1.742 → 1.1.743
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/modals/billing/RequiredBillingDataModal.mjs +14 -30
- package/dist/components/modals/billing/RequiredBillingDataModal.mjs.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/dist/modules/accounts/hooks/use-required-billing-data.hook.mjs +3 -5
- package/dist/modules/accounts/hooks/use-required-billing-data.hook.mjs.map +1 -1
- package/dist/modules/accounts/utils/billing-data.mjs +12 -11
- package/dist/modules/accounts/utils/billing-data.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/modals/billing/RequiredBillingDataModal.tsx +32 -66
- package/src/index.ts +4 -1
- package/src/modules/accounts/hooks/use-required-billing-data.hook.ts +3 -4
- package/src/modules/accounts/utils/billing-data.ts +24 -17
|
@@ -24,7 +24,7 @@ const COUNTRY_OPTIONS = COUNTRIES.map((country) => ({
|
|
|
24
24
|
value: country.iso,
|
|
25
25
|
label: country.name
|
|
26
26
|
}));
|
|
27
|
-
function buildBillingDataSchema(
|
|
27
|
+
function buildBillingDataSchema(translate) {
|
|
28
28
|
const requiredText = z.string().trim().min(1, translate("common.billing.requiredData.requiredField"));
|
|
29
29
|
const base = z.object({
|
|
30
30
|
personType: z.enum(["pf", "pj"]),
|
|
@@ -40,7 +40,6 @@ function buildBillingDataSchema(isInternational, translate) {
|
|
|
40
40
|
state: requiredText,
|
|
41
41
|
country: requiredText
|
|
42
42
|
});
|
|
43
|
-
if (isInternational) return base;
|
|
44
43
|
return base.superRefine((data, ctx) => {
|
|
45
44
|
if (!data.streetNumber) {
|
|
46
45
|
ctx.addIssue({
|
|
@@ -90,14 +89,14 @@ function formatDocument(document, isCompany) {
|
|
|
90
89
|
function RequiredBillingDataModalContent() {
|
|
91
90
|
const translate = useTranslations();
|
|
92
91
|
const { user } = useAuth();
|
|
93
|
-
const { isRequired, account
|
|
92
|
+
const { isRequired, account } = useRequiredBillingData();
|
|
94
93
|
const { mutateAsync: updateBillingData } = useUpdateBillingData();
|
|
95
94
|
const { mutateAsync: lookupCep } = useViaCep();
|
|
96
95
|
const [isSubmitted, setIsSubmitted] = useState(false);
|
|
97
96
|
const isPrefilled = useRef(false);
|
|
98
97
|
const schema = useMemo(
|
|
99
|
-
() => buildBillingDataSchema(
|
|
100
|
-
[
|
|
98
|
+
() => buildBillingDataSchema(translate),
|
|
99
|
+
[translate]
|
|
101
100
|
);
|
|
102
101
|
const form = useForm({
|
|
103
102
|
resolver: zodResolver(schema),
|
|
@@ -144,9 +143,9 @@ function RequiredBillingDataModalContent() {
|
|
|
144
143
|
neighborhood: account.neighborhood ?? "",
|
|
145
144
|
city: account.city ?? "",
|
|
146
145
|
state: account.state ?? "",
|
|
147
|
-
country: account.country ||
|
|
146
|
+
country: account.country || "BR"
|
|
148
147
|
});
|
|
149
|
-
}, [account,
|
|
148
|
+
}, [account, reset, user?.email]);
|
|
150
149
|
const handleDocumentChange = (rawValue) => {
|
|
151
150
|
setValue("document", isCompany ? formatCNPJ(rawValue) : formatCPF(rawValue), {
|
|
152
151
|
shouldValidate: true
|
|
@@ -158,10 +157,6 @@ function RequiredBillingDataModalContent() {
|
|
|
158
157
|
setValue("personType", value, { shouldValidate: true });
|
|
159
158
|
};
|
|
160
159
|
const handleCepChange = (rawValue) => {
|
|
161
|
-
if (isInternational) {
|
|
162
|
-
setValue("cep", rawValue, { shouldValidate: true });
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
160
|
setValue("cep", formatPostalCode(rawValue), { shouldValidate: true });
|
|
166
161
|
const digits = rawValue.replace(/\D/g, "");
|
|
167
162
|
if (digits.length !== 8) return;
|
|
@@ -175,10 +170,8 @@ function RequiredBillingDataModalContent() {
|
|
|
175
170
|
};
|
|
176
171
|
async function onSubmit(data) {
|
|
177
172
|
const payload = {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
financial_document: data.document
|
|
181
|
-
},
|
|
173
|
+
financial_document_type: data.personType === "pf" ? 1 : 2,
|
|
174
|
+
financial_document: data.document,
|
|
182
175
|
financial_name: data.financialName,
|
|
183
176
|
financial_email: data.financialEmail,
|
|
184
177
|
zipcode: data.cep,
|
|
@@ -238,7 +231,7 @@ function RequiredBillingDataModalContent() {
|
|
|
238
231
|
children: [
|
|
239
232
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 p-4 lg:p-5 flex-1 overflow-y-auto", children: [
|
|
240
233
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
241
|
-
|
|
234
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
242
235
|
/* @__PURE__ */ jsx(
|
|
243
236
|
Controller,
|
|
244
237
|
{
|
|
@@ -307,8 +300,8 @@ function RequiredBillingDataModalContent() {
|
|
|
307
300
|
/* @__PURE__ */ jsx(
|
|
308
301
|
FormField,
|
|
309
302
|
{
|
|
310
|
-
label:
|
|
311
|
-
placeholder:
|
|
303
|
+
label: translate("common.billing.requiredData.cep"),
|
|
304
|
+
placeholder: "_____-___",
|
|
312
305
|
error: !!errors.cep,
|
|
313
306
|
errorMessage: errors.cep?.message,
|
|
314
307
|
...register("cep", {
|
|
@@ -327,7 +320,7 @@ function RequiredBillingDataModalContent() {
|
|
|
327
320
|
...register("street")
|
|
328
321
|
}
|
|
329
322
|
) }),
|
|
330
|
-
|
|
323
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
331
324
|
FormField,
|
|
332
325
|
{
|
|
333
326
|
label: translate("common.billing.requiredData.streetNumber"),
|
|
@@ -339,7 +332,7 @@ function RequiredBillingDataModalContent() {
|
|
|
339
332
|
) })
|
|
340
333
|
] }),
|
|
341
334
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
342
|
-
|
|
335
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
343
336
|
FormField,
|
|
344
337
|
{
|
|
345
338
|
label: translate("common.billing.requiredData.neighborhood"),
|
|
@@ -370,16 +363,7 @@ function RequiredBillingDataModalContent() {
|
|
|
370
363
|
...register("city")
|
|
371
364
|
}
|
|
372
365
|
) }),
|
|
373
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1", children:
|
|
374
|
-
FormField,
|
|
375
|
-
{
|
|
376
|
-
label: translate("common.billing.requiredData.stateProvince"),
|
|
377
|
-
placeholder: translate("common.billing.requiredData.typeHere"),
|
|
378
|
-
error: !!errors.state,
|
|
379
|
-
errorMessage: errors.state?.message,
|
|
380
|
-
...register("state")
|
|
381
|
-
}
|
|
382
|
-
) : /* @__PURE__ */ jsx(
|
|
366
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
383
367
|
Controller,
|
|
384
368
|
{
|
|
385
369
|
name: "state",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/modals/billing/RequiredBillingDataModal.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- o generic Translator do next-intl não é\n expressável estruturalmente; o `any` do TranslateFn é intencional e está contido neste arquivo\n (mesmo padrão de modules/plans/utils/map-api-plan-to-ui.ts). */\n'use client';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { useTranslations } from 'next-intl';\nimport { toast } from 'sonner';\nimport z from 'zod';\nimport { IconFileInvoice } from '@tabler/icons-react';\n\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../../ui/overlay/Dialog';\nimport { Button } from '../../ui/buttons/Button';\nimport { FormField } from '../../ui/form/FormField';\nimport { SelectField } from '../../ui/form/SelectField';\nimport { Toast } from '../../ui/feedback/Toast';\nimport { useAuth } from '../../../providers/auth.provider';\nimport { useViaCep } from '../../../modules/accounts/hooks/useViaCep';\nimport { useUpdateBillingData } from '../../../modules/accounts/hooks/useAccountManagement';\nimport { useRequiredBillingData } from '../../../modules/accounts/hooks/use-required-billing-data.hook';\nimport { COUNTRIES } from '../../../utils/countries';\nimport { BR_STATE_OPTIONS } from '../../../utils/constants/br-states';\nimport { formatCNPJ, formatCPF, formatPostalCode } from '../../../utils/format/masks';\nimport { isValidCNPJ, isValidCPF } from '../../../utils/validators/common';\nimport type { UpdateBillingDataRequest } from '../../../modules/accounts/types';\n\ntype TranslateFn = (key: any, values?: Record<string, string | number>) => string;\n\ntype BillingDataFormValues = {\n personType: 'pf' | 'pj';\n document: string;\n financialName: string;\n financialEmail: string;\n cep: string;\n street: string;\n streetNumber: string;\n complement?: string;\n neighborhood: string;\n city: string;\n state: string;\n country: string;\n};\n\nconst COUNTRY_OPTIONS = COUNTRIES.map((country: { iso: string; name: string }) => ({\n value: country.iso,\n label: country.name,\n}));\n\nfunction buildBillingDataSchema(isInternational: boolean, translate: TranslateFn) {\n const requiredText = z\n .string()\n .trim()\n .min(1, translate('common.billing.requiredData.requiredField'));\n\n const base = z.object({\n personType: z.enum(['pf', 'pj']),\n document: z.string().trim(),\n financialName: requiredText,\n financialEmail: z\n .string()\n .trim()\n .min(1, translate('common.billing.requiredData.requiredField'))\n .email(translate('common.billing.requiredData.invalidEmail')),\n cep: requiredText,\n street: requiredText,\n streetNumber: z.string().trim(),\n complement: z.string().trim().optional(),\n neighborhood: z.string().trim(),\n city: requiredText,\n state: requiredText,\n country: requiredText,\n });\n\n /* Conta internacional não tem CPF/CNPJ, número nem bairro — mesmo recorte do\n * AddCardModal. Exigir esses campos aqui trancaria o cliente fora do app, já que\n * o modal é bloqueante. */\n if (isInternational) return base;\n\n return base.superRefine((data, ctx) => {\n if (!data.streetNumber) {\n ctx.addIssue({\n code: 'custom',\n path: ['streetNumber'],\n message: translate('common.billing.requiredData.requiredField'),\n });\n }\n\n if (!data.neighborhood) {\n ctx.addIssue({\n code: 'custom',\n path: ['neighborhood'],\n message: translate('common.billing.requiredData.requiredField'),\n });\n }\n\n if (data.cep.replace(/\\D/g, '').length !== 8) {\n ctx.addIssue({\n code: 'custom',\n path: ['cep'],\n message: translate('common.billing.requiredData.invalidCep'),\n });\n }\n\n const isCompany = data.personType === 'pj';\n const digits = data.document.replace(/\\D/g, '');\n\n if (digits.length !== (isCompany ? 14 : 11)) {\n ctx.addIssue({\n code: 'custom',\n path: ['document'],\n message: isCompany\n ? translate('common.billing.requiredData.invalidCnpj')\n : translate('common.billing.requiredData.invalidCpf'),\n });\n return;\n }\n\n /* Dígito verificador, mesmo algoritmo do backend: sem isso 111.111.111-11 passa\n * aqui e o PUT da conta é recusado depois, sem o usuário saber o motivo. */\n const isValid = isCompany ? isValidCNPJ(digits) : isValidCPF(digits);\n if (!isValid) {\n ctx.addIssue({\n code: 'custom',\n path: ['document'],\n message: isCompany\n ? translate('common.billing.requiredData.invalidCnpjChecksum')\n : translate('common.billing.requiredData.invalidCpfChecksum'),\n });\n }\n });\n}\n\nfunction formatDocument(document: string | null | undefined, isCompany: boolean) {\n if (!document) return '';\n return isCompany ? formatCNPJ(document) : formatCPF(document);\n}\n\nfunction RequiredBillingDataModalContent() {\n const translate = useTranslations();\n const { user } = useAuth();\n const { isRequired, account, isInternational } = useRequiredBillingData();\n const { mutateAsync: updateBillingData } = useUpdateBillingData();\n const { mutateAsync: lookupCep } = useViaCep();\n\n /* O modal fecha na hora do submit e não reabre enquanto o invalidate do account\n * não volta — sem isso o usuário vê o modal piscar de novo com o cache antigo. */\n const [isSubmitted, setIsSubmitted] = useState(false);\n const isPrefilled = useRef(false);\n\n const schema = useMemo(\n () => buildBillingDataSchema(isInternational, translate),\n [isInternational, translate],\n );\n\n const form = useForm<BillingDataFormValues>({\n resolver: zodResolver(schema),\n mode: 'onChange',\n defaultValues: {\n personType: 'pf',\n document: '',\n financialName: '',\n financialEmail: '',\n cep: '',\n street: '',\n streetNumber: '',\n complement: '',\n neighborhood: '',\n city: '',\n state: '',\n country: 'BR',\n },\n });\n\n const {\n register,\n control,\n handleSubmit,\n reset,\n setValue,\n watch,\n formState: { errors, isSubmitting, isValid },\n } = form;\n\n const personType = watch('personType');\n const isCompany = personType === 'pj';\n\n useEffect(() => {\n if (!account || isPrefilled.current) return;\n isPrefilled.current = true;\n\n const accountIsCompany = account.financial_document_type === 2;\n reset({\n personType: accountIsCompany ? 'pj' : 'pf',\n document: formatDocument(account.financial_document, accountIsCompany),\n financialName: account.financial_name ?? '',\n financialEmail: account.financial_email || user?.email || '',\n cep: account.zipcode ?? '',\n street: account.address ?? '',\n streetNumber: account.address_number ?? '',\n complement: account.address_complement ?? '',\n neighborhood: account.neighborhood ?? '',\n city: account.city ?? '',\n state: account.state ?? '',\n country: account.country || (isInternational ? 'US' : 'BR'),\n });\n }, [account, isInternational, reset, user?.email]);\n\n const handleDocumentChange = (rawValue: string) => {\n setValue('document', isCompany ? formatCNPJ(rawValue) : formatCPF(rawValue), {\n shouldValidate: true,\n });\n };\n\n const handlePersonTypeChange = (value: 'pf' | 'pj') => {\n if (value === personType) return;\n setValue('document', '');\n /* shouldValidate reroda o resolver: sem isso o `isValid` fica preso no valor\n * do documento antigo e o botão continua habilitado com o campo já limpo. */\n setValue('personType', value, { shouldValidate: true });\n };\n\n const handleCepChange = (rawValue: string) => {\n if (isInternational) {\n setValue('cep', rawValue, { shouldValidate: true });\n return;\n }\n\n setValue('cep', formatPostalCode(rawValue), { shouldValidate: true });\n\n const digits = rawValue.replace(/\\D/g, '');\n if (digits.length !== 8) return;\n\n lookupCep(digits)\n .then((data) => {\n setValue('street', data.logradouro, { shouldValidate: true });\n setValue('neighborhood', data.bairro, { shouldValidate: true });\n setValue('city', data.localidade, { shouldValidate: true });\n setValue('state', data.uf, { shouldValidate: true });\n })\n .catch(() => {\n // CEP não encontrado: o usuário preenche o endereço na mão.\n });\n };\n\n async function onSubmit(data: BillingDataFormValues) {\n const payload: UpdateBillingDataRequest = {\n ...(isInternational\n ? {}\n : {\n financial_document_type: data.personType === 'pf' ? 1 : 2,\n financial_document: data.document,\n }),\n financial_name: data.financialName,\n financial_email: data.financialEmail,\n zipcode: data.cep,\n address: data.street,\n address_number: data.streetNumber,\n address_complement: data.complement ?? '',\n neighborhood: data.neighborhood,\n city: data.city,\n state: data.state,\n country: data.country,\n };\n\n try {\n await updateBillingData(payload);\n setIsSubmitted(true);\n toast.custom(\n (t) => (\n <Toast\n variant=\"success\"\n message={translate('common.billing.requiredData.successToast')}\n toastId={t}\n />\n ),\n { duration: 5000 },\n );\n } catch (error) {\n /* O backend devolve a razão exata da recusa (ex.: documento fiscal inválido).\n * Trocar por um texto genérico deixaria o usuário travado sem saber o que corrigir. */\n const message =\n error instanceof Error && error.message\n ? error.message\n : translate('common.billing.requiredData.errorToast');\n toast.custom((t) => <Toast variant=\"error\" message={message} toastId={t} />, {\n duration: 5000,\n });\n }\n }\n\n if (!isRequired || isSubmitted) return null;\n\n return (\n <Dialog open onOpenChange={() => {}}>\n <DialogContent\n showCloseButton={false}\n onEscapeKeyDown={(event: Event) => event.preventDefault()}\n onPointerDownOutside={(event: Event) => event.preventDefault()}\n onInteractOutside={(event: Event) => event.preventDefault()}\n className=\"flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-dvh top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-[502px] lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-hidden\"\n >\n <DialogHeader className=\"gap-3 text-left p-4 lg:p-5 border-b border-zinc-200 shrink-0\">\n <div className=\"flex items-center justify-center w-10 h-10 bg-zinc-50 rounded-lg\">\n <IconFileInvoice size={24} className=\"text-zinc-950\" />\n </div>\n <div className=\"flex flex-col gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-zinc-950\">\n {translate('common.billing.requiredData.title')}\n </DialogTitle>\n <span className=\"paragraph-small-regular text-zinc-600\">\n {translate('common.billing.requiredData.description')}\n </span>\n </div>\n </DialogHeader>\n\n <form\n onSubmit={handleSubmit(onSubmit)}\n className=\"flex flex-col flex-1 min-h-0\"\n noValidate\n >\n <div className=\"flex flex-col gap-6 p-4 lg:p-5 flex-1 overflow-y-auto\">\n <div className=\"flex flex-col gap-5\">\n {!isInternational && (\n <div className=\"flex gap-4\">\n <Controller\n name=\"personType\"\n control={control}\n render={({ field }) => (\n <SelectField\n label={translate('common.billing.requiredData.personType')}\n placeholder={translate('common.billing.requiredData.select')}\n value={field.value}\n onChange={(value) => handlePersonTypeChange(value as 'pf' | 'pj')}\n options={[\n {\n value: 'pf',\n label: translate('common.billing.requiredData.personTypePf'),\n },\n {\n value: 'pj',\n label: translate('common.billing.requiredData.personTypePj'),\n },\n ]}\n containerClassName=\"flex-1\"\n />\n )}\n />\n <div className=\"flex-1\">\n <FormField\n label={\n isCompany\n ? translate('common.billing.requiredData.cnpj')\n : translate('common.billing.requiredData.cpf')\n }\n placeholder={isCompany ? '__.___.___/____-__' : '___.___.___-__'}\n error={!!errors.document}\n errorMessage={errors.document?.message}\n {...register('document', {\n onChange: (event) => handleDocumentChange(event.target.value),\n })}\n />\n </div>\n </div>\n )}\n\n <FormField\n label={\n isCompany\n ? translate('common.billing.requiredData.companyName')\n : translate('common.billing.requiredData.fullName')\n }\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.financialName}\n errorMessage={errors.financialName?.message}\n {...register('financialName')}\n />\n\n <FormField\n label={translate('common.billing.requiredData.financialEmail')}\n placeholder={translate('common.billing.requiredData.financialEmailPlaceholder')}\n type=\"email\"\n error={!!errors.financialEmail}\n errorMessage={errors.financialEmail?.message}\n {...register('financialEmail')}\n />\n </div>\n\n <div className=\"h-px bg-zinc-200\" />\n\n <div className=\"flex flex-col gap-5\">\n <span className=\"paragraph-small-semibold text-zinc-950\">\n {translate('common.billing.requiredData.addressHeading')}\n </span>\n\n <FormField\n label={\n isInternational\n ? translate('common.billing.requiredData.postalCode')\n : translate('common.billing.requiredData.cep')\n }\n placeholder={isInternational ? '' : '_____-___'}\n error={!!errors.cep}\n errorMessage={errors.cep?.message}\n {...register('cep', {\n onChange: (event) => handleCepChange(event.target.value),\n })}\n />\n\n <div className=\"flex gap-4\">\n <div className=\"flex-[3]\">\n <FormField\n label={translate('common.billing.requiredData.street')}\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.street}\n errorMessage={errors.street?.message}\n {...register('street')}\n />\n </div>\n {!isInternational && (\n <div className=\"flex-1\">\n <FormField\n label={translate('common.billing.requiredData.streetNumber')}\n placeholder=\"000\"\n error={!!errors.streetNumber}\n errorMessage={errors.streetNumber?.message}\n {...register('streetNumber')}\n />\n </div>\n )}\n </div>\n\n <div className=\"flex gap-4\">\n {!isInternational && (\n <div className=\"flex-1\">\n <FormField\n label={translate('common.billing.requiredData.neighborhood')}\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.neighborhood}\n errorMessage={errors.neighborhood?.message}\n {...register('neighborhood')}\n />\n </div>\n )}\n <div className=\"flex-1\">\n <FormField\n label={translate('common.billing.requiredData.complement')}\n optional\n placeholder={translate('common.billing.requiredData.typeHere')}\n {...register('complement')}\n />\n </div>\n </div>\n\n <div className=\"flex gap-4\">\n <div className=\"flex-1\">\n <FormField\n label={translate('common.billing.requiredData.city')}\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.city}\n errorMessage={errors.city?.message}\n {...register('city')}\n />\n </div>\n <div className=\"flex-1\">\n {isInternational ? (\n <FormField\n label={translate('common.billing.requiredData.stateProvince')}\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.state}\n errorMessage={errors.state?.message}\n {...register('state')}\n />\n ) : (\n <Controller\n name=\"state\"\n control={control}\n render={({ field }) => (\n <SelectField\n label={translate('common.billing.requiredData.state')}\n placeholder={translate('common.billing.requiredData.select')}\n value={field.value || undefined}\n onChange={(value) =>\n setValue('state', value as string, { shouldValidate: true })\n }\n options={BR_STATE_OPTIONS}\n error={!!errors.state}\n errorMessage={errors.state?.message}\n />\n )}\n />\n )}\n </div>\n </div>\n\n <Controller\n name=\"country\"\n control={control}\n render={({ field }) => (\n <SelectField\n label={translate('common.billing.requiredData.country')}\n placeholder={translate('common.billing.requiredData.select')}\n value={field.value || undefined}\n onChange={(value) =>\n setValue('country', value as string, { shouldValidate: true })\n }\n options={COUNTRY_OPTIONS}\n error={!!errors.country}\n errorMessage={errors.country?.message}\n />\n )}\n />\n </div>\n </div>\n\n <div className=\"flex items-center justify-end p-4 lg:p-5 border-t border-zinc-200 shrink-0\">\n <Button\n type=\"submit\"\n className=\"h-10! w-full lg:w-fit\"\n disabled={!isValid || isSubmitting}\n loading={isSubmitting}\n >\n {isSubmitting\n ? translate('common.billing.requiredData.submitting')\n : translate('common.billing.requiredData.submit')}\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n );\n}\n\n/**\n * Modal bloqueante que exige o cadastro de cobrança/fiscal de contas que já\n * pagaram sem ele — sem esses dados a nota fiscal não é emitida. Monte uma vez\n * no layout raiz do app; ele mesmo decide se aparece (ver `useRequiredBillingData`).\n */\nexport default function RequiredBillingDataModal() {\n const { user, isLoading } = useAuth();\n\n /* Sem sessão não há conta nem assinatura pra consultar — evita disparar as\n * queries (e tomar 401) em /login, /register e demais rotas públicas. */\n if (isLoading || !user) return null;\n\n return <RequiredBillingDataModalContent />;\n}\n"],"mappings":";AA+QU,cAoCA,YApCA;AA1QV,SAAS,WAAW,SAAS,QAAQ,gBAAgB;AACrD,SAAS,YAAY,eAAe;AACpC,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,OAAO,OAAO;AACd,SAAS,uBAAuB;AAEhC,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,4BA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,OAAO,MAAM,SAAS;AAAA,4BACtB,UAAU,CAAC,UACT,SAAS,SAAS,OAAiB,EAAE,gBAAgB,KAAK,CAAC;AAAA,4BAE7D,SAAS;AAAA,4BACT,OAAO,CAAC,CAAC,OAAO;AAAA,4BAChB,cAAc,OAAO,OAAO;AAAA;AAAA,wBAC9B;AAAA;AAAA,oBAEJ,GAEJ;AAAA,qBACF;AAAA,kBAEA;AAAA,oBAAC;AAAA;AAAA,sBACC,MAAK;AAAA,sBACL;AAAA,sBACA,QAAQ,CAAC,EAAE,MAAM,MACf;AAAA,wBAAC;AAAA;AAAA,0BACC,OAAO,UAAU,qCAAqC;AAAA,0BACtD,aAAa,UAAU,oCAAoC;AAAA,0BAC3D,OAAO,MAAM,SAAS;AAAA,0BACtB,UAAU,CAAC,UACT,SAAS,WAAW,OAAiB,EAAE,gBAAgB,KAAK,CAAC;AAAA,0BAE/D,SAAS;AAAA,0BACT,OAAO,CAAC,CAAC,OAAO;AAAA,0BAChB,cAAc,OAAO,SAAS;AAAA;AAAA,sBAChC;AAAA;AAAA,kBAEJ;AAAA,mBACF;AAAA,iBACF;AAAA,cAEA,oBAAC,SAAI,WAAU,8EACb;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,kBACL,WAAU;AAAA,kBACV,UAAU,CAAC,WAAW;AAAA,kBACtB,SAAS;AAAA,kBAER,yBACG,UAAU,wCAAwC,IAClD,UAAU,oCAAoC;AAAA;AAAA,cACpD,GACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAOe,SAAR,2BAA4C;AACjD,QAAM,EAAE,MAAM,UAAU,IAAI,QAAQ;AAIpC,MAAI,aAAa,CAAC,KAAM,QAAO;AAE/B,SAAO,oBAAC,mCAAgC;AAC1C;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/modals/billing/RequiredBillingDataModal.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- o generic Translator do next-intl não é\n expressável estruturalmente; o `any` do TranslateFn é intencional e está contido neste arquivo\n (mesmo padrão de modules/plans/utils/map-api-plan-to-ui.ts). */\n'use client';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { useTranslations } from 'next-intl';\nimport { toast } from 'sonner';\nimport z from 'zod';\nimport { IconFileInvoice } from '@tabler/icons-react';\n\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../../ui/overlay/Dialog';\nimport { Button } from '../../ui/buttons/Button';\nimport { FormField } from '../../ui/form/FormField';\nimport { SelectField } from '../../ui/form/SelectField';\nimport { Toast } from '../../ui/feedback/Toast';\nimport { useAuth } from '../../../providers/auth.provider';\nimport { useViaCep } from '../../../modules/accounts/hooks/useViaCep';\nimport { useUpdateBillingData } from '../../../modules/accounts/hooks/useAccountManagement';\nimport { useRequiredBillingData } from '../../../modules/accounts/hooks/use-required-billing-data.hook';\nimport { COUNTRIES } from '../../../utils/countries';\nimport { BR_STATE_OPTIONS } from '../../../utils/constants/br-states';\nimport { formatCNPJ, formatCPF, formatPostalCode } from '../../../utils/format/masks';\nimport { isValidCNPJ, isValidCPF } from '../../../utils/validators/common';\nimport type { UpdateBillingDataRequest } from '../../../modules/accounts/types';\n\ntype TranslateFn = (key: any, values?: Record<string, string | number>) => string;\n\ntype BillingDataFormValues = {\n personType: 'pf' | 'pj';\n document: string;\n financialName: string;\n financialEmail: string;\n cep: string;\n street: string;\n streetNumber: string;\n complement?: string;\n neighborhood: string;\n city: string;\n state: string;\n country: string;\n};\n\nconst COUNTRY_OPTIONS = COUNTRIES.map((country: { iso: string; name: string }) => ({\n value: country.iso,\n label: country.name,\n}));\n\nfunction buildBillingDataSchema(translate: TranslateFn) {\n const requiredText = z\n .string()\n .trim()\n .min(1, translate('common.billing.requiredData.requiredField'));\n\n const base = z.object({\n personType: z.enum(['pf', 'pj']),\n document: z.string().trim(),\n financialName: requiredText,\n financialEmail: z\n .string()\n .trim()\n .min(1, translate('common.billing.requiredData.requiredField'))\n .email(translate('common.billing.requiredData.invalidEmail')),\n cep: requiredText,\n street: requiredText,\n streetNumber: z.string().trim(),\n complement: z.string().trim().optional(),\n neighborhood: z.string().trim(),\n city: requiredText,\n state: requiredText,\n country: requiredText,\n });\n\n return base.superRefine((data, ctx) => {\n if (!data.streetNumber) {\n ctx.addIssue({\n code: 'custom',\n path: ['streetNumber'],\n message: translate('common.billing.requiredData.requiredField'),\n });\n }\n\n if (!data.neighborhood) {\n ctx.addIssue({\n code: 'custom',\n path: ['neighborhood'],\n message: translate('common.billing.requiredData.requiredField'),\n });\n }\n\n if (data.cep.replace(/\\D/g, '').length !== 8) {\n ctx.addIssue({\n code: 'custom',\n path: ['cep'],\n message: translate('common.billing.requiredData.invalidCep'),\n });\n }\n\n const isCompany = data.personType === 'pj';\n const digits = data.document.replace(/\\D/g, '');\n\n if (digits.length !== (isCompany ? 14 : 11)) {\n ctx.addIssue({\n code: 'custom',\n path: ['document'],\n message: isCompany\n ? translate('common.billing.requiredData.invalidCnpj')\n : translate('common.billing.requiredData.invalidCpf'),\n });\n return;\n }\n\n /* Dígito verificador, mesmo algoritmo do backend: sem isso 111.111.111-11 passa\n * aqui e o PUT da conta é recusado depois, sem o usuário saber o motivo. */\n const isValid = isCompany ? isValidCNPJ(digits) : isValidCPF(digits);\n if (!isValid) {\n ctx.addIssue({\n code: 'custom',\n path: ['document'],\n message: isCompany\n ? translate('common.billing.requiredData.invalidCnpjChecksum')\n : translate('common.billing.requiredData.invalidCpfChecksum'),\n });\n }\n });\n}\n\nfunction formatDocument(document: string | null | undefined, isCompany: boolean) {\n if (!document) return '';\n return isCompany ? formatCNPJ(document) : formatCPF(document);\n}\n\nfunction RequiredBillingDataModalContent() {\n const translate = useTranslations();\n const { user } = useAuth();\n const { isRequired, account } = useRequiredBillingData();\n const { mutateAsync: updateBillingData } = useUpdateBillingData();\n const { mutateAsync: lookupCep } = useViaCep();\n\n /* O modal fecha na hora do submit e não reabre enquanto o invalidate do account\n * não volta — sem isso o usuário vê o modal piscar de novo com o cache antigo. */\n const [isSubmitted, setIsSubmitted] = useState(false);\n const isPrefilled = useRef(false);\n\n const schema = useMemo(\n () => buildBillingDataSchema(translate),\n [translate],\n );\n\n const form = useForm<BillingDataFormValues>({\n resolver: zodResolver(schema),\n mode: 'onChange',\n defaultValues: {\n personType: 'pf',\n document: '',\n financialName: '',\n financialEmail: '',\n cep: '',\n street: '',\n streetNumber: '',\n complement: '',\n neighborhood: '',\n city: '',\n state: '',\n country: 'BR',\n },\n });\n\n const {\n register,\n control,\n handleSubmit,\n reset,\n setValue,\n watch,\n formState: { errors, isSubmitting, isValid },\n } = form;\n\n const personType = watch('personType');\n const isCompany = personType === 'pj';\n\n useEffect(() => {\n if (!account || isPrefilled.current) return;\n isPrefilled.current = true;\n\n const accountIsCompany = account.financial_document_type === 2;\n reset({\n personType: accountIsCompany ? 'pj' : 'pf',\n document: formatDocument(account.financial_document, accountIsCompany),\n financialName: account.financial_name ?? '',\n financialEmail: account.financial_email || user?.email || '',\n cep: account.zipcode ?? '',\n street: account.address ?? '',\n streetNumber: account.address_number ?? '',\n complement: account.address_complement ?? '',\n neighborhood: account.neighborhood ?? '',\n city: account.city ?? '',\n state: account.state ?? '',\n country: account.country || 'BR',\n });\n }, [account, reset, user?.email]);\n\n const handleDocumentChange = (rawValue: string) => {\n setValue('document', isCompany ? formatCNPJ(rawValue) : formatCPF(rawValue), {\n shouldValidate: true,\n });\n };\n\n const handlePersonTypeChange = (value: 'pf' | 'pj') => {\n if (value === personType) return;\n setValue('document', '');\n /* shouldValidate reroda o resolver: sem isso o `isValid` fica preso no valor\n * do documento antigo e o botão continua habilitado com o campo já limpo. */\n setValue('personType', value, { shouldValidate: true });\n };\n\n const handleCepChange = (rawValue: string) => {\n setValue('cep', formatPostalCode(rawValue), { shouldValidate: true });\n\n const digits = rawValue.replace(/\\D/g, '');\n if (digits.length !== 8) return;\n\n lookupCep(digits)\n .then((data) => {\n setValue('street', data.logradouro, { shouldValidate: true });\n setValue('neighborhood', data.bairro, { shouldValidate: true });\n setValue('city', data.localidade, { shouldValidate: true });\n setValue('state', data.uf, { shouldValidate: true });\n })\n .catch(() => {\n // CEP não encontrado: o usuário preenche o endereço na mão.\n });\n };\n\n async function onSubmit(data: BillingDataFormValues) {\n const payload: UpdateBillingDataRequest = {\n financial_document_type: data.personType === 'pf' ? 1 : 2,\n financial_document: data.document,\n financial_name: data.financialName,\n financial_email: data.financialEmail,\n zipcode: data.cep,\n address: data.street,\n address_number: data.streetNumber,\n address_complement: data.complement ?? '',\n neighborhood: data.neighborhood,\n city: data.city,\n state: data.state,\n country: data.country,\n };\n\n try {\n await updateBillingData(payload);\n setIsSubmitted(true);\n toast.custom(\n (t) => (\n <Toast\n variant=\"success\"\n message={translate('common.billing.requiredData.successToast')}\n toastId={t}\n />\n ),\n { duration: 5000 },\n );\n } catch (error) {\n /* O backend devolve a razão exata da recusa (ex.: documento fiscal inválido).\n * Trocar por um texto genérico deixaria o usuário travado sem saber o que corrigir. */\n const message =\n error instanceof Error && error.message\n ? error.message\n : translate('common.billing.requiredData.errorToast');\n toast.custom((t) => <Toast variant=\"error\" message={message} toastId={t} />, {\n duration: 5000,\n });\n }\n }\n\n if (!isRequired || isSubmitted) return null;\n\n return (\n <Dialog open onOpenChange={() => {}}>\n <DialogContent\n showCloseButton={false}\n onEscapeKeyDown={(event: Event) => event.preventDefault()}\n onPointerDownOutside={(event: Event) => event.preventDefault()}\n onInteractOutside={(event: Event) => event.preventDefault()}\n className=\"flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-dvh top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-[502px] lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-hidden\"\n >\n <DialogHeader className=\"gap-3 text-left p-4 lg:p-5 border-b border-zinc-200 shrink-0\">\n <div className=\"flex items-center justify-center w-10 h-10 bg-zinc-50 rounded-lg\">\n <IconFileInvoice size={24} className=\"text-zinc-950\" />\n </div>\n <div className=\"flex flex-col gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-zinc-950\">\n {translate('common.billing.requiredData.title')}\n </DialogTitle>\n <span className=\"paragraph-small-regular text-zinc-600\">\n {translate('common.billing.requiredData.description')}\n </span>\n </div>\n </DialogHeader>\n\n <form\n onSubmit={handleSubmit(onSubmit)}\n className=\"flex flex-col flex-1 min-h-0\"\n noValidate\n >\n <div className=\"flex flex-col gap-6 p-4 lg:p-5 flex-1 overflow-y-auto\">\n <div className=\"flex flex-col gap-5\">\n <div className=\"flex gap-4\">\n <Controller\n name=\"personType\"\n control={control}\n render={({ field }) => (\n <SelectField\n label={translate('common.billing.requiredData.personType')}\n placeholder={translate('common.billing.requiredData.select')}\n value={field.value}\n onChange={(value) => handlePersonTypeChange(value as 'pf' | 'pj')}\n options={[\n {\n value: 'pf',\n label: translate('common.billing.requiredData.personTypePf'),\n },\n {\n value: 'pj',\n label: translate('common.billing.requiredData.personTypePj'),\n },\n ]}\n containerClassName=\"flex-1\"\n />\n )}\n />\n <div className=\"flex-1\">\n <FormField\n label={\n isCompany\n ? translate('common.billing.requiredData.cnpj')\n : translate('common.billing.requiredData.cpf')\n }\n placeholder={isCompany ? '__.___.___/____-__' : '___.___.___-__'}\n error={!!errors.document}\n errorMessage={errors.document?.message}\n {...register('document', {\n onChange: (event) => handleDocumentChange(event.target.value),\n })}\n />\n </div>\n </div>\n\n <FormField\n label={\n isCompany\n ? translate('common.billing.requiredData.companyName')\n : translate('common.billing.requiredData.fullName')\n }\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.financialName}\n errorMessage={errors.financialName?.message}\n {...register('financialName')}\n />\n\n <FormField\n label={translate('common.billing.requiredData.financialEmail')}\n placeholder={translate('common.billing.requiredData.financialEmailPlaceholder')}\n type=\"email\"\n error={!!errors.financialEmail}\n errorMessage={errors.financialEmail?.message}\n {...register('financialEmail')}\n />\n </div>\n\n <div className=\"h-px bg-zinc-200\" />\n\n <div className=\"flex flex-col gap-5\">\n <span className=\"paragraph-small-semibold text-zinc-950\">\n {translate('common.billing.requiredData.addressHeading')}\n </span>\n\n <FormField\n label={translate('common.billing.requiredData.cep')}\n placeholder=\"_____-___\"\n error={!!errors.cep}\n errorMessage={errors.cep?.message}\n {...register('cep', {\n onChange: (event) => handleCepChange(event.target.value),\n })}\n />\n\n <div className=\"flex gap-4\">\n <div className=\"flex-[3]\">\n <FormField\n label={translate('common.billing.requiredData.street')}\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.street}\n errorMessage={errors.street?.message}\n {...register('street')}\n />\n </div>\n <div className=\"flex-1\">\n <FormField\n label={translate('common.billing.requiredData.streetNumber')}\n placeholder=\"000\"\n error={!!errors.streetNumber}\n errorMessage={errors.streetNumber?.message}\n {...register('streetNumber')}\n />\n </div>\n </div>\n\n <div className=\"flex gap-4\">\n <div className=\"flex-1\">\n <FormField\n label={translate('common.billing.requiredData.neighborhood')}\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.neighborhood}\n errorMessage={errors.neighborhood?.message}\n {...register('neighborhood')}\n />\n </div>\n <div className=\"flex-1\">\n <FormField\n label={translate('common.billing.requiredData.complement')}\n optional\n placeholder={translate('common.billing.requiredData.typeHere')}\n {...register('complement')}\n />\n </div>\n </div>\n\n <div className=\"flex gap-4\">\n <div className=\"flex-1\">\n <FormField\n label={translate('common.billing.requiredData.city')}\n placeholder={translate('common.billing.requiredData.typeHere')}\n error={!!errors.city}\n errorMessage={errors.city?.message}\n {...register('city')}\n />\n </div>\n <div className=\"flex-1\">\n <Controller\n name=\"state\"\n control={control}\n render={({ field }) => (\n <SelectField\n label={translate('common.billing.requiredData.state')}\n placeholder={translate('common.billing.requiredData.select')}\n value={field.value || undefined}\n onChange={(value) =>\n setValue('state', value as string, { shouldValidate: true })\n }\n options={BR_STATE_OPTIONS}\n error={!!errors.state}\n errorMessage={errors.state?.message}\n />\n )}\n />\n </div>\n </div>\n\n <Controller\n name=\"country\"\n control={control}\n render={({ field }) => (\n <SelectField\n label={translate('common.billing.requiredData.country')}\n placeholder={translate('common.billing.requiredData.select')}\n value={field.value || undefined}\n onChange={(value) =>\n setValue('country', value as string, { shouldValidate: true })\n }\n options={COUNTRY_OPTIONS}\n error={!!errors.country}\n errorMessage={errors.country?.message}\n />\n )}\n />\n </div>\n </div>\n\n <div className=\"flex items-center justify-end p-4 lg:p-5 border-t border-zinc-200 shrink-0\">\n <Button\n type=\"submit\"\n className=\"h-10! w-full lg:w-fit\"\n disabled={!isValid || isSubmitting}\n loading={isSubmitting}\n >\n {isSubmitting\n ? translate('common.billing.requiredData.submitting')\n : translate('common.billing.requiredData.submit')}\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n );\n}\n\n/**\n * Modal bloqueante que exige o cadastro de cobrança/fiscal de contas que já\n * pagaram sem ele — sem esses dados a nota fiscal não é emitida. Monte uma vez\n * no layout raiz do app; ele mesmo decide se aparece (ver `useRequiredBillingData`).\n */\nexport default function RequiredBillingDataModal() {\n const { user, isLoading } = useAuth();\n\n /* Sem sessão não há conta nem assinatura pra consultar — evita disparar as\n * queries (e tomar 401) em /login, /register e demais rotas públicas. */\n if (isLoading || !user) return null;\n\n return <RequiredBillingDataModalContent />;\n}\n"],"mappings":";AAiQU,cAoCA,YApCA;AA5PV,SAAS,WAAW,SAAS,QAAQ,gBAAgB;AACrD,SAAS,YAAY,eAAe;AACpC,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,OAAO,OAAO;AACd,SAAS,uBAAuB;AAEhC,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,eA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AC,UACT,SAAS,WAAW,OAAiB,EAAE,gBAAgB,KAAK,CAAC;AAAA,0BAE/D,SAAS;AAAA,0BACT,OAAO,CAAC,CAAC,OAAO;AAAA,0BAChB,cAAc,OAAO,SAAS;AAAA;AAAA,sBAChC;AAAA;AAAA,kBAEJ;AAAA,mBACF;AAAA,iBACF;AAAA,cAEA,oBAAC,SAAI,WAAU,8EACb;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,kBACL,WAAU;AAAA,kBACV,UAAU,CAAC,WAAW;AAAA,kBACtB,SAAS;AAAA,kBAER,yBACG,UAAU,wCAAwC,IAClD,UAAU,oCAAoC;AAAA;AAAA,cACpD,GACF;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAOe,SAAR,2BAA4C;AACjD,QAAM,EAAE,MAAM,UAAU,IAAI,QAAQ;AAIpC,MAAI,aAAa,CAAC,KAAM,QAAO;AAE/B,SAAO,oBAAC,mCAAgC;AAC1C;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -404,7 +404,10 @@ import {
|
|
|
404
404
|
import { useViaCep } from "./modules/accounts/hooks/useViaCep";
|
|
405
405
|
import { useAccountToken } from "./modules/accounts/hooks/use-account-token.hook";
|
|
406
406
|
import { useRequiredBillingData } from "./modules/accounts/hooks/use-required-billing-data.hook";
|
|
407
|
-
import {
|
|
407
|
+
import {
|
|
408
|
+
hasCompleteBillingData,
|
|
409
|
+
isBrazilianBillingAccount
|
|
410
|
+
} from "./modules/accounts/utils/billing-data";
|
|
408
411
|
import { default as default19 } from "./components/account/AccountModals";
|
|
409
412
|
import { useAccountModals } from "./store/useAccountModals";
|
|
410
413
|
import { ModalManager } from "./components/modals/ModalManager";
|
|
@@ -708,6 +711,7 @@ export {
|
|
|
708
711
|
hasPaidSubscription,
|
|
709
712
|
hasSubscriptionExpired,
|
|
710
713
|
hideCrisp,
|
|
714
|
+
isBrazilianBillingAccount,
|
|
711
715
|
isPaymentMethodAllowed,
|
|
712
716
|
isSubscriptionPendingPixResponse,
|
|
713
717
|
isUsdAccount,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"./modules/auth/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\n// Style types now come from whitelabel schema directly\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\nexport {\n NavigationProvider,\n useNavigationFallback,\n} from \"./providers/navigation.provider\";\n\n// Navigation (safe drop-in replacement for next/navigation)\nexport { useRouter } from \"./hooks/useRouter\";\nexport type { SafeAppRouter } from \"./hooks/useRouter\";\nexport {\n usePathname,\n useSearchParams,\n useParams,\n redirect,\n notFound,\n} from \"./utils/next-navigation\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport {\n useListAllAccountUsers,\n LIST_ALL_ACCOUNT_USERS_QUERY_KEY,\n LIST_ALL_ACCOUNT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-all-account-users.hook\";\nexport {\n useProjects,\n PROJECTS_BASE_KEY,\n PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-projects.hook\";\nexport {\n useInfiniteProjects,\n INFINITE_PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-infinite-projects.hook\";\nexport { useProject } from \"./modules/projects/hooks/find-project.hook\";\nexport { useCreateProject } from \"./modules/projects/hooks/create-project.hook\";\nexport { useUpdateProject } from \"./modules/projects/hooks/update-project.hook\";\nexport { useDeleteProject } from \"./modules/projects/hooks/delete-project.hook\";\nexport type {\n Project,\n ProjectsPage,\n CreateProjectRequest,\n UpdateProjectRequest,\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport { ProjectSchema } from \"./modules/projects/types\";\nexport type { ListProjectsActionParams } from \"./modules/projects/actions/list-projects.action\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport { useManagementPermissions } from \"./modules/auth/hooks/useManagementPermissions\";\nexport type { ManagementPermission } from \"./modules/auth/types/management-permission.type\";\nexport { useSocialGoogleLogin } from \"./modules/auth/hooks/social-google-login.hook\";\nexport { useSocialGoogleOnboarding } from \"./modules/auth/hooks/social-google-onboarding.hook\";\nexport { useUnlinkGoogle } from \"./modules/auth/hooks/unlink-google.hook\";\nexport { useSubscriptions } from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport {\n SUBSCRIPTIONS_QUERY_KEY,\n CHARGES_QUERY_KEY,\n} from \"./modules/subscriptions/constants/query-keys.constants\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useCancelledSubscriptionGuard } from \"./modules/subscriptions/hooks/use-cancelled-subscription-guard\";\nexport { usePlanById } from \"./modules/plans/hooks/use-plan-by-id.hook\";\nexport { useHasPlanAddon } from \"./modules/plans/hooks/use-has-plan-addon.hook\";\nexport { useCalculateSubscription } from \"./modules/subscriptions/hooks/calculate-subscription.hook\";\nexport { useUpdateSubscriptionPlan } from \"./modules/subscriptions/hooks/update-subscription-plan.hook\";\nexport { useUpdateSubscriptionPayment } from \"./modules/subscriptions/hooks/update-subscription-payment.hook\";\nexport { useCards, CARDS_QUERY_KEY } from \"./modules/cards/hooks/cards.hook\";\nexport { useCardById } from \"./modules/cards/hooks/card-by-id.hook\";\nexport { useCreateCard } from \"./modules/cards/hooks/create-card.hook\";\nexport { useCreateSetupIntent } from \"./modules/cards/hooks/create-setup-intent.hook\";\nexport { useSetDefaultCard } from \"./modules/cards/hooks/set-default-card.hook\";\nexport { useDeleteCard } from \"./modules/cards/hooks/delete-card.hook\";\nexport { useDeleteConfirmation } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport type { DeleteConfirmationFormData } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport { useHandleDeleteCard } from \"./modules/cards/hooks/handle-delete-card.hook\";\nexport { useCharges } from \"./modules/charges/hooks/charges.hook\";\nexport { useChargeById } from \"./modules/charges/hooks/charge-by-id.hook\";\nexport { useChargeAction } from \"./modules/charges/hooks/charge-action.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditsSummaryData,\n IaCreditAddBatch,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n ADDON_IDS,\n AI_CREDIT_OPTIONS,\n AI_CREDIT_SIZES,\n AI_CREDIT_VALUES,\n buildAiCreditOptions,\n resolveAiCreditPrice,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n AddonKindEnum,\n AiCreditOption,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n Plan,\n PlanItem,\n UiPlan,\n PlanFeature,\n PlanMainFeatures,\n PlanPricingByPeriod,\n PlanTooltips,\n} from \"./modules/plans/types/plan.type\";\nexport { PlanSchema, PlanItemSchema } from \"./modules/plans/types/plan.type\";\nexport {\n mapApiPlanToUiPlan,\n mapApiPlanToUiPlanForCurrency,\n} from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport type { PlanBillingPeriod } from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport {\n usePlans,\n PLANS_QUERY_KEY,\n} from \"./modules/plans/hooks/list-plans.hook\";\nexport type { BillingPeriod } from \"./modules/subscriptions/types/billing-period.type\";\nexport type {\n CalculateSubscriptionRequest,\n CalculateSubscriptionResponse,\n UpdateSubscriptionPlanRequest,\n} from \"./modules/subscriptions/types/calculate-subscription.type\";\nexport {\n PixPendingDataSchema,\n SubscriptionPendingPixResponseSchema,\n isSubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n PixPendingData,\n SubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n Card as PaymentCard,\n CreateCardRequest,\n FindCardsParams,\n SetupIntent,\n} from \"./modules/cards/types\";\nexport {\n CardSchema as PaymentCardSchema,\n CreateCardRequestSchema,\n FindCardsParamsSchema,\n SetupIntentSchema,\n} from \"./modules/cards/types\";\nexport type {\n Charge,\n FindChargesParams,\n PayChargeInput,\n} from \"./modules/charges/types/charge.type\";\nexport {\n ChargeSchema,\n FindChargesParamsSchema,\n PayChargeInputSchema,\n} from \"./modules/charges/types/charge.type\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport { hasActivePaidSubscription } from \"./modules/subscriptions/utils/has-active-paid-subscription\";\nexport { hasPaidSubscription } from \"./modules/subscriptions/utils/has-paid-subscription\";\nexport {\n confirmPaymentIfRequired,\n PaymentAuthenticationError,\n} from \"./modules/subscriptions/utils/confirm-payment-if-required\";\nexport { SUBSCRIPTION_GRACE_PERIOD_DAYS } from \"./modules/subscriptions/constants/subscription.constants\";\nexport { getSubscriptionCancellationState } from \"./modules/subscriptions/utils/get-subscription-cancellation-state\";\nexport type { SubscriptionCancellationState } from \"./modules/subscriptions/utils/get-subscription-cancellation-state\";\nexport {\n useCountPages,\n COUNT_PAGES_QUERY_KEY,\n} from \"./modules/pages/hooks/count-pages.hook\";\nexport { PAGES_QUERY_KEY } from \"./modules/pages/constants/query-keys.constants\";\nexport {\n getPriceFromCalculatedData,\n getOriginalPriceFromCalculatedData,\n periodicityToBillingPeriod,\n} from \"./modules/subscriptions/utils/periodicity\";\nexport { useBuyCreditsModal } from \"./store/useBuyCreditsModal\";\nexport { useCreditsDisabledModal } from \"./store/useCreditsDisabledModal\";\nexport { usePaidPlanRequiredModal } from \"./store/usePaidPlanRequiredModal\";\nexport { useAccountDeletionWarningModal } from \"./store/useAccountDeletionWarningModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as CreditsDisabledModal } from \"./components/modals/CreditsDisabledModal\";\nexport { default as PaidPlanRequiredModal } from \"./components/modals/PaidPlanRequiredModal\";\nexport { default as AccountDeletionWarningModal } from \"./components/modals/AccountDeletionWarningModal\";\nexport { default as RequiredBillingDataModal } from \"./components/modals/billing/RequiredBillingDataModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport { DeleteCardModal } from \"./components/modals/cards/DeleteCardModal\";\nexport { CannotDeleteCardModal } from \"./components/modals/cards/CannotDeleteCardModal\";\nexport {\n CardFormFields,\n cardFormSchema,\n buildCardFormSchema,\n} from \"./components/modals/cards/CardFormFields\";\nexport type { CardFormData } from \"./components/modals/cards/CardFormFields\";\nexport { Skeleton } from \"./components/ui/feedback/Skeleton\";\nexport { PaymentInfoCard } from \"./components/ui/data-display/PaymentInfoCard\";\nexport { CardBrandIcon } from \"./components/ui/data-display/CardBrandIcons\";\nexport { CardItem } from \"./components/ui/data-display/CardItem\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { formatShortDate, formatDateTime, calendarDateSchema, toCalendarDate, daysBetween } from \"./infra/utils/date\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\nexport { withAction } from \"./utils/withAction\";\nexport { resolveSafeRedirect, sameHostOr } from \"./utils/redirect\";\nexport { COUNTRIES, flagUrl } from \"./utils/countries\";\nexport type { Country } from \"./utils/countries\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { default as NotificationCard } from \"./components/widgets/notifications/NotificationCard\";\nexport type { NotificationCardProps } from \"./components/widgets/notifications/NotificationCard\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { NotificationPageContent } from \"./components/pages/notifications/Notifications\";\nexport { NotFoundPage } from \"./components/pages/NotFoundPage\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { default as WhitelabelCodes } from \"./components/layouts/WhitelabelCodes\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// Navigation\nexport { AppNavigation } from \"./components/navigation/AppNavigation\";\nexport { CancelledSubscriptionBanner } from \"./components/navigation/CancelledSubscriptionBanner\";\nexport { SubscriptionBanner } from \"./components/navigation/SubscriptionBanner\";\nexport { OverdueInvoiceBanner } from \"./components/navigation/OverdueInvoiceBanner\";\nexport { UpcomingInvoiceBanner } from \"./components/navigation/UpcomingInvoiceBanner\";\nexport { TrialBanner } from \"./components/navigation/TrialBanner\";\nexport type { NavItemConfig } from \"./components/navigation/subcomponents/NavItems\";\nexport { useMobileNavbarSheet } from \"./store/useMobileNavbarSheet\";\n\n// Auth Query Key Utilities\nexport {\n useAuthQueryKey,\n useWlQueryKey,\n useWlId,\n} from \"./hooks/useAuthQueryKey\";\n\n// Hooks\nexport { default as useCopyToClipboard } from \"./hooks/copy-to-clipboard.hook\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport { useBrandLoadingIcon } from \"./hooks/useBrandLoadingIcon\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Embeds\nexport { FrillEmbed } from \"./components/embeds/FrillEmbed\";\nexport {\n CrispEmbed,\n openCrispHelpdesk,\n hideCrisp,\n showCrisp,\n updateCrispUser,\n} from \"./components/embeds/CrispEmbed\";\nexport { EmbedWidgets } from \"./components/embeds/EmbedWidgets\";\nexport { ClarityEmbed } from \"./components/embeds/ClarityEmbed\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useDesktopSidebarStore } from \"./store/useDesktopSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\nexport { useDebounce } from \"./hooks/useDebounce\";\nexport { useDebouncedEffect } from \"./hooks/useDebouncedEffect\";\nexport { useDebounceState } from \"./hooks/useDebounceState\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCNPJ,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport {\n formatCurrency,\n formatCurrencyNumber,\n parseCurrencyToNumber,\n getCurrencyForGateway,\n getLocaleForCurrency,\n} from \"./utils/format/currency\";\nexport type { CurrencyCode } from \"./utils/format/currency\";\nexport {\n USD_GATEWAY,\n isUsdGateway,\n isUsdAccount,\n allowedPaymentMethods,\n isPaymentMethodAllowed,\n canBuyStandaloneAiCredits,\n} from \"./utils/format/gateway\";\nexport type { AccountGatewayLike, PaymentMethodKind } from \"./utils/format/gateway\";\nexport { isValidCPF, isValidCNPJ, isValidTaxId } from \"./utils/validators/common\";\nexport { BR_STATE_OPTIONS } from \"./utils/constants/br-states\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useCurrentAccount,\n ACCOUNT_QUERY_KEY,\n} from \"./modules/accounts/hooks/current-account.hook\";\nexport { useCurrencyFormatter } from \"./modules/accounts/hooks/use-currency-formatter.hook\";\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useUpdateBillingData,\n useDeleteAccountUser,\n useDeleteAccount,\n ACCOUNT_USERS_QUERY_KEY,\n} from \"./modules/accounts/hooks/useAccountManagement\";\nexport { useViaCep } from \"./modules/accounts/hooks/useViaCep\";\nexport { useAccountToken } from \"./modules/accounts/hooks/use-account-token.hook\";\nexport { useRequiredBillingData } from \"./modules/accounts/hooks/use-required-billing-data.hook\";\nexport { hasCompleteBillingData } from \"./modules/accounts/utils/billing-data\";\nexport type { BillingDataSnapshot } from \"./modules/accounts/utils/billing-data\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateBillingDataRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n\n// Image Upload\nexport {\n ImageUpload,\n ImageCropModal,\n ImageTooSmallModal,\n} from \"./components/widgets/ImageUpload\";\nexport {\n useImageUpload,\n type ImageTooSmallError,\n} from \"./modules/images/hooks/use-image-upload.hook\";\nexport {\n ACCEPTED_IMAGE_FORMATS,\n ACCEPTED_IMAGE_FORMATS_STRING,\n MAX_FILE_SIZE_MB,\n} from \"./modules/images/constants/image.constants\";\nexport type {\n ImageConfig,\n CropArea,\n ProcessedImage,\n CompressImageOptions,\n} from \"./modules/images/types/image.type\";\nexport { compressImage } from \"./modules/images/utils/compress-image\";\nexport { cropImageToCanvas } from \"./modules/images/utils/crop-image\";\nexport { base64ToFile, fileToBase64 } from \"./modules/images/utils/base64\";\nexport {\n validateImage,\n validateImageFormat,\n validateImageSize,\n getImageDimensions,\n} from \"./modules/images/utils/validate-image\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB;AAE1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAYjC,SAAS,qBAAqB;AAE9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gCAAgC;AAEzC,SAAS,4BAA4B;AACrC,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,qCAAqC;AAC9C,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,gCAAgC;AACzC,SAAS,iCAAiC;AAC1C,SAAS,oCAAoC;AAC7C,SAAS,UAAU,uBAAuB;AAC1C,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AACrC,SAAS,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rD,SAAoB,WAAXA,iBAAgD;AACzD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,cAAc,oBAAoB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"./modules/auth/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\n// Style types now come from whitelabel schema directly\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\nexport {\n NavigationProvider,\n useNavigationFallback,\n} from \"./providers/navigation.provider\";\n\n// Navigation (safe drop-in replacement for next/navigation)\nexport { useRouter } from \"./hooks/useRouter\";\nexport type { SafeAppRouter } from \"./hooks/useRouter\";\nexport {\n usePathname,\n useSearchParams,\n useParams,\n redirect,\n notFound,\n} from \"./utils/next-navigation\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport {\n useListAllAccountUsers,\n LIST_ALL_ACCOUNT_USERS_QUERY_KEY,\n LIST_ALL_ACCOUNT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-all-account-users.hook\";\nexport {\n useProjects,\n PROJECTS_BASE_KEY,\n PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-projects.hook\";\nexport {\n useInfiniteProjects,\n INFINITE_PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-infinite-projects.hook\";\nexport { useProject } from \"./modules/projects/hooks/find-project.hook\";\nexport { useCreateProject } from \"./modules/projects/hooks/create-project.hook\";\nexport { useUpdateProject } from \"./modules/projects/hooks/update-project.hook\";\nexport { useDeleteProject } from \"./modules/projects/hooks/delete-project.hook\";\nexport type {\n Project,\n ProjectsPage,\n CreateProjectRequest,\n UpdateProjectRequest,\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport { ProjectSchema } from \"./modules/projects/types\";\nexport type { ListProjectsActionParams } from \"./modules/projects/actions/list-projects.action\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport { useManagementPermissions } from \"./modules/auth/hooks/useManagementPermissions\";\nexport type { ManagementPermission } from \"./modules/auth/types/management-permission.type\";\nexport { useSocialGoogleLogin } from \"./modules/auth/hooks/social-google-login.hook\";\nexport { useSocialGoogleOnboarding } from \"./modules/auth/hooks/social-google-onboarding.hook\";\nexport { useUnlinkGoogle } from \"./modules/auth/hooks/unlink-google.hook\";\nexport { useSubscriptions } from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport {\n SUBSCRIPTIONS_QUERY_KEY,\n CHARGES_QUERY_KEY,\n} from \"./modules/subscriptions/constants/query-keys.constants\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useCancelledSubscriptionGuard } from \"./modules/subscriptions/hooks/use-cancelled-subscription-guard\";\nexport { usePlanById } from \"./modules/plans/hooks/use-plan-by-id.hook\";\nexport { useHasPlanAddon } from \"./modules/plans/hooks/use-has-plan-addon.hook\";\nexport { useCalculateSubscription } from \"./modules/subscriptions/hooks/calculate-subscription.hook\";\nexport { useUpdateSubscriptionPlan } from \"./modules/subscriptions/hooks/update-subscription-plan.hook\";\nexport { useUpdateSubscriptionPayment } from \"./modules/subscriptions/hooks/update-subscription-payment.hook\";\nexport { useCards, CARDS_QUERY_KEY } from \"./modules/cards/hooks/cards.hook\";\nexport { useCardById } from \"./modules/cards/hooks/card-by-id.hook\";\nexport { useCreateCard } from \"./modules/cards/hooks/create-card.hook\";\nexport { useCreateSetupIntent } from \"./modules/cards/hooks/create-setup-intent.hook\";\nexport { useSetDefaultCard } from \"./modules/cards/hooks/set-default-card.hook\";\nexport { useDeleteCard } from \"./modules/cards/hooks/delete-card.hook\";\nexport { useDeleteConfirmation } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport type { DeleteConfirmationFormData } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport { useHandleDeleteCard } from \"./modules/cards/hooks/handle-delete-card.hook\";\nexport { useCharges } from \"./modules/charges/hooks/charges.hook\";\nexport { useChargeById } from \"./modules/charges/hooks/charge-by-id.hook\";\nexport { useChargeAction } from \"./modules/charges/hooks/charge-action.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditsSummaryData,\n IaCreditAddBatch,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n ADDON_IDS,\n AI_CREDIT_OPTIONS,\n AI_CREDIT_SIZES,\n AI_CREDIT_VALUES,\n buildAiCreditOptions,\n resolveAiCreditPrice,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n AddonKindEnum,\n AiCreditOption,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n Plan,\n PlanItem,\n UiPlan,\n PlanFeature,\n PlanMainFeatures,\n PlanPricingByPeriod,\n PlanTooltips,\n} from \"./modules/plans/types/plan.type\";\nexport { PlanSchema, PlanItemSchema } from \"./modules/plans/types/plan.type\";\nexport {\n mapApiPlanToUiPlan,\n mapApiPlanToUiPlanForCurrency,\n} from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport type { PlanBillingPeriod } from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport {\n usePlans,\n PLANS_QUERY_KEY,\n} from \"./modules/plans/hooks/list-plans.hook\";\nexport type { BillingPeriod } from \"./modules/subscriptions/types/billing-period.type\";\nexport type {\n CalculateSubscriptionRequest,\n CalculateSubscriptionResponse,\n UpdateSubscriptionPlanRequest,\n} from \"./modules/subscriptions/types/calculate-subscription.type\";\nexport {\n PixPendingDataSchema,\n SubscriptionPendingPixResponseSchema,\n isSubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n PixPendingData,\n SubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n Card as PaymentCard,\n CreateCardRequest,\n FindCardsParams,\n SetupIntent,\n} from \"./modules/cards/types\";\nexport {\n CardSchema as PaymentCardSchema,\n CreateCardRequestSchema,\n FindCardsParamsSchema,\n SetupIntentSchema,\n} from \"./modules/cards/types\";\nexport type {\n Charge,\n FindChargesParams,\n PayChargeInput,\n} from \"./modules/charges/types/charge.type\";\nexport {\n ChargeSchema,\n FindChargesParamsSchema,\n PayChargeInputSchema,\n} from \"./modules/charges/types/charge.type\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport { hasActivePaidSubscription } from \"./modules/subscriptions/utils/has-active-paid-subscription\";\nexport { hasPaidSubscription } from \"./modules/subscriptions/utils/has-paid-subscription\";\nexport {\n confirmPaymentIfRequired,\n PaymentAuthenticationError,\n} from \"./modules/subscriptions/utils/confirm-payment-if-required\";\nexport { SUBSCRIPTION_GRACE_PERIOD_DAYS } from \"./modules/subscriptions/constants/subscription.constants\";\nexport { getSubscriptionCancellationState } from \"./modules/subscriptions/utils/get-subscription-cancellation-state\";\nexport type { SubscriptionCancellationState } from \"./modules/subscriptions/utils/get-subscription-cancellation-state\";\nexport {\n useCountPages,\n COUNT_PAGES_QUERY_KEY,\n} from \"./modules/pages/hooks/count-pages.hook\";\nexport { PAGES_QUERY_KEY } from \"./modules/pages/constants/query-keys.constants\";\nexport {\n getPriceFromCalculatedData,\n getOriginalPriceFromCalculatedData,\n periodicityToBillingPeriod,\n} from \"./modules/subscriptions/utils/periodicity\";\nexport { useBuyCreditsModal } from \"./store/useBuyCreditsModal\";\nexport { useCreditsDisabledModal } from \"./store/useCreditsDisabledModal\";\nexport { usePaidPlanRequiredModal } from \"./store/usePaidPlanRequiredModal\";\nexport { useAccountDeletionWarningModal } from \"./store/useAccountDeletionWarningModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as CreditsDisabledModal } from \"./components/modals/CreditsDisabledModal\";\nexport { default as PaidPlanRequiredModal } from \"./components/modals/PaidPlanRequiredModal\";\nexport { default as AccountDeletionWarningModal } from \"./components/modals/AccountDeletionWarningModal\";\nexport { default as RequiredBillingDataModal } from \"./components/modals/billing/RequiredBillingDataModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport { DeleteCardModal } from \"./components/modals/cards/DeleteCardModal\";\nexport { CannotDeleteCardModal } from \"./components/modals/cards/CannotDeleteCardModal\";\nexport {\n CardFormFields,\n cardFormSchema,\n buildCardFormSchema,\n} from \"./components/modals/cards/CardFormFields\";\nexport type { CardFormData } from \"./components/modals/cards/CardFormFields\";\nexport { Skeleton } from \"./components/ui/feedback/Skeleton\";\nexport { PaymentInfoCard } from \"./components/ui/data-display/PaymentInfoCard\";\nexport { CardBrandIcon } from \"./components/ui/data-display/CardBrandIcons\";\nexport { CardItem } from \"./components/ui/data-display/CardItem\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { formatShortDate, formatDateTime, calendarDateSchema, toCalendarDate, daysBetween } from \"./infra/utils/date\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\nexport { withAction } from \"./utils/withAction\";\nexport { resolveSafeRedirect, sameHostOr } from \"./utils/redirect\";\nexport { COUNTRIES, flagUrl } from \"./utils/countries\";\nexport type { Country } from \"./utils/countries\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { default as NotificationCard } from \"./components/widgets/notifications/NotificationCard\";\nexport type { NotificationCardProps } from \"./components/widgets/notifications/NotificationCard\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { NotificationPageContent } from \"./components/pages/notifications/Notifications\";\nexport { NotFoundPage } from \"./components/pages/NotFoundPage\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { default as WhitelabelCodes } from \"./components/layouts/WhitelabelCodes\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// Navigation\nexport { AppNavigation } from \"./components/navigation/AppNavigation\";\nexport { CancelledSubscriptionBanner } from \"./components/navigation/CancelledSubscriptionBanner\";\nexport { SubscriptionBanner } from \"./components/navigation/SubscriptionBanner\";\nexport { OverdueInvoiceBanner } from \"./components/navigation/OverdueInvoiceBanner\";\nexport { UpcomingInvoiceBanner } from \"./components/navigation/UpcomingInvoiceBanner\";\nexport { TrialBanner } from \"./components/navigation/TrialBanner\";\nexport type { NavItemConfig } from \"./components/navigation/subcomponents/NavItems\";\nexport { useMobileNavbarSheet } from \"./store/useMobileNavbarSheet\";\n\n// Auth Query Key Utilities\nexport {\n useAuthQueryKey,\n useWlQueryKey,\n useWlId,\n} from \"./hooks/useAuthQueryKey\";\n\n// Hooks\nexport { default as useCopyToClipboard } from \"./hooks/copy-to-clipboard.hook\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport { useBrandLoadingIcon } from \"./hooks/useBrandLoadingIcon\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Embeds\nexport { FrillEmbed } from \"./components/embeds/FrillEmbed\";\nexport {\n CrispEmbed,\n openCrispHelpdesk,\n hideCrisp,\n showCrisp,\n updateCrispUser,\n} from \"./components/embeds/CrispEmbed\";\nexport { EmbedWidgets } from \"./components/embeds/EmbedWidgets\";\nexport { ClarityEmbed } from \"./components/embeds/ClarityEmbed\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useDesktopSidebarStore } from \"./store/useDesktopSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\nexport { useDebounce } from \"./hooks/useDebounce\";\nexport { useDebouncedEffect } from \"./hooks/useDebouncedEffect\";\nexport { useDebounceState } from \"./hooks/useDebounceState\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCNPJ,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport {\n formatCurrency,\n formatCurrencyNumber,\n parseCurrencyToNumber,\n getCurrencyForGateway,\n getLocaleForCurrency,\n} from \"./utils/format/currency\";\nexport type { CurrencyCode } from \"./utils/format/currency\";\nexport {\n USD_GATEWAY,\n isUsdGateway,\n isUsdAccount,\n allowedPaymentMethods,\n isPaymentMethodAllowed,\n canBuyStandaloneAiCredits,\n} from \"./utils/format/gateway\";\nexport type { AccountGatewayLike, PaymentMethodKind } from \"./utils/format/gateway\";\nexport { isValidCPF, isValidCNPJ, isValidTaxId } from \"./utils/validators/common\";\nexport { BR_STATE_OPTIONS } from \"./utils/constants/br-states\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useCurrentAccount,\n ACCOUNT_QUERY_KEY,\n} from \"./modules/accounts/hooks/current-account.hook\";\nexport { useCurrencyFormatter } from \"./modules/accounts/hooks/use-currency-formatter.hook\";\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useUpdateBillingData,\n useDeleteAccountUser,\n useDeleteAccount,\n ACCOUNT_USERS_QUERY_KEY,\n} from \"./modules/accounts/hooks/useAccountManagement\";\nexport { useViaCep } from \"./modules/accounts/hooks/useViaCep\";\nexport { useAccountToken } from \"./modules/accounts/hooks/use-account-token.hook\";\nexport { useRequiredBillingData } from \"./modules/accounts/hooks/use-required-billing-data.hook\";\nexport {\n hasCompleteBillingData,\n isBrazilianBillingAccount,\n} from \"./modules/accounts/utils/billing-data\";\nexport type { BillingDataSnapshot } from \"./modules/accounts/utils/billing-data\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateBillingDataRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n\n// Image Upload\nexport {\n ImageUpload,\n ImageCropModal,\n ImageTooSmallModal,\n} from \"./components/widgets/ImageUpload\";\nexport {\n useImageUpload,\n type ImageTooSmallError,\n} from \"./modules/images/hooks/use-image-upload.hook\";\nexport {\n ACCEPTED_IMAGE_FORMATS,\n ACCEPTED_IMAGE_FORMATS_STRING,\n MAX_FILE_SIZE_MB,\n} from \"./modules/images/constants/image.constants\";\nexport type {\n ImageConfig,\n CropArea,\n ProcessedImage,\n CompressImageOptions,\n} from \"./modules/images/types/image.type\";\nexport { compressImage } from \"./modules/images/utils/compress-image\";\nexport { cropImageToCanvas } from \"./modules/images/utils/crop-image\";\nexport { base64ToFile, fileToBase64 } from \"./modules/images/utils/base64\";\nexport {\n validateImage,\n validateImageFormat,\n validateImageSize,\n getImageDimensions,\n} from \"./modules/images/utils/validate-image\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB;AAE1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAYjC,SAAS,qBAAqB;AAE9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;A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C,SAAoB,WAAXA,iBAA4C;AACrD,SAAS,qBAAqB;AAG9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAkBP,SAAoB,WAAXA,iBAAgC;AACzC,SAAS,wBAAwB;AAGjC,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAEvB,SAAoB,WAAXA,iBAAqC;AAC9C,SAAoB,WAAXA,iBAA4C;AACrD,SAAoB,WAAXA,iBAAgD;AACzD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,cAAc,oBAAoB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
@@ -3,8 +3,7 @@ import { useCurrentAccount } from "./current-account.hook";
|
|
|
3
3
|
import { useActiveSubscription } from "../../subscriptions/hooks/find-active-subscription.hook";
|
|
4
4
|
import { hasPaidSubscription } from "../../subscriptions/utils/has-paid-subscription";
|
|
5
5
|
import { useManagementPermissions } from "../../auth/hooks/useManagementPermissions";
|
|
6
|
-
import { hasCompleteBillingData } from "../utils/billing-data";
|
|
7
|
-
import { isUsdAccount } from "../../../utils/format/gateway";
|
|
6
|
+
import { hasCompleteBillingData, isBrazilianBillingAccount } from "../utils/billing-data";
|
|
8
7
|
function useRequiredBillingData() {
|
|
9
8
|
const { isOwnerOrAdmin } = useManagementPermissions();
|
|
10
9
|
const { data: account, isPending: isAccountPending } = useCurrentAccount();
|
|
@@ -13,12 +12,11 @@ function useRequiredBillingData() {
|
|
|
13
12
|
isPending: isSubscriptionPending
|
|
14
13
|
} = useActiveSubscription();
|
|
15
14
|
const isLoading = isAccountPending || isSubscriptionPending;
|
|
16
|
-
const isRequired = !isLoading && isOwnerOrAdmin && hasPaidSubscription(subscription) && !hasCompleteBillingData(account);
|
|
15
|
+
const isRequired = !isLoading && isOwnerOrAdmin && isBrazilianBillingAccount(account) && hasPaidSubscription(subscription) && !hasCompleteBillingData(account);
|
|
17
16
|
return {
|
|
18
17
|
isRequired,
|
|
19
18
|
isLoading,
|
|
20
|
-
account
|
|
21
|
-
isInternational: isUsdAccount(account)
|
|
19
|
+
account
|
|
22
20
|
};
|
|
23
21
|
}
|
|
24
22
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/hooks/use-required-billing-data.hook.ts"],"sourcesContent":["'use client';\n\nimport { useCurrentAccount } from './current-account.hook';\nimport { useActiveSubscription } from '../../subscriptions/hooks/find-active-subscription.hook';\nimport { hasPaidSubscription } from '../../subscriptions/utils/has-paid-subscription';\nimport { useManagementPermissions } from '../../auth/hooks/useManagementPermissions';\nimport { hasCompleteBillingData } from '../utils/billing-data';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/accounts/hooks/use-required-billing-data.hook.ts"],"sourcesContent":["'use client';\n\nimport { useCurrentAccount } from './current-account.hook';\nimport { useActiveSubscription } from '../../subscriptions/hooks/find-active-subscription.hook';\nimport { hasPaidSubscription } from '../../subscriptions/utils/has-paid-subscription';\nimport { useManagementPermissions } from '../../auth/hooks/useManagementPermissions';\nimport { hasCompleteBillingData, isBrazilianBillingAccount } from '../utils/billing-data';\n\n/**\n * Contas que já pagaram mas nunca preencheram o cadastro de cobrança ficam sem\n * nota fiscal (chamado \"Nota fiscal não emitida em pagamentos confirmados\").\n * Este hook diz quando o preenchimento vira obrigatório — o modal que ele\n * alimenta é bloqueante, então só liga com os dados já carregados e só para\n * quem consegue resolver: owner/admin de conta brasileira.\n */\nexport function useRequiredBillingData() {\n const { isOwnerOrAdmin } = useManagementPermissions();\n const { data: account, isPending: isAccountPending } = useCurrentAccount();\n const {\n data: { data: [subscription] = [] } = {},\n isPending: isSubscriptionPending,\n } = useActiveSubscription();\n\n const isLoading = isAccountPending || isSubscriptionPending;\n\n const isRequired =\n !isLoading &&\n isOwnerOrAdmin &&\n isBrazilianBillingAccount(account) &&\n hasPaidSubscription(subscription) &&\n !hasCompleteBillingData(account);\n\n return {\n isRequired,\n isLoading,\n account,\n };\n}\n"],"mappings":";AAEA,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AACpC,SAAS,gCAAgC;AACzC,SAAS,wBAAwB,iCAAiC;AAS3D,SAAS,yBAAyB;AACvC,QAAM,EAAE,eAAe,IAAI,yBAAyB;AACpD,QAAM,EAAE,MAAM,SAAS,WAAW,iBAAiB,IAAI,kBAAkB;AACzE,QAAM;AAAA,IACJ,MAAM,EAAE,MAAM,CAAC,YAAY,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACvC,WAAW;AAAA,EACb,IAAI,sBAAsB;AAE1B,QAAM,YAAY,oBAAoB;AAEtC,QAAM,aACJ,CAAC,aACD,kBACA,0BAA0B,OAAO,KACjC,oBAAoB,YAAY,KAChC,CAAC,uBAAuB,OAAO;AAEjC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const REQUIRED_BILLING_FIELDS = [
|
|
2
|
+
"financial_document",
|
|
3
3
|
"financial_name",
|
|
4
4
|
"zipcode",
|
|
5
5
|
"address",
|
|
6
|
+
"address_number",
|
|
7
|
+
"neighborhood",
|
|
6
8
|
"city",
|
|
7
9
|
"state",
|
|
8
10
|
"country"
|
|
9
11
|
];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
];
|
|
12
|
+
function isBrazilianBillingAccount(account) {
|
|
13
|
+
if (!account) return false;
|
|
14
|
+
const country = account.country?.trim().toUpperCase();
|
|
15
|
+
return !country || country === "BR";
|
|
16
|
+
}
|
|
16
17
|
function isFilled(value) {
|
|
17
18
|
return typeof value === "string" && value.trim().length > 0;
|
|
18
19
|
}
|
|
19
20
|
function hasCompleteBillingData(account) {
|
|
20
21
|
if (!account) return false;
|
|
21
|
-
const
|
|
22
|
-
for (const field of fields) {
|
|
22
|
+
for (const field of REQUIRED_BILLING_FIELDS) {
|
|
23
23
|
if (!isFilled(account[field])) return false;
|
|
24
24
|
}
|
|
25
25
|
return true;
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
hasCompleteBillingData
|
|
28
|
+
hasCompleteBillingData,
|
|
29
|
+
isBrazilianBillingAccount
|
|
29
30
|
};
|
|
30
31
|
//# sourceMappingURL=billing-data.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/utils/billing-data.ts"],"sourcesContent":["import type { Account } from '../types';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/accounts/utils/billing-data.ts"],"sourcesContent":["import type { Account } from '../types';\n\nexport type BillingDataSnapshot = Pick<\n Account,\n | 'financial_document'\n | 'financial_name'\n | 'financial_email'\n | 'zipcode'\n | 'address'\n | 'address_number'\n | 'neighborhood'\n | 'city'\n | 'state'\n | 'country'\n>;\n\ntype BillingField = keyof BillingDataSnapshot;\n\n/**\n * Campos exigidos pra emitir a NF-e — sem qualquer um deles a nota não sai.\n *\n * `financial_email` NÃO entra: o backend cai no e-mail do usuário quando ele está\n * vazio (`financial_email || userDocument.email`, accounts/services.js), então a\n * nota sai do mesmo jeito. Exigi-lo aqui bloquearia 4.7k contas pagantes da wl 1\n * em vez das ~460 que de fato estão sem cadastro fiscal. O campo continua no\n * formulário, pré-preenchido — só não é critério de bloqueio.\n *\n * `address_complement` é opcional de verdade.\n */\nconst REQUIRED_BILLING_FIELDS: readonly BillingField[] = [\n 'financial_document',\n 'financial_name',\n 'zipcode',\n 'address',\n 'address_number',\n 'neighborhood',\n 'city',\n 'state',\n 'country',\n];\n\n/**\n * Conta sujeita à NF-e brasileira. Só ela entra no bloqueio: o formulário pede\n * CPF/CNPJ e CEP de 8 dígitos, que um cliente de fora não tem como fornecer —\n * e o modal é bloqueante, então seria tranca sem saída.\n *\n * País vazio conta como Brasil: é o default do cadastro e a origem da esmagadora\n * maioria da base (155 contas pagas da wl 1 estão assim).\n */\nexport function isBrazilianBillingAccount(\n account: Pick<BillingDataSnapshot, 'country'> | null | undefined,\n): boolean {\n if (!account) return false;\n const country = account.country?.trim().toUpperCase();\n return !country || country === 'BR';\n}\n\nfunction isFilled(value: string | null | undefined): boolean {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\n/**\n * A conta tem todos os dados de cobrança/fiscais necessários pra emissão de nota.\n * Retorna `false` quando a conta ainda não carregou — quem decide bloquear é o\n * chamador, que checa o loading antes (ver `useRequiredBillingData`).\n */\nexport function hasCompleteBillingData(\n account: BillingDataSnapshot | null | undefined,\n): boolean {\n if (!account) return false;\n\n for (const field of REQUIRED_BILLING_FIELDS) {\n if (!isFilled(account[field])) return false;\n }\n\n return true;\n}\n"],"mappings":"AA6BA,MAAM,0BAAmD;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,SAAS,0BACd,SACS;AACT,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,UAAU,QAAQ,SAAS,KAAK,EAAE,YAAY;AACpD,SAAO,CAAC,WAAW,YAAY;AACjC;AAEA,SAAS,SAAS,OAA2C;AAC3D,SAAO,OAAO,UAAU,YAAY,MAAM,KAAK,EAAE,SAAS;AAC5D;AAOO,SAAS,uBACd,SACS;AACT,MAAI,CAAC,QAAS,QAAO;AAErB,aAAW,SAAS,yBAAyB;AAC3C,QAAI,CAAC,SAAS,QAAQ,KAAK,CAAC,EAAG,QAAO;AAAA,EACxC;AAEA,SAAO;AACT;","names":[]}
|
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ const COUNTRY_OPTIONS = COUNTRIES.map((country: { iso: string; name: string }) =
|
|
|
48
48
|
label: country.name,
|
|
49
49
|
}));
|
|
50
50
|
|
|
51
|
-
function buildBillingDataSchema(
|
|
51
|
+
function buildBillingDataSchema(translate: TranslateFn) {
|
|
52
52
|
const requiredText = z
|
|
53
53
|
.string()
|
|
54
54
|
.trim()
|
|
@@ -73,11 +73,6 @@ function buildBillingDataSchema(isInternational: boolean, translate: TranslateFn
|
|
|
73
73
|
country: requiredText,
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
/* Conta internacional não tem CPF/CNPJ, número nem bairro — mesmo recorte do
|
|
77
|
-
* AddCardModal. Exigir esses campos aqui trancaria o cliente fora do app, já que
|
|
78
|
-
* o modal é bloqueante. */
|
|
79
|
-
if (isInternational) return base;
|
|
80
|
-
|
|
81
76
|
return base.superRefine((data, ctx) => {
|
|
82
77
|
if (!data.streetNumber) {
|
|
83
78
|
ctx.addIssue({
|
|
@@ -140,7 +135,7 @@ function formatDocument(document: string | null | undefined, isCompany: boolean)
|
|
|
140
135
|
function RequiredBillingDataModalContent() {
|
|
141
136
|
const translate = useTranslations();
|
|
142
137
|
const { user } = useAuth();
|
|
143
|
-
const { isRequired, account
|
|
138
|
+
const { isRequired, account } = useRequiredBillingData();
|
|
144
139
|
const { mutateAsync: updateBillingData } = useUpdateBillingData();
|
|
145
140
|
const { mutateAsync: lookupCep } = useViaCep();
|
|
146
141
|
|
|
@@ -150,8 +145,8 @@ function RequiredBillingDataModalContent() {
|
|
|
150
145
|
const isPrefilled = useRef(false);
|
|
151
146
|
|
|
152
147
|
const schema = useMemo(
|
|
153
|
-
() => buildBillingDataSchema(
|
|
154
|
-
[
|
|
148
|
+
() => buildBillingDataSchema(translate),
|
|
149
|
+
[translate],
|
|
155
150
|
);
|
|
156
151
|
|
|
157
152
|
const form = useForm<BillingDataFormValues>({
|
|
@@ -203,9 +198,9 @@ function RequiredBillingDataModalContent() {
|
|
|
203
198
|
neighborhood: account.neighborhood ?? '',
|
|
204
199
|
city: account.city ?? '',
|
|
205
200
|
state: account.state ?? '',
|
|
206
|
-
country: account.country ||
|
|
201
|
+
country: account.country || 'BR',
|
|
207
202
|
});
|
|
208
|
-
}, [account,
|
|
203
|
+
}, [account, reset, user?.email]);
|
|
209
204
|
|
|
210
205
|
const handleDocumentChange = (rawValue: string) => {
|
|
211
206
|
setValue('document', isCompany ? formatCNPJ(rawValue) : formatCPF(rawValue), {
|
|
@@ -222,11 +217,6 @@ function RequiredBillingDataModalContent() {
|
|
|
222
217
|
};
|
|
223
218
|
|
|
224
219
|
const handleCepChange = (rawValue: string) => {
|
|
225
|
-
if (isInternational) {
|
|
226
|
-
setValue('cep', rawValue, { shouldValidate: true });
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
220
|
setValue('cep', formatPostalCode(rawValue), { shouldValidate: true });
|
|
231
221
|
|
|
232
222
|
const digits = rawValue.replace(/\D/g, '');
|
|
@@ -246,12 +236,8 @@ function RequiredBillingDataModalContent() {
|
|
|
246
236
|
|
|
247
237
|
async function onSubmit(data: BillingDataFormValues) {
|
|
248
238
|
const payload: UpdateBillingDataRequest = {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
: {
|
|
252
|
-
financial_document_type: data.personType === 'pf' ? 1 : 2,
|
|
253
|
-
financial_document: data.document,
|
|
254
|
-
}),
|
|
239
|
+
financial_document_type: data.personType === 'pf' ? 1 : 2,
|
|
240
|
+
financial_document: data.document,
|
|
255
241
|
financial_name: data.financialName,
|
|
256
242
|
financial_email: data.financialEmail,
|
|
257
243
|
zipcode: data.cep,
|
|
@@ -322,8 +308,7 @@ function RequiredBillingDataModalContent() {
|
|
|
322
308
|
>
|
|
323
309
|
<div className="flex flex-col gap-6 p-4 lg:p-5 flex-1 overflow-y-auto">
|
|
324
310
|
<div className="flex flex-col gap-5">
|
|
325
|
-
|
|
326
|
-
<div className="flex gap-4">
|
|
311
|
+
<div className="flex gap-4">
|
|
327
312
|
<Controller
|
|
328
313
|
name="personType"
|
|
329
314
|
control={control}
|
|
@@ -362,8 +347,7 @@ function RequiredBillingDataModalContent() {
|
|
|
362
347
|
})}
|
|
363
348
|
/>
|
|
364
349
|
</div>
|
|
365
|
-
|
|
366
|
-
)}
|
|
350
|
+
</div>
|
|
367
351
|
|
|
368
352
|
<FormField
|
|
369
353
|
label={
|
|
@@ -395,12 +379,8 @@ function RequiredBillingDataModalContent() {
|
|
|
395
379
|
</span>
|
|
396
380
|
|
|
397
381
|
<FormField
|
|
398
|
-
label={
|
|
399
|
-
|
|
400
|
-
? translate('common.billing.requiredData.postalCode')
|
|
401
|
-
: translate('common.billing.requiredData.cep')
|
|
402
|
-
}
|
|
403
|
-
placeholder={isInternational ? '' : '_____-___'}
|
|
382
|
+
label={translate('common.billing.requiredData.cep')}
|
|
383
|
+
placeholder="_____-___"
|
|
404
384
|
error={!!errors.cep}
|
|
405
385
|
errorMessage={errors.cep?.message}
|
|
406
386
|
{...register('cep', {
|
|
@@ -418,31 +398,27 @@ function RequiredBillingDataModalContent() {
|
|
|
418
398
|
{...register('street')}
|
|
419
399
|
/>
|
|
420
400
|
</div>
|
|
421
|
-
|
|
422
|
-
<
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
</div>
|
|
431
|
-
)}
|
|
401
|
+
<div className="flex-1">
|
|
402
|
+
<FormField
|
|
403
|
+
label={translate('common.billing.requiredData.streetNumber')}
|
|
404
|
+
placeholder="000"
|
|
405
|
+
error={!!errors.streetNumber}
|
|
406
|
+
errorMessage={errors.streetNumber?.message}
|
|
407
|
+
{...register('streetNumber')}
|
|
408
|
+
/>
|
|
409
|
+
</div>
|
|
432
410
|
</div>
|
|
433
411
|
|
|
434
412
|
<div className="flex gap-4">
|
|
435
|
-
|
|
436
|
-
<
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
</div>
|
|
445
|
-
)}
|
|
413
|
+
<div className="flex-1">
|
|
414
|
+
<FormField
|
|
415
|
+
label={translate('common.billing.requiredData.neighborhood')}
|
|
416
|
+
placeholder={translate('common.billing.requiredData.typeHere')}
|
|
417
|
+
error={!!errors.neighborhood}
|
|
418
|
+
errorMessage={errors.neighborhood?.message}
|
|
419
|
+
{...register('neighborhood')}
|
|
420
|
+
/>
|
|
421
|
+
</div>
|
|
446
422
|
<div className="flex-1">
|
|
447
423
|
<FormField
|
|
448
424
|
label={translate('common.billing.requiredData.complement')}
|
|
@@ -464,16 +440,7 @@ function RequiredBillingDataModalContent() {
|
|
|
464
440
|
/>
|
|
465
441
|
</div>
|
|
466
442
|
<div className="flex-1">
|
|
467
|
-
|
|
468
|
-
<FormField
|
|
469
|
-
label={translate('common.billing.requiredData.stateProvince')}
|
|
470
|
-
placeholder={translate('common.billing.requiredData.typeHere')}
|
|
471
|
-
error={!!errors.state}
|
|
472
|
-
errorMessage={errors.state?.message}
|
|
473
|
-
{...register('state')}
|
|
474
|
-
/>
|
|
475
|
-
) : (
|
|
476
|
-
<Controller
|
|
443
|
+
<Controller
|
|
477
444
|
name="state"
|
|
478
445
|
control={control}
|
|
479
446
|
render={({ field }) => (
|
|
@@ -489,8 +456,7 @@ function RequiredBillingDataModalContent() {
|
|
|
489
456
|
errorMessage={errors.state?.message}
|
|
490
457
|
/>
|
|
491
458
|
)}
|
|
492
|
-
|
|
493
|
-
)}
|
|
459
|
+
/>
|
|
494
460
|
</div>
|
|
495
461
|
</div>
|
|
496
462
|
|
package/src/index.ts
CHANGED
|
@@ -539,7 +539,10 @@ export {
|
|
|
539
539
|
export { useViaCep } from "./modules/accounts/hooks/useViaCep";
|
|
540
540
|
export { useAccountToken } from "./modules/accounts/hooks/use-account-token.hook";
|
|
541
541
|
export { useRequiredBillingData } from "./modules/accounts/hooks/use-required-billing-data.hook";
|
|
542
|
-
export {
|
|
542
|
+
export {
|
|
543
|
+
hasCompleteBillingData,
|
|
544
|
+
isBrazilianBillingAccount,
|
|
545
|
+
} from "./modules/accounts/utils/billing-data";
|
|
543
546
|
export type { BillingDataSnapshot } from "./modules/accounts/utils/billing-data";
|
|
544
547
|
|
|
545
548
|
// Account Types
|
|
@@ -4,15 +4,14 @@ import { useCurrentAccount } from './current-account.hook';
|
|
|
4
4
|
import { useActiveSubscription } from '../../subscriptions/hooks/find-active-subscription.hook';
|
|
5
5
|
import { hasPaidSubscription } from '../../subscriptions/utils/has-paid-subscription';
|
|
6
6
|
import { useManagementPermissions } from '../../auth/hooks/useManagementPermissions';
|
|
7
|
-
import { hasCompleteBillingData } from '../utils/billing-data';
|
|
8
|
-
import { isUsdAccount } from '../../../utils/format/gateway';
|
|
7
|
+
import { hasCompleteBillingData, isBrazilianBillingAccount } from '../utils/billing-data';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Contas que já pagaram mas nunca preencheram o cadastro de cobrança ficam sem
|
|
12
11
|
* nota fiscal (chamado "Nota fiscal não emitida em pagamentos confirmados").
|
|
13
12
|
* Este hook diz quando o preenchimento vira obrigatório — o modal que ele
|
|
14
13
|
* alimenta é bloqueante, então só liga com os dados já carregados e só para
|
|
15
|
-
* quem consegue resolver: owner/admin.
|
|
14
|
+
* quem consegue resolver: owner/admin de conta brasileira.
|
|
16
15
|
*/
|
|
17
16
|
export function useRequiredBillingData() {
|
|
18
17
|
const { isOwnerOrAdmin } = useManagementPermissions();
|
|
@@ -27,6 +26,7 @@ export function useRequiredBillingData() {
|
|
|
27
26
|
const isRequired =
|
|
28
27
|
!isLoading &&
|
|
29
28
|
isOwnerOrAdmin &&
|
|
29
|
+
isBrazilianBillingAccount(account) &&
|
|
30
30
|
hasPaidSubscription(subscription) &&
|
|
31
31
|
!hasCompleteBillingData(account);
|
|
32
32
|
|
|
@@ -34,6 +34,5 @@ export function useRequiredBillingData() {
|
|
|
34
34
|
isRequired,
|
|
35
35
|
isLoading,
|
|
36
36
|
account,
|
|
37
|
-
isInternational: isUsdAccount(account),
|
|
38
37
|
};
|
|
39
38
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { Account } from '../types';
|
|
2
|
-
import { isUsdAccount } from '../../../utils/format/gateway';
|
|
3
2
|
|
|
4
3
|
export type BillingDataSnapshot = Pick<
|
|
5
4
|
Account,
|
|
6
|
-
| 'gateway'
|
|
7
5
|
| 'financial_document'
|
|
8
6
|
| 'financial_name'
|
|
9
7
|
| 'financial_email'
|
|
@@ -16,33 +14,46 @@ export type BillingDataSnapshot = Pick<
|
|
|
16
14
|
| 'country'
|
|
17
15
|
>;
|
|
18
16
|
|
|
19
|
-
type BillingField = keyof
|
|
17
|
+
type BillingField = keyof BillingDataSnapshot;
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
* Campos exigidos
|
|
20
|
+
* Campos exigidos pra emitir a NF-e — sem qualquer um deles a nota não sai.
|
|
23
21
|
*
|
|
24
22
|
* `financial_email` NÃO entra: o backend cai no e-mail do usuário quando ele está
|
|
25
23
|
* vazio (`financial_email || userDocument.email`, accounts/services.js), então a
|
|
26
24
|
* nota sai do mesmo jeito. Exigi-lo aqui bloquearia 4.7k contas pagantes da wl 1
|
|
27
25
|
* em vez das ~460 que de fato estão sem cadastro fiscal. O campo continua no
|
|
28
26
|
* formulário, pré-preenchido — só não é critério de bloqueio.
|
|
27
|
+
*
|
|
28
|
+
* `address_complement` é opcional de verdade.
|
|
29
29
|
*/
|
|
30
|
-
const
|
|
30
|
+
const REQUIRED_BILLING_FIELDS: readonly BillingField[] = [
|
|
31
|
+
'financial_document',
|
|
31
32
|
'financial_name',
|
|
32
33
|
'zipcode',
|
|
33
34
|
'address',
|
|
35
|
+
'address_number',
|
|
36
|
+
'neighborhood',
|
|
34
37
|
'city',
|
|
35
38
|
'state',
|
|
36
39
|
'country',
|
|
37
40
|
];
|
|
38
41
|
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Conta sujeita à NF-e brasileira. Só ela entra no bloqueio: o formulário pede
|
|
44
|
+
* CPF/CNPJ e CEP de 8 dígitos, que um cliente de fora não tem como fornecer —
|
|
45
|
+
* e o modal é bloqueante, então seria tranca sem saída.
|
|
46
|
+
*
|
|
47
|
+
* País vazio conta como Brasil: é o default do cadastro e a origem da esmagadora
|
|
48
|
+
* maioria da base (155 contas pagas da wl 1 estão assim).
|
|
49
|
+
*/
|
|
50
|
+
export function isBrazilianBillingAccount(
|
|
51
|
+
account: Pick<BillingDataSnapshot, 'country'> | null | undefined,
|
|
52
|
+
): boolean {
|
|
53
|
+
if (!account) return false;
|
|
54
|
+
const country = account.country?.trim().toUpperCase();
|
|
55
|
+
return !country || country === 'BR';
|
|
56
|
+
}
|
|
46
57
|
|
|
47
58
|
function isFilled(value: string | null | undefined): boolean {
|
|
48
59
|
return typeof value === 'string' && value.trim().length > 0;
|
|
@@ -58,11 +69,7 @@ export function hasCompleteBillingData(
|
|
|
58
69
|
): boolean {
|
|
59
70
|
if (!account) return false;
|
|
60
71
|
|
|
61
|
-
const
|
|
62
|
-
? INTERNATIONAL_BILLING_FIELDS
|
|
63
|
-
: BR_BILLING_FIELDS;
|
|
64
|
-
|
|
65
|
-
for (const field of fields) {
|
|
72
|
+
for (const field of REQUIRED_BILLING_FIELDS) {
|
|
66
73
|
if (!isFilled(account[field])) return false;
|
|
67
74
|
}
|
|
68
75
|
|