UNPKG

@coursebuilder/core

Version:

Core package for Course Builder

62 lines (59 loc) 2.68 kB
import { F as FormatPricesForProductOptions, h as FormattedPrice, c as CourseBuilderAdapter } from '../../adapters-BjQ3VSch.js'; import { Product } from '../../schemas/product-schema.js'; import { Purchase } from '../../schemas/purchase-schema.js'; import '@auth/core/adapters'; import '../../schemas/coupon-schema.js'; import 'zod'; import '../../schemas/merchant-coupon-schema.js'; import '../../schemas/merchant-customer-schema.js'; import '../../schemas/merchant-product-schema.js'; import '../../schemas/price-schema.js'; import '../../schemas/purchase-user-transfer-schema.js'; import '../../schemas/resource-progress-schema.js'; import '../../schemas/user-schema.js'; import '../../schemas/video-resource.js'; import '../../schemas/upgradable-product-schema.js'; import '../../schemas/merchant-charge-schema.js'; import '../../schemas/merchant-price-schema.js'; import '../../schemas/content-resource-schema.js'; import '../../schemas/merchant-account-schema.js'; import '../../schemas/merchant-session.js'; import '../../schemas/merchant-subscription.js'; import '../../schemas/organization-member.js'; import '../../schemas/organization-schema.js'; import '../../schemas/subscription.js'; import '@auth/core'; import '@auth/core/providers/nodemailer'; import 'ai'; import 'cookie'; import 'inngest'; import 'stripe'; import '../utils/logger.js'; import '@auth/core/providers'; import '../../schemas/subscriber-schema.js'; import '../../providers/partykit.js'; import '../../providers/slack.js'; import '../../schemas/purchase-info.js'; import '../../schemas/subscription-info.js'; declare class PriceFormattingError extends Error { options: Partial<FormatPricesForProductOptions>; constructor(message: string, options: Partial<FormatPricesForProductOptions>); } declare function getFixedDiscountForIndividualUpgrade({ purchaseToBeUpgraded, productToBePurchased, purchaseWillBeRestricted, userId, ctx, }: { purchaseToBeUpgraded: Purchase | null; productToBePurchased: Product; purchaseWillBeRestricted: boolean; userId: string | undefined; ctx: CourseBuilderAdapter; }): Promise<number>; /** * Creates a verified price for a given product based on the unit price * of the product, coupons, and other factors. * * 30 minute loom walkthrough of this function: * https://www.loom.com/share/8cbd2213d44145dea51590b380f5d0d7?sid=bec3caeb-b742-4425-ae6e-81ca98c88f91 * * @param {FormatPricesForProductOptions} options the Prisma context */ declare function formatPricesForProduct(options: FormatPricesForProductOptions): Promise<FormattedPrice>; export { PriceFormattingError, formatPricesForProduct, getFixedDiscountForIndividualUpgrade };