Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/.env.dist.local
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ CROWD_STRIPE_PRICE_PREMIUM=
CROWD_STRIPE_PRICE_ENTERPRISE=
CROWD_STRIPE_SECRET_KEY=
CROWD_STRIPE_WEBHOOK_SIGNING_SECRET=
CROWD_STRIPE_EAGLE_EYE_PLAN_PRODUCT_ID=
CROWD_STRIPE_GROWTH_PLAN_PRODUCT_ID=

# Twitter settings
CROWD_TWITTER_CLIENT_ID=
Expand Down
4 changes: 3 additions & 1 deletion backend/config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@
"stripePricePremium": "CROWD_STRIPE_PRICE_PREMIUM",
"stripePriceEnterprise": "CROWD_STRIPE_PRICE_ENTERPRISE",
"stripeSecretKey": "CROWD_STRIPE_SECRET_KEY",
"stripWebhookSigningSecret": "CROWD_STRIPE_WEBHOOK_SIGNING_SECRET"
"stripWebhookSigningSecret": "CROWD_STRIPE_WEBHOOK_SIGNING_SECRET",
"stripeEagleEyePlanProductId": "CROWD_STRIPE_EAGLE_EYE_PLAN_PRODUCT_ID",
"stripeGrowthPlanProductId": "CROWD_STRIPE_GROWTH_PLAN_PRODUCT_ID"
},
"twitter": {
"clientId": "CROWD_TWITTER_CLIENT_ID",
Expand Down
2 changes: 1 addition & 1 deletion backend/src/bin/jobs/downgradeExpiredPlans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const job: CrowdJob = {
log.info('Downgrading expired non-trial plans')
const expiredNonTrialTenants = await dbOptions.database.sequelize.query(
`select t.id, t.name from tenants t
where t.plan = ${Plans.values.growth} and t."planSubscriptionEndsAt" is not null and t."planSubscriptionEndsAt" + interval '3 days' < now()`,
where (t.plan = ${Plans.values.growth} or t.plan = ${Plans.values.eagleEye}) and t."planSubscriptionEndsAt" is not null and t."planSubscriptionEndsAt" + interval '3 days' < now()`,
)

for (const tenant of expiredNonTrialTenants[0]) {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/bin/scripts/unleash-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const constaintConfiguration = {
[FeatureFlag.EAGLE_EYE]: [
[
{
values: [Plans.values.growth],
values: [Plans.values.growth, Plans.values.eagleEye],
inverted: false,
operator: 'IN',
contextName: 'plan',
Expand Down
2 changes: 2 additions & 0 deletions backend/src/config/configTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export interface PlansConfiguration {
stripePriceEnterprise: string
stripeSecretKey: string
stripWebhookSigningSecret: string
stripeEagleEyePlanProductId: string
stripeGrowthPlanProductId: string
}

export interface DevtoConfiguration {
Expand Down
2 changes: 2 additions & 0 deletions backend/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ export const PLANS_CONFIG: PlansConfiguration = KUBE_MODE
stripePriceEnterprise: process.env.PLAN_STRIPE_PRICES_ENTERPRISE,
stripeSecretKey: process.env.PLAN_STRIPE_SECRET_KEY,
stripWebhookSigningSecret: process.env.PLAN_STRIPE_WEBHOOK_SIGNING_SECRET,
stripeEagleEyePlanProductId: process.env.PLAN_STRIPE_EAGLE_EYE_PLAN_PRODUCT_ID,
stripeGrowthPlanProductId: process.env.PLAN_STRIPE_GROWTH_PLAN_PRODUCT_ID,
}

export const DEVTO_CONFIG: DevtoConfiguration = KUBE_MODE
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TYPE tenant_plans_type ADD VALUE 'Eagle Eye';
2 changes: 1 addition & 1 deletion backend/src/database/models/tenant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default (sequelize, DataTypes) => {
allowNull: false,
validate: {
notEmpty: true,
isIn: [[plans.essential, plans.growth]],
isIn: [[plans.essential, plans.growth, plans.eagleEye]],
},
defaultValue: plans.essential,
},
Expand Down
Loading