File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
components/progress-report/workflow Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
- import { mapValues } from '@seedcompany/common' ;
1
+ import { entries , mapValues } from '@seedcompany/common' ;
2
+ import { EnumType , makeEnum } from '@seedcompany/nest' ;
2
3
import { createHash } from 'crypto' ;
3
4
import { ID , Many , maybeMany , Role } from '~/common' ;
4
5
import { TransitionType as Type } from '../../workflow/dto' ;
@@ -90,7 +91,8 @@ type TransitionInput = Omit<PublicTransition, 'id'> & {
90
91
} ;
91
92
} ;
92
93
93
- export type TransitionName = keyof typeof Transitions ;
94
+ export type TransitionName = EnumType < typeof TransitionName > ;
95
+ export const TransitionName = makeEnum ( entries ( Transitions ) . map ( ( [ k ] ) => k ) ) ;
94
96
95
97
export interface InternalTransition extends PublicTransition {
96
98
id : ID ;
Original file line number Diff line number Diff line change @@ -9,12 +9,11 @@ import { Duration, DurationLike } from 'luxon';
9
9
import { nanoid } from 'nanoid' ;
10
10
import { Config as Neo4JDriverConfig } from 'neo4j-driver' ;
11
11
import { BehaviorSubject } from 'rxjs' ;
12
- import { keys as keysOf } from 'ts-transformer-keys' ;
13
12
import { Class , Merge , ReadonlyDeep } from 'type-fest' ;
14
13
import { ID } from '~/common' ;
15
14
import { parseUri } from '../../components/file/bucket/parse-uri' ;
16
15
import { ProgressReportStatus } from '../../components/progress-report/dto/progress-report-status.enum' ;
17
- import type { TransitionName as ProgressReportTransitionName } from '../../components/progress-report/workflow/transitions' ;
16
+ import { TransitionName as ProgressReportTransitionName } from '../../components/progress-report/workflow/transitions' ;
18
17
import { DefaultTimezoneWrapper } from '../email/templates/formatted-date-time' ;
19
18
import { FrontendUrlWrapper } from '../email/templates/frontend-url' ;
20
19
import type { CookieOptions , CorsOptions , IRequest } from '../http' ;
@@ -133,7 +132,7 @@ export const makeConfig = (env: EnvironmentService) =>
133
132
notifyExtraEmails : {
134
133
forTransitions : env
135
134
. map ( 'PROGRESS_REPORT_EMAILS_FOR_TRANSITIONS' , {
136
- parseKey : keysOf < Record < ProgressReportTransitionName , '' > > ( ) ,
135
+ parseKey : ProgressReportTransitionName ,
137
136
parseValue : csv ,
138
137
} )
139
138
. optional ( { } ) ,
You can’t perform that action at this time.
0 commit comments