Skip to content

Commit 60ec6ef

Browse files
committed
Rename file
1 parent 501b52f commit 60ec6ef

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

src/components/engagement/workflow/engagement-workflow.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import { defineContext, defineWorkflow } from '../../workflow/define-workflow';
22
import { TransitionType as Type } from '../../workflow/dto';
33
import { EngagementStatus as Status } from '../dto';
44
import { EngagementWorkflowEvent } from './dto';
5-
import {
6-
BackTo,
7-
BackToActive,
8-
ResolveEngagementParams,
9-
} from './transitions/dynamic-step';
5+
import { BackTo, BackToActive } from './transitions/back';
6+
import { EngagementWorkflowContext } from './transitions/context';
107

118
// This also controls the order shown in the UI.
129
// Therefore, these should generally flow down.
@@ -16,7 +13,7 @@ export const EngagementWorkflow = defineWorkflow({
1613
name: 'Engagement',
1714
states: Status,
1815
event: EngagementWorkflowEvent,
19-
context: defineContext<ResolveEngagementParams>,
16+
context: defineContext<EngagementWorkflowContext>,
2017
})({
2118
Reject: {
2219
from: Status.InDevelopment,

src/components/engagement/workflow/transitions/dynamic-step.ts renamed to src/components/engagement/workflow/transitions/back.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
import { ModuleRef } from '@nestjs/core';
21
import { DynamicState } from '../../../workflow/transitions/dynamic-state';
3-
import {
4-
Engagement,
5-
EngagementStatus,
6-
EngagementStatus as Step,
7-
} from '../../dto';
2+
import { EngagementStatus, EngagementStatus as Step } from '../../dto';
83
import { EngagementWorkflowRepository } from '../engagement-workflow.repository';
9-
10-
export interface ResolveEngagementParams {
11-
engagement: Engagement;
12-
moduleRef: ModuleRef;
13-
migrationPrevStates?: EngagementStatus[];
14-
}
4+
import { EngagementWorkflowContext } from './context';
155

166
export const BackTo = (
177
...states: EngagementStatus[]
18-
): DynamicState<Step, ResolveEngagementParams> => ({
8+
): DynamicState<Step, EngagementWorkflowContext> => ({
199
description: 'Back',
2010
relatedStates: states,
2111
async resolve({ engagement, moduleRef, migrationPrevStates }) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ModuleRef } from '@nestjs/core';
2+
import { Engagement, EngagementStatus } from '../../dto';
3+
4+
export interface EngagementWorkflowContext {
5+
engagement: Engagement;
6+
moduleRef: ModuleRef;
7+
migrationPrevStates?: EngagementStatus[];
8+
}

0 commit comments

Comments
 (0)