AW-493-additional-purchases
add api using
This commit is contained in:
parent
efc50ae548
commit
f75185656f
@ -230,15 +230,19 @@
|
|||||||
"one_time_price_offer": "One time price offer: <price></price>",
|
"one_time_price_offer": "One time price offer: <price></price>",
|
||||||
"choose_from": "Choose from 80+ experts astrologers.",
|
"choose_from": "Choose from 80+ experts astrologers.",
|
||||||
"original_price": "Original price: {oldPrice} ",
|
"original_price": "Original price: {oldPrice} ",
|
||||||
"save": "Economisez 50",
|
"save": "Economisez {discount}%",
|
||||||
"get_my_consultation": "Get my consultation",
|
"get_my_consultation": "Get my consultation",
|
||||||
"skip_this_offer": "Skip this offer"
|
"skip_this_offer": "Skip this offer",
|
||||||
|
"payment_error": "Something went wrong. Please try again later."
|
||||||
},
|
},
|
||||||
"add-guides": {
|
"add-guides": {
|
||||||
"title": "Choose your sign-up offer 🔥",
|
"title": "Choose your sign-up offer 🔥",
|
||||||
"subtitle": "Available only now",
|
"subtitle": "Available only now",
|
||||||
"description": "*You will be charged for the add-on services or offers selected at the time of purchase. This is a non-recuring payment.",
|
"description": "*You will be charged for the add-on services or offers selected at the time of purchase. This is a non-recuring payment.",
|
||||||
"button": "Get my copy",
|
"button": "Get my copy",
|
||||||
|
"payment_error": "Something went wrong. Please try again later.",
|
||||||
|
"select_product_error": "Please select a product",
|
||||||
|
"skip_offer": "Skip offer",
|
||||||
|
|
||||||
"products": {
|
"products": {
|
||||||
"main_ultra_pack": {
|
"main_ultra_pack": {
|
||||||
|
|||||||
@ -0,0 +1,6 @@
|
|||||||
|
.loading {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100dvh;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import { Spinner } from "@/components/ui";
|
||||||
|
|
||||||
|
import styles from "./loading.module.scss";
|
||||||
|
|
||||||
|
export default function AddConsultantLoading() {
|
||||||
|
return (
|
||||||
|
<div className={styles.loading}>
|
||||||
|
<Spinner />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -12,3 +12,7 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
line-height: 125%;
|
line-height: 125%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.consultationTable.consultationTable {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,14 +1,25 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AddConsultantButton,
|
AddConsultantButton,
|
||||||
Caution,
|
Caution,
|
||||||
ConsultationTable,
|
ConsultationTable,
|
||||||
|
ConsultationTableSkeleton,
|
||||||
} from "@/components/domains/additional-purchases";
|
} from "@/components/domains/additional-purchases";
|
||||||
import { Typography } from "@/components/ui";
|
import { Card, Typography } from "@/components/ui";
|
||||||
|
import {
|
||||||
|
loadFunnelProducts,
|
||||||
|
loadFunnelProperties,
|
||||||
|
} from "@/entities/session/funnel/loaders";
|
||||||
|
import { ELocalesPlacement } from "@/types";
|
||||||
|
|
||||||
import styles from "./page.module.scss";
|
import styles from "./page.module.scss";
|
||||||
|
|
||||||
|
const payload = {
|
||||||
|
funnel: ELocalesPlacement.CompatibilityV2,
|
||||||
|
};
|
||||||
|
|
||||||
export default function AddConsultant() {
|
export default function AddConsultant() {
|
||||||
const t = useTranslations("AdditionalPurchases.add-consultant");
|
const t = useTranslations("AdditionalPurchases.add-consultant");
|
||||||
|
|
||||||
@ -26,8 +37,17 @@ export default function AddConsultant() {
|
|||||||
>
|
>
|
||||||
{t("exclusive_offer")}
|
{t("exclusive_offer")}
|
||||||
</Typography>
|
</Typography>
|
||||||
<ConsultationTable />
|
<Suspense fallback={<ConsultationTableSkeleton />}>
|
||||||
<AddConsultantButton />
|
<Card className={styles.consultationTable}>
|
||||||
|
<ConsultationTable
|
||||||
|
products={loadFunnelProducts(payload, "add_consultant")}
|
||||||
|
properties={loadFunnelProperties(payload, "add_consultant")}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</Suspense>
|
||||||
|
<AddConsultantButton
|
||||||
|
products={loadFunnelProducts(payload, "add_consultant")}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,58 +1,28 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AddGuidesButton,
|
AddGuidesButton,
|
||||||
Caution,
|
Caution,
|
||||||
IOffer,
|
|
||||||
Offers,
|
Offers,
|
||||||
|
OffersSkeleton,
|
||||||
|
ProductSelectionProvider,
|
||||||
} from "@/components/domains/additional-purchases";
|
} from "@/components/domains/additional-purchases";
|
||||||
import { Typography } from "@/components/ui";
|
import { Typography } from "@/components/ui";
|
||||||
|
import { loadFunnelProducts } from "@/entities/session/funnel/loaders";
|
||||||
|
import { ELocalesPlacement } from "@/types";
|
||||||
|
|
||||||
import styles from "./page.module.scss";
|
import styles from "./page.module.scss";
|
||||||
|
|
||||||
const PRODUCTS: (Omit<IOffer, "productKey"> & { key: string })[] = [
|
const payload = {
|
||||||
{
|
funnel: ELocalesPlacement.CompatibilityV2,
|
||||||
id: "67ae7c05b29427c9ae695039",
|
};
|
||||||
key: "main.ultra.pack",
|
|
||||||
type: "one_time",
|
|
||||||
price: 4999,
|
|
||||||
oldPrice: 2499.5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "67ae7c05b29427c9ae69503c",
|
|
||||||
key: "main.numerology.analysis",
|
|
||||||
type: "one_time",
|
|
||||||
price: 1499,
|
|
||||||
oldPrice: 749.5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "67ae7c05b29427c9ae69503e",
|
|
||||||
key: "main.tarot.reading",
|
|
||||||
type: "one_time",
|
|
||||||
price: 1999,
|
|
||||||
oldPrice: 999.5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "6839ece6960824e7bba3e7bb",
|
|
||||||
key: "main.money.reading",
|
|
||||||
type: "one_time",
|
|
||||||
price: 1999,
|
|
||||||
oldPrice: 999.5,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "main_skip_offer",
|
|
||||||
key: "main.skip.offer",
|
|
||||||
type: "one_time",
|
|
||||||
price: 0,
|
|
||||||
oldPrice: 0,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function AddGuides() {
|
export default function AddGuides() {
|
||||||
const t = useTranslations("AdditionalPurchases.add-guides");
|
const t = useTranslations("AdditionalPurchases.add-guides");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<ProductSelectionProvider>
|
||||||
<Caution />
|
<Caution />
|
||||||
<Typography as="h2" size="xl" weight="semiBold" className={styles.title}>
|
<Typography as="h2" size="xl" weight="semiBold" className={styles.title}>
|
||||||
{t("title")}
|
{t("title")}
|
||||||
@ -60,11 +30,13 @@ export default function AddGuides() {
|
|||||||
<Typography as="h3" size="sm" className={styles.subtitle}>
|
<Typography as="h3" size="sm" className={styles.subtitle}>
|
||||||
{t("subtitle")}
|
{t("subtitle")}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Offers products={PRODUCTS} />
|
<Suspense fallback={<OffersSkeleton />}>
|
||||||
|
<Offers products={loadFunnelProducts(payload, "add_guides")} />
|
||||||
|
</Suspense>
|
||||||
<Typography align="left" color="secondary" className={styles.description}>
|
<Typography align="left" color="secondary" className={styles.description}>
|
||||||
{t("description")}
|
{t("description")}
|
||||||
</Typography>
|
</Typography>
|
||||||
<AddGuidesButton />
|
<AddGuidesButton />
|
||||||
</>
|
</ProductSelectionProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,59 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { use } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
import { Button, Typography } from "@/components/ui";
|
import { Button, Spinner, Typography } from "@/components/ui";
|
||||||
import { BlurComponent } from "@/components/widgets";
|
import { BlurComponent } from "@/components/widgets";
|
||||||
|
import { IFunnelPaymentVariant } from "@/entities/session/funnel/types";
|
||||||
|
import { useSingleCheckout } from "@/hooks/payment/useSingleCheckout";
|
||||||
|
import { useToast } from "@/providers/toast-provider";
|
||||||
import { ROUTES } from "@/shared/constants/client-routes";
|
import { ROUTES } from "@/shared/constants/client-routes";
|
||||||
|
|
||||||
import styles from "./AddConsultantButton.module.scss";
|
import styles from "./AddConsultantButton.module.scss";
|
||||||
|
|
||||||
export default function AddConsultantButton() {
|
interface AddConsultantButtonProps {
|
||||||
|
products: Promise<IFunnelPaymentVariant[]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function AddConsultantButton({
|
||||||
|
products,
|
||||||
|
}: AddConsultantButtonProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const t = useTranslations("AdditionalPurchases.add-consultant");
|
const t = useTranslations("AdditionalPurchases.add-consultant");
|
||||||
|
const { addToast } = useToast();
|
||||||
|
|
||||||
|
const product = use(products)?.[0];
|
||||||
|
|
||||||
|
const { handleSingleCheckout, isLoading } = useSingleCheckout({
|
||||||
|
onSuccess: () => {
|
||||||
|
router.push(ROUTES.addGuides());
|
||||||
|
},
|
||||||
|
onError: _error => {
|
||||||
|
addToast({
|
||||||
|
variant: "error",
|
||||||
|
message: t("payment_error"),
|
||||||
|
duration: 5000,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleGetConsultation = () => {
|
||||||
|
if (!product) {
|
||||||
|
addToast({
|
||||||
|
variant: "error",
|
||||||
|
message: t("payment_error"),
|
||||||
|
duration: 5000,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
handleSingleCheckout({
|
||||||
|
productId: product.id,
|
||||||
|
key: product.key,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const handleSkipOffer = () => {
|
const handleSkipOffer = () => {
|
||||||
router.push(ROUTES.addGuides());
|
router.push(ROUTES.addGuides());
|
||||||
@ -19,12 +61,24 @@ export default function AddConsultantButton() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<BlurComponent isActiveBlur={true} className={styles.container}>
|
<BlurComponent isActiveBlur={true} className={styles.container}>
|
||||||
<Button className={styles.button}>
|
<Button
|
||||||
<Typography weight="semiBold" color="white">
|
className={styles.button}
|
||||||
{t("get_my_consultation")}
|
onClick={handleGetConsultation}
|
||||||
</Typography>
|
disabled={isLoading || !product}
|
||||||
|
>
|
||||||
|
{isLoading ? (
|
||||||
|
<Spinner />
|
||||||
|
) : (
|
||||||
|
<Typography weight="semiBold" color="white">
|
||||||
|
{t("get_my_consultation")}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
<Button className={styles.skipButton} onClick={handleSkipOffer}>
|
<Button
|
||||||
|
className={styles.skipButton}
|
||||||
|
onClick={handleSkipOffer}
|
||||||
|
disabled={isLoading}
|
||||||
|
>
|
||||||
<Typography size="sm" color="black">
|
<Typography size="sm" color="black">
|
||||||
{t("skip_this_offer")}
|
{t("skip_this_offer")}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@ -1,19 +1,73 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
import { Button, Typography } from "@/components/ui";
|
import { Button, Spinner, Typography } from "@/components/ui";
|
||||||
import { BlurComponent } from "@/components/widgets";
|
import { BlurComponent } from "@/components/widgets";
|
||||||
|
import { useSingleCheckout } from "@/hooks/payment/useSingleCheckout";
|
||||||
|
import { useToast } from "@/providers/toast-provider";
|
||||||
|
import { ROUTES } from "@/shared/constants/client-routes";
|
||||||
|
|
||||||
|
import { useProductSelection } from "../ProductSelectionContext";
|
||||||
|
|
||||||
import styles from "./AddGuidesButton.module.scss";
|
import styles from "./AddGuidesButton.module.scss";
|
||||||
|
|
||||||
export default function AddGuidesButton() {
|
export default function AddGuidesButton() {
|
||||||
const t = useTranslations("AdditionalPurchases.add-guides");
|
const t = useTranslations("AdditionalPurchases.add-guides");
|
||||||
|
const router = useRouter();
|
||||||
|
const { addToast } = useToast();
|
||||||
|
const { selectedProduct } = useProductSelection();
|
||||||
|
|
||||||
|
const { handleSingleCheckout, isLoading } = useSingleCheckout({
|
||||||
|
onSuccess: () => {
|
||||||
|
router.push(ROUTES.home());
|
||||||
|
},
|
||||||
|
onError: _error => {
|
||||||
|
addToast({
|
||||||
|
variant: "error",
|
||||||
|
message: t("payment_error"),
|
||||||
|
duration: 5000,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handlePurchase = () => {
|
||||||
|
if (!selectedProduct) {
|
||||||
|
addToast({
|
||||||
|
variant: "error",
|
||||||
|
message: t("select_product_error"),
|
||||||
|
duration: 5000,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
handleSingleCheckout({
|
||||||
|
productId: selectedProduct.id,
|
||||||
|
key: selectedProduct.key,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSkipOffer = () => {
|
||||||
|
router.push(ROUTES.home());
|
||||||
|
};
|
||||||
|
|
||||||
|
const isSkipOffer = selectedProduct?.id === "main_skip_offer";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BlurComponent isActiveBlur={true} className={styles.container}>
|
<BlurComponent isActiveBlur={true} className={styles.container}>
|
||||||
<Button className={styles.button}>
|
<Button
|
||||||
<Typography weight="semiBold" color="white">
|
className={styles.button}
|
||||||
{t("button")}
|
onClick={isSkipOffer ? handleSkipOffer : handlePurchase}
|
||||||
</Typography>
|
disabled={isLoading}
|
||||||
|
>
|
||||||
|
{isLoading ? (
|
||||||
|
<Spinner />
|
||||||
|
) : (
|
||||||
|
<Typography weight="semiBold" color="white">
|
||||||
|
{isSkipOffer ? t("skip_offer") : t("button")}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
</BlurComponent>
|
</BlurComponent>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
.container {
|
.container {
|
||||||
margin: 12px auto 0;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
|
|||||||
@ -1,17 +1,37 @@
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { useTranslations } from "next-intl";
|
import { getTranslations } from "next-intl/server";
|
||||||
|
|
||||||
import { Typography } from "@/components/ui";
|
import { Skeleton, Typography } from "@/components/ui";
|
||||||
|
import {
|
||||||
|
IFunnelPaymentProperty,
|
||||||
|
IFunnelPaymentVariant,
|
||||||
|
} from "@/entities/session/funnel/types";
|
||||||
import { getFormattedPrice } from "@/shared/utils/price";
|
import { getFormattedPrice } from "@/shared/utils/price";
|
||||||
import { Currency } from "@/types";
|
import { Currency } from "@/types";
|
||||||
|
|
||||||
import styles from "./ConsultationTable.module.scss";
|
import styles from "./ConsultationTable.module.scss";
|
||||||
|
|
||||||
export default function ConsultationTable() {
|
interface ConsultationTableProps {
|
||||||
const t = useTranslations("AdditionalPurchases.add-consultant");
|
products: Promise<IFunnelPaymentVariant[]>;
|
||||||
|
properties: Promise<IFunnelPaymentProperty[]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function ConsultationTable({
|
||||||
|
products,
|
||||||
|
properties,
|
||||||
|
}: ConsultationTableProps) {
|
||||||
|
const t = await getTranslations("AdditionalPurchases.add-consultant");
|
||||||
const currency = Currency.USD;
|
const currency = Currency.USD;
|
||||||
|
|
||||||
const price = getFormattedPrice(4985, currency);
|
const product = (await products)?.[0];
|
||||||
|
const discount =
|
||||||
|
(await properties)?.find(p => p.key === "discount")?.value ?? 0;
|
||||||
|
|
||||||
|
const price = getFormattedPrice(product?.price ?? 0, currency);
|
||||||
|
const oldPrice = getFormattedPrice(
|
||||||
|
(Number(product?.price) / (Number(discount) || 100)) * 100,
|
||||||
|
currency
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
@ -64,10 +84,12 @@ export default function ConsultationTable() {
|
|||||||
className={styles.oldPrice}
|
className={styles.oldPrice}
|
||||||
>
|
>
|
||||||
{t("original_price", {
|
{t("original_price", {
|
||||||
oldPrice: getFormattedPrice(9999, currency),
|
oldPrice: oldPrice,
|
||||||
})}
|
})}
|
||||||
<Typography weight="bold" className={styles.save}>
|
<Typography weight="bold" className={styles.save}>
|
||||||
{t("save")}
|
{t("save", {
|
||||||
|
discount: discount,
|
||||||
|
})}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
<div className={styles.line} />
|
<div className={styles.line} />
|
||||||
@ -87,3 +109,7 @@ export default function ConsultationTable() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function ConsultationTableSkeleton() {
|
||||||
|
return <Skeleton style={{ height: "300px", marginTop: "24px" }} />;
|
||||||
|
}
|
||||||
|
|||||||
@ -2,31 +2,28 @@ import Image from "next/image";
|
|||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
import { Card, Typography } from "@/components/ui";
|
import { Card, Typography } from "@/components/ui";
|
||||||
|
import { IFunnelPaymentVariant } from "@/entities/session/funnel/types";
|
||||||
import { getFormattedPrice } from "@/shared/utils/price";
|
import { getFormattedPrice } from "@/shared/utils/price";
|
||||||
import { Currency } from "@/types";
|
import { Currency } from "@/types";
|
||||||
|
|
||||||
import styles from "./Offer.module.scss";
|
import styles from "./Offer.module.scss";
|
||||||
|
|
||||||
export interface IOffer {
|
interface OfferProps {
|
||||||
id: string;
|
offer: IFunnelPaymentVariant;
|
||||||
productKey: string;
|
|
||||||
type: "one_time" | string;
|
|
||||||
price: number;
|
|
||||||
oldPrice: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OfferProps extends IOffer {
|
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Offer(props: OfferProps) {
|
export default function Offer(props: OfferProps) {
|
||||||
const { id, productKey, isActive, price, oldPrice, className, onClick } =
|
const { offer, isActive, className, onClick } = props;
|
||||||
props;
|
|
||||||
|
const { key, price, oldPrice } = offer;
|
||||||
|
|
||||||
|
const productKey = key.replaceAll(".", "_");
|
||||||
|
|
||||||
const t = useTranslations(
|
const t = useTranslations(
|
||||||
`AdditionalPurchases.add-guides.products.${productKey?.replaceAll(".", "_")}`
|
`AdditionalPurchases.add-guides.products.${productKey}`
|
||||||
);
|
);
|
||||||
|
|
||||||
const currency = Currency.USD;
|
const currency = Currency.USD;
|
||||||
@ -67,7 +64,7 @@ export default function Offer(props: OfferProps) {
|
|||||||
>
|
>
|
||||||
{t("title")}
|
{t("title")}
|
||||||
</Typography>
|
</Typography>
|
||||||
{!!subtitle?.length && id !== "main_skip_offer" && (
|
{!!subtitle?.length && productKey !== "main_skip_offer" && (
|
||||||
<Typography
|
<Typography
|
||||||
align="left"
|
align="left"
|
||||||
size="sm"
|
size="sm"
|
||||||
@ -78,7 +75,7 @@ export default function Offer(props: OfferProps) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
<div className={styles.priceContainer}>
|
<div className={styles.priceContainer}>
|
||||||
{id !== "main_skip_offer" && (
|
{productKey !== "main_skip_offer" && (
|
||||||
<Typography
|
<Typography
|
||||||
align="left"
|
align="left"
|
||||||
color={typographyColor}
|
color={typographyColor}
|
||||||
@ -111,7 +108,7 @@ export default function Offer(props: OfferProps) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{id === "main_skip_offer" && (
|
{productKey === "main_skip_offer" && (
|
||||||
<Typography
|
<Typography
|
||||||
align="left"
|
align="left"
|
||||||
size="xs"
|
size="xs"
|
||||||
@ -122,7 +119,7 @@ export default function Offer(props: OfferProps) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{id !== "ultra_pack" && (
|
{productKey !== "ultra_pack" && (
|
||||||
<div className={styles.discountContainer}>
|
<div className={styles.discountContainer}>
|
||||||
<Typography
|
<Typography
|
||||||
size="xs"
|
size="xs"
|
||||||
|
|||||||
@ -1,29 +1,64 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { use, useEffect, useState } from "react";
|
||||||
|
|
||||||
|
import { Skeleton } from "@/components/ui";
|
||||||
|
import { IFunnelPaymentVariant } from "@/entities/session/funnel/types";
|
||||||
|
|
||||||
|
import { useProductSelection } from "../ProductSelectionContext";
|
||||||
|
|
||||||
import styles from "./Offers.module.scss";
|
import styles from "./Offers.module.scss";
|
||||||
|
|
||||||
import { IOffer, Offer } from "..";
|
import { Offer } from "..";
|
||||||
|
|
||||||
interface OffersProps {
|
interface OffersProps {
|
||||||
products: (Omit<IOffer, "productKey"> & { key: string })[];
|
products: Promise<IFunnelPaymentVariant[]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Offers({ products }: OffersProps) {
|
export default function Offers({ products }: OffersProps) {
|
||||||
const [activeOffer, setActiveOffer] = useState<string>(products[0].id);
|
const offers = use(products);
|
||||||
|
const [allOffers, setAllOffers] = useState<IFunnelPaymentVariant[]>([]);
|
||||||
|
const [activeOffer, setActiveOffer] = useState<string>("");
|
||||||
|
const { setSelectedProduct } = useProductSelection();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const skipOffer: IFunnelPaymentVariant = {
|
||||||
|
id: "main_skip_offer",
|
||||||
|
key: "main.skip.offer",
|
||||||
|
type: "one_time",
|
||||||
|
price: 0,
|
||||||
|
oldPrice: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
const offersWithSkip = [...offers, skipOffer];
|
||||||
|
setAllOffers(offersWithSkip);
|
||||||
|
setActiveOffer(offers[0]?.id || skipOffer.id);
|
||||||
|
|
||||||
|
// Устанавливаем первый продукт как выбранный по умолчанию
|
||||||
|
if (offers[0]) {
|
||||||
|
setSelectedProduct(offers[0]);
|
||||||
|
}
|
||||||
|
}, [offers, setSelectedProduct]);
|
||||||
|
|
||||||
|
const handleOfferClick = (offer: IFunnelPaymentVariant) => {
|
||||||
|
setActiveOffer(offer.id);
|
||||||
|
setSelectedProduct(offer);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
{products.map(product => (
|
{allOffers.map(offer => (
|
||||||
<Offer
|
<Offer
|
||||||
{...product}
|
offer={offer}
|
||||||
key={product.id}
|
key={offer.id}
|
||||||
productKey={product.key}
|
isActive={activeOffer === offer.id}
|
||||||
isActive={activeOffer === product.id}
|
onClick={() => handleOfferClick(offer)}
|
||||||
onClick={() => setActiveOffer(product.id)}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function OffersSkeleton() {
|
||||||
|
return <Skeleton style={{ height: "400px" }} />;
|
||||||
|
}
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { createContext, ReactNode, useContext, useState } from "react";
|
||||||
|
|
||||||
|
import { IFunnelPaymentVariant } from "@/entities/session/funnel/types";
|
||||||
|
|
||||||
|
interface ProductSelectionContextType {
|
||||||
|
selectedProduct: IFunnelPaymentVariant | null;
|
||||||
|
setSelectedProduct: (product: IFunnelPaymentVariant | null) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ProductSelectionContext = createContext<
|
||||||
|
ProductSelectionContextType | undefined
|
||||||
|
>(undefined);
|
||||||
|
|
||||||
|
interface ProductSelectionProviderProps {
|
||||||
|
children: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ProductSelectionProvider({
|
||||||
|
children,
|
||||||
|
}: ProductSelectionProviderProps) {
|
||||||
|
const [selectedProduct, setSelectedProduct] =
|
||||||
|
useState<IFunnelPaymentVariant | null>(null);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ProductSelectionContext.Provider
|
||||||
|
value={{ selectedProduct, setSelectedProduct }}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</ProductSelectionContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useProductSelection() {
|
||||||
|
const context = useContext(ProductSelectionContext);
|
||||||
|
if (!context) {
|
||||||
|
throw new Error(
|
||||||
|
"useProductSelection must be used within ProductSelectionProvider"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return context;
|
||||||
|
}
|
||||||
@ -1,6 +1,13 @@
|
|||||||
export { default as AddConsultantButton } from "./AddConsultantButton/AddConsultantButton";
|
export { default as AddConsultantButton } from "./AddConsultantButton/AddConsultantButton";
|
||||||
export { default as AddGuidesButton } from "./AddGuidesButton/AddGuidesButton";
|
export { default as AddGuidesButton } from "./AddGuidesButton/AddGuidesButton";
|
||||||
export { default as Caution } from "./Caution/Caution";
|
export { default as Caution } from "./Caution/Caution";
|
||||||
export { default as ConsultationTable } from "./ConsultationTable/ConsultationTable";
|
export {
|
||||||
export { type IOffer, default as Offer } from "./Offer/Offer";
|
default as ConsultationTable,
|
||||||
export { default as Offers } from "./Offers/Offers";
|
ConsultationTableSkeleton,
|
||||||
|
} from "./ConsultationTable/ConsultationTable";
|
||||||
|
export { default as Offer } from "./Offer/Offer";
|
||||||
|
export { default as Offers, OffersSkeleton } from "./Offers/Offers";
|
||||||
|
export {
|
||||||
|
ProductSelectionProvider,
|
||||||
|
useProductSelection,
|
||||||
|
} from "./ProductSelectionContext";
|
||||||
|
|||||||
34
src/entities/payment/actions.ts
Normal file
34
src/entities/payment/actions.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import { http } from "@/shared/api/httpClient";
|
||||||
|
import { API_ROUTES } from "@/shared/constants/api-routes";
|
||||||
|
import { ActionResponse } from "@/types";
|
||||||
|
|
||||||
|
import {
|
||||||
|
SingleCheckoutRequest,
|
||||||
|
SingleCheckoutResponse,
|
||||||
|
SingleCheckoutResponseSchema,
|
||||||
|
} from "./types";
|
||||||
|
|
||||||
|
export async function performSingleCheckout(
|
||||||
|
payload: SingleCheckoutRequest
|
||||||
|
): Promise<ActionResponse<SingleCheckoutResponse>> {
|
||||||
|
try {
|
||||||
|
const response = await http.post<SingleCheckoutResponse>(
|
||||||
|
API_ROUTES.paymentSingleCheckout(),
|
||||||
|
payload,
|
||||||
|
{
|
||||||
|
schema: SingleCheckoutResponseSchema,
|
||||||
|
revalidate: 0,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return { data: response, error: null };
|
||||||
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error("Failed to perform single checkout:", error);
|
||||||
|
const errorMessage =
|
||||||
|
error instanceof Error ? error.message : "Something went wrong.";
|
||||||
|
return { data: null, error: errorMessage };
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,6 +5,9 @@ import {
|
|||||||
CheckoutRequest,
|
CheckoutRequest,
|
||||||
CheckoutResponse,
|
CheckoutResponse,
|
||||||
CheckoutResponseSchema,
|
CheckoutResponseSchema,
|
||||||
|
SingleCheckoutRequest,
|
||||||
|
SingleCheckoutResponse,
|
||||||
|
SingleCheckoutResponseSchema,
|
||||||
} from "./types";
|
} from "./types";
|
||||||
|
|
||||||
export async function createPaymentCheckout(payload: CheckoutRequest) {
|
export async function createPaymentCheckout(payload: CheckoutRequest) {
|
||||||
@ -13,3 +16,16 @@ export async function createPaymentCheckout(payload: CheckoutRequest) {
|
|||||||
revalidate: 0,
|
revalidate: 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function createSinglePaymentCheckout(
|
||||||
|
payload: SingleCheckoutRequest
|
||||||
|
) {
|
||||||
|
return http.post<SingleCheckoutResponse>(
|
||||||
|
API_ROUTES.paymentSingleCheckout(),
|
||||||
|
payload,
|
||||||
|
{
|
||||||
|
schema: SingleCheckoutResponseSchema,
|
||||||
|
revalidate: 0,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@ -13,3 +13,37 @@ export const CheckoutResponseSchema = z.object({
|
|||||||
paymentUrl: z.string().url(),
|
paymentUrl: z.string().url(),
|
||||||
});
|
});
|
||||||
export type CheckoutResponse = z.infer<typeof CheckoutResponseSchema>;
|
export type CheckoutResponse = z.infer<typeof CheckoutResponseSchema>;
|
||||||
|
|
||||||
|
export const PaymentInfoSchema = z.object({
|
||||||
|
productId: z.string(),
|
||||||
|
key: z.string(),
|
||||||
|
});
|
||||||
|
export type PaymentInfo = z.infer<typeof PaymentInfoSchema>;
|
||||||
|
|
||||||
|
export const SingleCheckoutRequestSchema = z.object({
|
||||||
|
paymentInfo: PaymentInfoSchema,
|
||||||
|
return_url: z.string().optional(),
|
||||||
|
});
|
||||||
|
export type SingleCheckoutRequest = z.infer<typeof SingleCheckoutRequestSchema>;
|
||||||
|
|
||||||
|
export const SingleCheckoutSuccessSchema = z.object({
|
||||||
|
payment: z.object({
|
||||||
|
status: z.string(),
|
||||||
|
invoiceId: z.string(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
export type SingleCheckoutSuccess = z.infer<typeof SingleCheckoutSuccessSchema>;
|
||||||
|
|
||||||
|
export const SingleCheckoutErrorSchema = z.object({
|
||||||
|
status: z.string(),
|
||||||
|
message: z.string(),
|
||||||
|
});
|
||||||
|
export type SingleCheckoutError = z.infer<typeof SingleCheckoutErrorSchema>;
|
||||||
|
|
||||||
|
export const SingleCheckoutResponseSchema = z.union([
|
||||||
|
SingleCheckoutSuccessSchema,
|
||||||
|
SingleCheckoutErrorSchema,
|
||||||
|
]);
|
||||||
|
export type SingleCheckoutResponse = z.infer<
|
||||||
|
typeof SingleCheckoutResponseSchema
|
||||||
|
>;
|
||||||
|
|||||||
12
src/entities/session/funnel/api.ts
Normal file
12
src/entities/session/funnel/api.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { http } from "@/shared/api/httpClient";
|
||||||
|
import { API_ROUTES } from "@/shared/constants/api-routes";
|
||||||
|
|
||||||
|
import { FunnelRequest, FunnelResponse, FunnelResponseSchema } from "./types";
|
||||||
|
|
||||||
|
export const getFunnel = async (payload: FunnelRequest) => {
|
||||||
|
return http.post<FunnelResponse>(API_ROUTES.funnel(), payload, {
|
||||||
|
tags: ["funnel"],
|
||||||
|
schema: FunnelResponseSchema,
|
||||||
|
revalidate: 0,
|
||||||
|
});
|
||||||
|
};
|
||||||
41
src/entities/session/funnel/loaders.ts
Normal file
41
src/entities/session/funnel/loaders.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import { cache } from "react";
|
||||||
|
|
||||||
|
import { getFunnel } from "./api";
|
||||||
|
import type { FunnelRequest } from "./types";
|
||||||
|
|
||||||
|
export const loadFunnel = cache((payload: FunnelRequest) => getFunnel(payload));
|
||||||
|
|
||||||
|
export const loadFunnelData = cache((payload: FunnelRequest) =>
|
||||||
|
loadFunnel(payload).then(d => d.data)
|
||||||
|
);
|
||||||
|
|
||||||
|
export const loadFunnelStatus = cache((payload: FunnelRequest) =>
|
||||||
|
loadFunnel(payload).then(d => d.status)
|
||||||
|
);
|
||||||
|
|
||||||
|
export const loadFunnelCurrency = cache((payload: FunnelRequest) =>
|
||||||
|
loadFunnelData(payload).then(d => d.currency)
|
||||||
|
);
|
||||||
|
|
||||||
|
export const loadFunnelLocale = cache((payload: FunnelRequest) =>
|
||||||
|
loadFunnelData(payload).then(d => d.locale)
|
||||||
|
);
|
||||||
|
|
||||||
|
export const loadFunnelPayment = cache((payload: FunnelRequest) =>
|
||||||
|
loadFunnelData(payload).then(d => d.payment)
|
||||||
|
);
|
||||||
|
|
||||||
|
export const loadFunnelPaymentById = cache(
|
||||||
|
(payload: FunnelRequest, paymentId: string) =>
|
||||||
|
loadFunnelData(payload).then(d => d.payment[paymentId])
|
||||||
|
);
|
||||||
|
|
||||||
|
export const loadFunnelProducts = cache(
|
||||||
|
(payload: FunnelRequest, paymentId: string) =>
|
||||||
|
loadFunnelPaymentById(payload, paymentId).then(d => d?.variants ?? [])
|
||||||
|
);
|
||||||
|
|
||||||
|
export const loadFunnelProperties = cache(
|
||||||
|
(payload: FunnelRequest, paymentId: string) =>
|
||||||
|
loadFunnelPaymentById(payload, paymentId).then(d => d?.properties ?? [])
|
||||||
|
);
|
||||||
61
src/entities/session/funnel/types.ts
Normal file
61
src/entities/session/funnel/types.ts
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
import { Currency, ELocalesPlacement } from "../../../types";
|
||||||
|
|
||||||
|
// Request schemas
|
||||||
|
export const FunnelRequestSchema = z.object({
|
||||||
|
funnel: z.nativeEnum(ELocalesPlacement),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Response schemas
|
||||||
|
export const FunnelPaymentPropertySchema = z.object({
|
||||||
|
key: z.string(),
|
||||||
|
value: z.union([z.string(), z.number()]),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const FunnelPaymentVariantSchema = z.object({
|
||||||
|
id: z.string(),
|
||||||
|
key: z.string(),
|
||||||
|
type: z.string(),
|
||||||
|
price: z.number(),
|
||||||
|
oldPrice: z.number().optional(),
|
||||||
|
trialPrice: z.number().optional(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const FunnelPaymentPlacementSchema = z.object({
|
||||||
|
price: z.number().optional(),
|
||||||
|
currency: z.nativeEnum(Currency).optional(),
|
||||||
|
billingPeriod: z.enum(["DAY", "WEEK", "MONTH", "YEAR"]).optional(),
|
||||||
|
billingInterval: z.number().optional(),
|
||||||
|
trialPeriod: z.enum(["DAY", "WEEK", "MONTH", "YEAR"]).optional(),
|
||||||
|
trialInterval: z.number().optional(),
|
||||||
|
placementId: z.string().optional(),
|
||||||
|
paywallId: z.string().optional(),
|
||||||
|
properties: z.array(FunnelPaymentPropertySchema).optional(),
|
||||||
|
variants: z.array(FunnelPaymentVariantSchema).optional(),
|
||||||
|
paymentUrl: z.string().optional(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const FunnelSchema = z.object({
|
||||||
|
currency: z.nativeEnum(Currency),
|
||||||
|
funnel: z.nativeEnum(ELocalesPlacement),
|
||||||
|
locale: z.string(),
|
||||||
|
payment: z.record(z.string(), FunnelPaymentPlacementSchema.nullable()),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const FunnelResponseSchema = z.object({
|
||||||
|
status: z.union([z.literal("success"), z.string()]),
|
||||||
|
data: FunnelSchema,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Type exports
|
||||||
|
export type FunnelRequest = z.infer<typeof FunnelRequestSchema>;
|
||||||
|
export type IFunnelPaymentProperty = z.infer<
|
||||||
|
typeof FunnelPaymentPropertySchema
|
||||||
|
>;
|
||||||
|
export type IFunnelPaymentVariant = z.infer<typeof FunnelPaymentVariantSchema>;
|
||||||
|
export type IFunnelPaymentPlacement = z.infer<
|
||||||
|
typeof FunnelPaymentPlacementSchema
|
||||||
|
>;
|
||||||
|
export type IFunnel = z.infer<typeof FunnelSchema>;
|
||||||
|
export type FunnelResponse = z.infer<typeof FunnelResponseSchema>;
|
||||||
71
src/hooks/payment/useSingleCheckout.ts
Normal file
71
src/hooks/payment/useSingleCheckout.ts
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useCallback, useMemo, useState } from "react";
|
||||||
|
|
||||||
|
import { performSingleCheckout } from "@/entities/payment/actions";
|
||||||
|
import { PaymentInfo, SingleCheckoutRequest } from "@/entities/payment/types";
|
||||||
|
|
||||||
|
interface UseSingleCheckoutOptions {
|
||||||
|
onSuccess?: () => void;
|
||||||
|
onError?: (error: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useSingleCheckout(options: UseSingleCheckoutOptions = {}) {
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
const { onSuccess, onError } = options;
|
||||||
|
|
||||||
|
const handleSingleCheckout = useCallback(
|
||||||
|
async (paymentInfo: PaymentInfo) => {
|
||||||
|
if (isLoading) return;
|
||||||
|
|
||||||
|
setIsLoading(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const payload: SingleCheckoutRequest = {
|
||||||
|
paymentInfo,
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await performSingleCheckout(payload);
|
||||||
|
|
||||||
|
if (response.error) {
|
||||||
|
onError?.(response.error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!response.data) {
|
||||||
|
onError?.("Payment failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("payment" in response.data) {
|
||||||
|
const { status } = response.data.payment;
|
||||||
|
|
||||||
|
if (status === "paid") {
|
||||||
|
onSuccess?.();
|
||||||
|
} else {
|
||||||
|
onError?.("Payment status is not paid");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const errorMessage = response.data.message || "Payment failed";
|
||||||
|
onError?.(errorMessage);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
const errorMessage =
|
||||||
|
error instanceof Error ? error.message : "Payment failed";
|
||||||
|
onError?.(errorMessage);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[onSuccess, onError, isLoading]
|
||||||
|
);
|
||||||
|
|
||||||
|
return useMemo(
|
||||||
|
() => ({
|
||||||
|
handleSingleCheckout,
|
||||||
|
isLoading,
|
||||||
|
}),
|
||||||
|
[handleSingleCheckout, isLoading]
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -15,6 +15,7 @@ export const API_ROUTES = {
|
|||||||
dashboard: () => createRoute(["dashboard"]),
|
dashboard: () => createRoute(["dashboard"]),
|
||||||
subscriptions: () => createRoute(["payment", "subscriptions"], ROOT_ROUTE_V3),
|
subscriptions: () => createRoute(["payment", "subscriptions"], ROOT_ROUTE_V3),
|
||||||
paymentCheckout: () => createRoute(["payment", "checkout"], ROOT_ROUTE_V2),
|
paymentCheckout: () => createRoute(["payment", "checkout"], ROOT_ROUTE_V2),
|
||||||
|
paymentSingleCheckout: () => createRoute(["payment", "checkout"]),
|
||||||
usersMe: () => createRoute(["users", "me"], ROOT_ROUTE),
|
usersMe: () => createRoute(["users", "me"], ROOT_ROUTE),
|
||||||
compatibilityActionFields: (id: string) =>
|
compatibilityActionFields: (id: string) =>
|
||||||
createRoute(["dashboard", "compatibility-actions", id, "fields"]),
|
createRoute(["dashboard", "compatibility-actions", id, "fields"]),
|
||||||
@ -28,4 +29,7 @@ export const API_ROUTES = {
|
|||||||
["payment", "subscriptions", subscriptionId, action],
|
["payment", "subscriptions", subscriptionId, action],
|
||||||
ROOT_ROUTE_V3
|
ROOT_ROUTE_V3
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// session
|
||||||
|
funnel: () => createRoute(["session", "funnel"], ROOT_ROUTE_V2),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -60,3 +60,26 @@ export type ActionResponse<T> = {
|
|||||||
data: T | null;
|
data: T | null;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export enum ELocalesPlacement {
|
||||||
|
V0 = "v0", // Main site version
|
||||||
|
V1 = "v1",
|
||||||
|
PalmistryV0 = "palmistry-v0",
|
||||||
|
PalmistryV01 = "palmistry-v0_1",
|
||||||
|
PalmistryV1 = "palmistry-v1",
|
||||||
|
PalmistryV11 = "palmistry-v1_1",
|
||||||
|
Chats = "chats",
|
||||||
|
EmailMarketingCompatibilityV1 = "email-marketing-comp-v1",
|
||||||
|
EmailMarketingPalmistryV2 = "email-marketing-palmistry-v2",
|
||||||
|
EmailMarketingCompatibilityV2 = "email-marketing-comp-v2",
|
||||||
|
EmailMarketingCompatibilityV3 = "email-marketing-comp-v3",
|
||||||
|
EmailMarketingCompatibilityV4 = "email-marketing-comp-v4",
|
||||||
|
CompatibilityV2 = "compatibility-v2",
|
||||||
|
CompatibilityV3 = "compatibility-v3",
|
||||||
|
CompatibilityV4 = "compatibility-v4",
|
||||||
|
EmailGenerator = "email-generator",
|
||||||
|
Profile = "profile",
|
||||||
|
RetainingFunnel = "retaining-funnel",
|
||||||
|
}
|
||||||
|
|
||||||
|
export type PeriodType = "DAY" | "WEEK" | "MONTH" | "YEAR";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user