Skip to content

Commit 490360a

Browse files
author
Andre Turner
committed
Engagement workflow dto files
1 parent b37106e commit 490360a

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { ObjectType } from '@nestjs/graphql';
2+
import { keys as keysOf } from 'ts-transformer-keys';
3+
import { SecuredProps } from '~/common';
4+
//import { e } from '~/core/edgedb';
5+
//import { RegisterResource } from '~/core/resources';
6+
import { WorkflowEvent } from '../../../workflow/dto';
7+
import { EngagementStatus, IEngagement } from '../../dto';
8+
import { EngagementWorkflowTransition } from './engagement-workflow-transition.dto';
9+
10+
//@RegisterResource({ db: e.Project.WorkflowEvent })
11+
@ObjectType()
12+
export abstract class EngagementWorkflowEvent extends WorkflowEvent(
13+
EngagementStatus,
14+
EngagementWorkflowTransition,
15+
) {
16+
static readonly Props = keysOf<EngagementWorkflowEvent>();
17+
static readonly SecuredProps =
18+
keysOf<SecuredProps<EngagementWorkflowEvent>>();
19+
static readonly BaseNodeProps = WorkflowEvent.BaseNodeProps;
20+
static readonly ConfirmThisClassPassesSensitivityToPolicies = true;
21+
22+
readonly engagement: Pick<IEngagement, 'id'>;
23+
}
24+
25+
declare module '~/core/resources/map' {
26+
interface ResourceMap {
27+
EngagementWorkflowEvent: typeof EngagementWorkflowEvent;
28+
}
29+
// interface ResourceDBMap {
30+
// ProjectWorkflowEvent: typeof e.Project.WorkflowEvent;
31+
// }
32+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ObjectType } from '@nestjs/graphql';
2+
import { WorkflowTransition } from '../../../workflow/dto';
3+
import { EngagementStatus } from '../../dto';
4+
5+
@ObjectType('EngagementStatusTransition', {
6+
description: WorkflowTransition.descriptionFor('engagement'),
7+
})
8+
export abstract class EngagementWorkflowTransition extends WorkflowTransition(
9+
EngagementStatus,
10+
) {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { InputType } from '@nestjs/graphql';
2+
import { ID, IdField } from '~/common';
3+
import { ExecuteTransitionInput } from '../../../workflow/dto';
4+
import { EngagementStatus } from '../../dto';
5+
6+
@InputType()
7+
export abstract class ExecuteEngagementTransitionInput extends ExecuteTransitionInput(
8+
EngagementStatus,
9+
) {
10+
@IdField({
11+
description: 'The engagement ID to transition',
12+
})
13+
readonly engagement: ID;
14+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './execute-engagement-transition.input';
2+
export * from './engagement-workflow-event.dto';
3+
export * from './engagement-workflow-transition.dto';

0 commit comments

Comments
 (0)