Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update automations limitation logic for new pricing plans #1641

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

yeganathan18
Copy link
Member

@yeganathan18 yeganathan18 commented Oct 6, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at bb6cce0

Added plan limit checks for automations in automationRepository.ts. This prevents tenants from creating or updating more active automations than their plan allows.

🤖 Generated by Copilot at bb6cce0

Sing, O Muse, of the skillful coder who devised
A cunning limit for the automations of the tenants,
Those FeatureFlag-bearing workers of the cloud,
Who strive to harness the power of AutomationState.

Why

How

🤖 Generated by Copilot at bb6cce0

  • Import AutomationState enum to use for automation state checks and updates (link)
  • Import FeatureFlag and PLAN_LIMITS constants to use for enforcing plan limits on active automations (link)
  • Count existing active automations in the current tenant using findAndCountAll method and store in existingActiveAutomations variable (link)
  • Set state property of new automation to AutomationState.DISABLED if plan limit is reached (link)
  • Throw error if updating automation to AutomationState.ACTIVE would exceed plan limit (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@yeganathan18 yeganathan18 added the Improvement Created by Linear-GitHub Sync label Oct 6, 2023
@yeganathan18 yeganathan18 merged commit a06d391 into main Oct 9, 2023
7 checks passed
@yeganathan18 yeganathan18 deleted the automation-limit branch October 9, 2023 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants