mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-09-03 09:10:51 +02:00
20 lines
646 B
TypeScript
20 lines
646 B
TypeScript
import { Service } from 'typedi';
|
|
|
|
import type { User } from '@/databases/entities/user';
|
|
import { WorkflowStatisticsRepository } from '@/databases/repositories/workflow-statistics.repository';
|
|
|
|
@Service()
|
|
export class CtaService {
|
|
constructor(private readonly workflowStatisticsRepository: WorkflowStatisticsRepository) {}
|
|
|
|
async getBecomeCreatorCta(userId: User['id']) {
|
|
// There need to be at least 3 workflows with at least 5 executions
|
|
const numWfsWithOver5ProdExecutions =
|
|
await this.workflowStatisticsRepository.queryNumWorkflowsUserHasWithFiveOrMoreProdExecs(
|
|
userId,
|
|
);
|
|
|
|
return numWfsWithOver5ProdExecutions >= 3;
|
|
}
|
|
}
|