Merge pull request #1071 from automatisch/paddle-plans
feat: Introduce new plans for the cloud
This commit is contained in:
@@ -10,6 +10,7 @@ type AppConfig = {
|
|||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
appEnv: string;
|
appEnv: string;
|
||||||
isDev: boolean;
|
isDev: boolean;
|
||||||
|
isProd: boolean;
|
||||||
postgresDatabase: string;
|
postgresDatabase: string;
|
||||||
postgresSchema: string;
|
postgresSchema: string;
|
||||||
postgresPort: number;
|
postgresPort: number;
|
||||||
@@ -80,6 +81,7 @@ const appConfig: AppConfig = {
|
|||||||
port,
|
port,
|
||||||
appEnv: appEnv,
|
appEnv: appEnv,
|
||||||
isDev: appEnv === 'development',
|
isDev: appEnv === 'development',
|
||||||
|
isProd: appEnv === 'production',
|
||||||
version: process.env.npm_package_version,
|
version: process.env.npm_package_version,
|
||||||
postgresDatabase: process.env.POSTGRES_DATABASE || 'automatisch_development',
|
postgresDatabase: process.env.POSTGRES_DATABASE || 'automatisch_development',
|
||||||
postgresSchema: process.env.POSTGRES_SCHEMA || 'public',
|
postgresSchema: process.env.POSTGRES_SCHEMA || 'public',
|
||||||
|
@@ -1,13 +1,27 @@
|
|||||||
const plans = [
|
import appConfig from '../../config/app';
|
||||||
|
|
||||||
|
const testPlans = [
|
||||||
{
|
{
|
||||||
name: '10k - monthly',
|
name: '10k - monthly',
|
||||||
limit: '10,000',
|
limit: '10,000',
|
||||||
quota: 10000,
|
quota: 10000,
|
||||||
price: '€20',
|
price: '€20',
|
||||||
productId: '47384',
|
productId: '47384',
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const prodPlans = [
|
||||||
|
{
|
||||||
|
name: '10k - monthly',
|
||||||
|
limit: '10,000',
|
||||||
|
quota: 10000,
|
||||||
|
price: '€20',
|
||||||
|
productId: '826658',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const plans = appConfig.isProd ? prodPlans : testPlans;
|
||||||
|
|
||||||
export function getPlanById(id: string) {
|
export function getPlanById(id: string) {
|
||||||
return plans.find((plan) => plan.productId === id);
|
return plans.find((plan) => plan.productId === id);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user