Skip to content

Commit

Permalink
Work around needing engagement.project.step for migration
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonF committed Jul 9, 2024
1 parent 9e035ce commit 3d6e58c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { ModuleRef } from '@nestjs/core';
import { node, relation } from 'cypher-query-builder';
import { chunk } from 'lodash';
import { DateTime } from 'luxon';
import { Disabled, ID } from '~/common';
import { ID } from '~/common';
import { BaseMigration, Migration } from '~/core/database';
import { ACTIVE, variable } from '~/core/database/query';
import { SystemAgentRepository } from '../../../user/system-agent.repository';
import { Engagement, EngagementStatus } from '../../dto';
import { EngagementWorkflowRepository } from '../engagement-workflow.repository';
import { EngagementWorkflowService } from '../engagement-workflow.service';

@Disabled('Until Carson reviews')(Migration('2024-07-05T09:00:02'))
@Migration('2024-07-05T09:00:02')
export class EngagementStatusHistoryToWorkflowEventsMigration extends BaseMigration {
constructor(
private readonly agents: SystemAgentRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ export const ProjectStep = (...steps: Step[]): Condition => {
[...stepSet].map((step) => Step.entry(step).label).join(' / ');
return {
description,
resolve({ engagement }) {
resolve({ engagement, migrationPrevStates }) {
if (migrationPrevStates) {
// Skip for migration, since it is easier and not applicable for historic data in current use.
return { status: 'ENABLED' };
}
return {
status: steps.includes(engagement.project.step)
? 'ENABLED'
Expand Down

0 comments on commit 3d6e58c

Please sign in to comment.