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

6658 workflows add a first twenty piece email sender #6965

Merged
merged 24 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Code review return: fix factory naming
  • Loading branch information
martmull committed Sep 11, 2024
commit fa03414a7d07b62f193769dbd8efb9da339a9d18
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from 'src/modules/workflow/workflow-step-executor/workflow-step-executor.exception';

@Injectable()
export class CodeActionExecutorFactory {
export class CodeWorkflowStepExecutor {
constructor(
private readonly serverlessFunctionService: ServerlessFunctionService,
private readonly scopedWorkspaceContextFactory: ScopedWorkspaceContextFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { EnvironmentService } from 'src/engine/integrations/environment/environm
import { EmailService } from 'src/engine/integrations/email/email.service';

@Injectable()
export class SendEmailActionExecutorFactory {
private readonly logger = new Logger(SendEmailActionExecutorFactory.name);
export class SendEmailWorkflowStepExecutor {
private readonly logger = new Logger(SendEmailWorkflowStepExecutor.name);
constructor(
private readonly environmentService: EnvironmentService,
private readonly emailService: EmailService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import {
WorkflowStepExecutorExceptionCode,
} from 'src/modules/workflow/workflow-step-executor/workflow-step-executor.exception';
import { WorkflowStepExecutor } from 'src/modules/workflow/workflow-step-executor/workflow-step-executor.interface';
import { CodeActionExecutorFactory } from 'src/modules/workflow/workflow-step-executor/factories/code-action-executor.factory';
import { SendEmailActionExecutorFactory } from 'src/modules/workflow/workflow-step-executor/factories/send-email-action-executor.factory';
import { CodeWorkflowStepExecutor } from 'src/modules/workflow/workflow-step-executor/factories/code.workflow-step-executor';
import { SendEmailWorkflowStepExecutor } from 'src/modules/workflow/workflow-step-executor/factories/send-email.workflow-step-executor';

@Injectable()
export class WorkflowStepExecutorFactory {
constructor(
private readonly codeActionExecutor: CodeActionExecutorFactory,
private readonly sendEmailActionExecutor: SendEmailActionExecutorFactory,
private readonly codeWorkflowStepExecutor: CodeWorkflowStepExecutor,
private readonly sendEmailWorkflowStepExecutor: SendEmailWorkflowStepExecutor,
) {}

get(stepType: WorkflowStepType): WorkflowStepExecutor {
switch (stepType) {
case WorkflowStepType.CODE_ACTION:
return this.codeActionExecutor;
return this.codeWorkflowStepExecutor;
case WorkflowStepType.SEND_EMAIL_ACTION:
return this.sendEmailActionExecutor;
return this.sendEmailWorkflowStepExecutor;
default:
throw new WorkflowStepExecutorException(
`Workflow step executor not found for step type '${stepType}'`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { Module } from '@nestjs/common';
import { ServerlessFunctionModule } from 'src/engine/metadata-modules/serverless-function/serverless-function.module';
import { ScopedWorkspaceContextFactory } from 'src/engine/twenty-orm/factories/scoped-workspace-context.factory';
import { WorkflowStepExecutorFactory } from 'src/modules/workflow/workflow-step-executor/workflow-step-executor.factory';
import { CodeActionExecutorFactory } from 'src/modules/workflow/workflow-step-executor/factories/code-action-executor.factory';
import { SendEmailActionExecutorFactory } from 'src/modules/workflow/workflow-step-executor/factories/send-email-action-executor.factory';
import { CodeWorkflowStepExecutor } from 'src/modules/workflow/workflow-step-executor/factories/code.workflow-step-executor';
import { SendEmailWorkflowStepExecutor } from 'src/modules/workflow/workflow-step-executor/factories/send-email.workflow-step-executor';

@Module({
imports: [ServerlessFunctionModule],
providers: [
WorkflowStepExecutorFactory,
CodeActionExecutorFactory,
SendEmailActionExecutorFactory,
CodeWorkflowStepExecutor,
SendEmailWorkflowStepExecutor,
ScopedWorkspaceContextFactory,
],
exports: [WorkflowStepExecutorFactory],
Expand Down
Loading