Files
indee-demo/backend/src/subscriptions/helpers/subscription.helper.ts
Dorian cdd24a5def Implement backend API and database services in Docker setup
- Added a new `api` service for the NestJS backend, including health checks and dependencies on PostgreSQL, Redis, and MinIO.
- Introduced PostgreSQL and Redis services with health checks and configurations for data persistence.
- Added MinIO for S3-compatible object storage and a one-shot service to initialize required buckets.
- Updated the Nginx configuration to proxy requests to the new backend API and MinIO storage.
- Enhanced the Dockerfile to support the new API environment variables and configurations.
- Updated the `package.json` and `package-lock.json` to include new dependencies for QR code generation and other utilities.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 20:14:39 +00:00

36 lines
1.1 KiB
TypeScript

import { SubscriptionType } from '../enums/types.enum';
export const getBenefits = (type: SubscriptionType) => {
if (type === 'rss-addon') {
return 'the ability to publish your content through RSS and automatically reach your audience';
}
return 'access to the Screening Room with exclusive films, series, and music videos';
};
export const getPurchaseUrl = (type: SubscriptionType) => {
const frontendUrl = process.env.FRONTEND_URL || 'https://indeehub.studio';
if (type === 'rss-addon') {
return `${frontendUrl}/add-ons`;
}
return `${frontendUrl}/subscription`;
};
export const getSubsctriptionName = (type: SubscriptionType) => {
const formattedType = formatSubscriptionType(type);
if (type === 'rss-addon') {
return 'RSS Add-on';
}
return formattedType + ' Subscription';
};
/**
* Capitalizes the first letter of each word and removes hyphens.
* Example: 'film-buff' => 'Film Buff'
*/
export const formatSubscriptionType = (type: SubscriptionType): string => {
return type
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};