Skip to content

Commit d5f1ff8

Browse files
committed
Work around needing engagement.project.step for migration
1 parent 17a71fb commit d5f1ff8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/components/engagement/workflow/migrations/engagement-status-history-to-workflow-events.migration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { ModuleRef } from '@nestjs/core';
22
import { node, relation } from 'cypher-query-builder';
33
import { chunk } from 'lodash';
44
import { DateTime } from 'luxon';
5-
import { Disabled, ID } from '~/common';
5+
import { ID } from '~/common';
66
import { BaseMigration, Migration } from '~/core/database';
77
import { ACTIVE, variable } from '~/core/database/query';
88
import { SystemAgentRepository } from '../../../user/system-agent.repository';
99
import { Engagement, EngagementStatus } from '../../dto';
1010
import { EngagementWorkflowRepository } from '../engagement-workflow.repository';
1111
import { EngagementWorkflowService } from '../engagement-workflow.service';
1212

13-
@Disabled('Until Carson reviews')(Migration('2024-07-05T09:00:02'))
13+
@Migration('2024-07-05T09:00:02')
1414
export class EngagementStatusHistoryToWorkflowEventsMigration extends BaseMigration {
1515
constructor(
1616
private readonly agents: SystemAgentRepository,

src/components/engagement/workflow/transitions/project-step.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export const ProjectStep = (...steps: Step[]): Condition => {
1212
[...stepSet].map((step) => Step.entry(step).label).join(' / ');
1313
return {
1414
description,
15-
resolve({ engagement }) {
15+
resolve({ engagement, migrationPrevStates }) {
16+
if (migrationPrevStates) {
17+
// Skip for migration, since it is easier and not applicable for historic data in current use.
18+
return { status: 'ENABLED' };
19+
}
1620
return {
1721
status: steps.includes(engagement.project.step)
1822
? 'ENABLED'

0 commit comments

Comments
 (0)