Skip to content

Commit adf37e9

Browse files
committed
Fix engagement status sync to consider specific steps before statuses
EarlyConversations -> FinalizingCompletion should change the engagement to FinalizingCompletion, even though the status just became Active.
1 parent 80c40ba commit adf37e9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/components/engagement/handlers/update-engagement-status.handler.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,10 @@ import { EngagementRepository } from '../engagement.repository';
1414
import { EngagementService } from '../engagement.service';
1515

1616
const changes: Change[] = [
17-
{
18-
to: { status: ProjectStatus.Active },
19-
newStatus: EngagementStatus.Active,
20-
},
2117
{
2218
to: { step: ProjectStep.ActiveChangedPlan },
2319
newStatus: EngagementStatus.ActiveChangedPlan,
2420
},
25-
{
26-
from: { status: ProjectStatus.Active },
27-
to: { status: ProjectStatus.InDevelopment },
28-
newStatus: EngagementStatus.InDevelopment,
29-
},
3021
{
3122
to: { step: ProjectStep.DiscussingChangeToPlan },
3223
newStatus: EngagementStatus.DiscussingChangeToPlan,
@@ -63,6 +54,15 @@ const changes: Change[] = [
6354
to: { step: ProjectStep.Terminated },
6455
newStatus: EngagementStatus.Terminated,
6556
},
57+
{
58+
to: { status: ProjectStatus.Active },
59+
newStatus: EngagementStatus.Active,
60+
},
61+
{
62+
from: { status: ProjectStatus.Active },
63+
to: { status: ProjectStatus.InDevelopment },
64+
newStatus: EngagementStatus.InDevelopment,
65+
},
6666
];
6767

6868
type Change = RequireAtLeastOne<{ from: Condition; to: Condition }> & {

0 commit comments

Comments
 (0)