import { get, set } from '@dikolab/private-parts'; import { UsecaseSymbol } from '../../symbol/classes/usecase-symbol.class'; import { USECASE_TYPE } from '../../utils/constants/symbol-tag.constant'; import { BOUNDARY_KEY, GOAL_KEY, HANDLER_KEY, ROLES_KEY, TITLE_KEY, } from '../../utils/constants/symbol-keys.constant'; import type { UsecaseModel } from '../types/usecase-model.interface'; import type { AnyGoal } from '../../goal/types/utility.type'; import type { GoalBoundary } from '../../goal/types/goal-boundary.type'; import type { AnyRole } from '../../actor/types/utility.type'; import type { UsecaseTitleFrom } from '../types/usecase-title-from.type'; import { createUsecaseTitle } from '../functions/create-usecase-title.function'; import { getSymbolName } from '../../symbol/functions/get-symbol-name.function'; import type { AnyFunction } from '../../utils/types/utility.type'; import { MOCK_HANDLER_KEY } from '../../utils/constants/symbol-keys.constant'; import type { UsecaseEventMap } from '../types/usecase-event-map.type'; /** * Represents a use case that maps roles, a goal, * and a handler into an executable action */ export class Usecase< Title extends string, Roles extends readonly AnyRole[], Handler extends AnyFunction, Goal extends AnyGoal, > extends UsecaseSymbol< typeof USECASE_TYPE, UsecaseTitleFrom