Skip to content

Commit 6e285d3

Browse files
committed
Remove old defineTransitions
1 parent dc4f011 commit 6e285d3

File tree

1 file changed

+1
-18
lines changed
  • src/components/workflow/transitions

1 file changed

+1
-18
lines changed

src/components/workflow/transitions/types.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { many, mapValues, setOf } from '@seedcompany/common';
21
import { Merge } from 'type-fest';
3-
import * as uuid from 'uuid';
4-
import { ID, Many, maybeMany } from '~/common';
2+
import { ID, Many } from '~/common';
53
import { WorkflowTransition as PublicTransition } from '../dto/workflow-transition.dto';
64
import { TransitionCondition } from './conditions';
75
import { DynamicState } from './dynamic-state';
@@ -32,18 +30,3 @@ export type InternalTransition<
3230
notifiers?: ReadonlyArray<TransitionNotifier<Context>>;
3331
}>
3432
>;
35-
36-
export const defineTransitions =
37-
<State extends string, Context>(options: { namespaceId: string }) =>
38-
<Names extends string>(obj: Record<Names, TransitionInput<State, Context>>) =>
39-
mapValues(
40-
obj,
41-
(name, transition): InternalTransition<State, Names, Context> => ({
42-
name: name,
43-
...transition,
44-
from: transition.from ? setOf(many(transition.from)) : undefined,
45-
key: (transition.key ?? uuid.v5(name, options.namespaceId)) as ID,
46-
conditions: maybeMany(transition.conditions),
47-
notifiers: maybeMany(transition.notifiers),
48-
}),
49-
).asRecord;

0 commit comments

Comments
 (0)