From 3cae26dcb32f1891342520280cc4163589d34a0b Mon Sep 17 00:00:00 2001 From: Michael L Haufe Date: Sun, 23 Jun 2024 22:15:56 +0000 Subject: [PATCH] - Migrated data layer from localStorage to PGLite - Implemented data migrations - refactored Use Case classes to Interactor Classes - Swapped inheritence model of Actor <-> Component - Added database debuggin page --- .devcontainer/devcontainer.json | 13 +- app.config.ts | 1 - app.vue | 6 + application/ComponentInteractor.ts | 4 + application/Interactor.ts | 21 +- application/Mapper.ts | 3 - application/Repository.ts | 56 +- application/SlugRepository.ts | 6 - application/UserStoryInteractor.ts | 4 + data/ComponentRepository.ts | 6 + data/Migration.ts | 14 + data/MigrationManager.ts | 79 + data/PGLiteRepository.ts | 84 +- data/StorageRepository.ts | 82 - data/UserStoryRepository.ts | 8 + data/migrations/00001-InitDatabase.ts | 211 +++ domain/Actor.ts | 4 +- domain/Component.ts | 14 +- domain/Requirement.ts | 8 +- {modules/system/domain => domain}/Scenario.ts | 2 +- .../system/domain => domain}/UserStory.ts | 17 +- index.d.ts | 3 - mappers/EntityToJsonMapper.ts | 34 - mappers/PEGSToJsonMapper.ts | 28 - mappers/RequirementToJsonMapper.ts | 30 - .../application/AssumptionInteractor.ts | 4 + .../ConstraintCategoryInteractor.ts | 4 + .../application/ConstraintInteractor.ts | 4 + .../application/CreateAssumptionUseCase.ts | 35 - .../application/CreateConstraintUseCase.ts | 36 - .../application/CreateEffectUseCase.ts | 35 - .../CreateEnvironmentComponentUseCase.ts | 35 - .../application/CreateEnvironmentUseCase.ts | 24 - .../application/CreateGlossaryTermUseCase.ts | 35 - .../application/CreateInvariantUseCase.ts | 35 - .../application/DeleteAssumptionUseCase.ts | 29 - .../application/DeleteConstraintUseCase.ts | 29 - .../application/DeleteEffectUseCase.ts | 29 - .../DeleteEnvironmentComponentUseCase.ts | 29 - .../application/DeleteGlossaryTermUseCase.ts | 29 - .../application/DeleteInvariantUseCase.ts | 29 - .../application/EffectInteractor.ts | 4 + .../application/GetAssumptionsUseCase.ts | 16 - .../application/GetConstraintsUseCase.ts | 16 - .../application/GetEffectsUseCase.ts | 16 - .../GetEnvironmentBySolutionIdUseCase.ts | 16 - .../GetEnvironmentComponentsUseCase.ts | 16 - .../application/GetGlossaryTermsUseCase.ts | 16 - .../application/GetInvariantsUseCase.ts | 16 - .../application/GlossaryTermInteractor.ts | 4 + .../application/InvariantInteractor.ts | 4 + .../application/UpdateAssumptionUseCase.ts | 22 - .../application/UpdateConstraintUseCase.ts | 22 - .../application/UpdateEffectUseCase.ts | 22 - .../UpdateEnvironmentComponentUseCase.ts | 22 - .../application/UpdateGlossaryTermUseCase.ts | 22 - .../application/UpdateInvariantUseCase.ts | 22 - .../environment/data/AssumptionRepository.ts | 18 +- .../data/ConstraintCategoryRepository.ts | 6 + .../environment/data/ConstraintRepository.ts | 18 +- modules/environment/data/EffectRepository.ts | 18 +- .../data/EnvironmentComponentRepository.ts | 16 - .../environment/data/EnvironmentRepository.ts | 16 - .../data/GlossaryTermRepository.ts | 18 +- .../environment/data/InvariantRepository.ts | 18 +- modules/environment/domain/Constraint.ts | 16 +- .../environment/domain/ConstraintCategory.ts | 15 + modules/environment/domain/Environment.ts | 25 - .../domain/EnvironmentComponent.ts | 3 - .../mappers/AssumptionToJsonMapper.ts | 14 - .../mappers/ConstraintToJsonMapper.ts | 19 - .../environment/mappers/EffectToJsonMapper.ts | 14 - .../EnvironmentComponentToJsonMapper.ts | 14 - .../mappers/EnvironmentToJsonMapper.ts | 39 - .../mappers/GlossaryTermToJsonMapper.ts | 16 - .../mappers/InvariantToJsonMapper.ts | 14 - modules/environment/ui/pages/Assumptions.vue | 59 +- modules/environment/ui/pages/Components.vue | 62 +- modules/environment/ui/pages/Constraints.vue | 80 +- modules/environment/ui/pages/Effects.vue | 57 +- modules/environment/ui/pages/Glossary.vue | 58 +- modules/environment/ui/pages/Index.vue | 37 +- modules/environment/ui/pages/Invariants.vue | 57 +- .../goals/application/CreateGoalsUseCase.ts | 23 - .../goals/application/CreateLimitUseCase.ts | 38 - .../goals/application/CreateMissionUseCase.ts | 33 - .../application/CreateObstacleUseCase.ts | 38 - .../goals/application/CreateOutcomeUseCase.ts | 38 - .../application/CreateStakeholderUseCase.ts | 41 - .../goals/application/DeleteLimitUseCase.ts | 25 - .../application/DeleteObstacleUseCase.ts | 25 - .../goals/application/DeleteOutcomeUseCase.ts | 25 - .../application/DeleteStakeholderUseCase.ts | 25 - modules/goals/application/EpicInteractor.ts | 47 - .../GetGoalsBySolutionIdUseCase.ts | 16 - modules/goals/application/GetGoalsUseCase.ts | 14 - modules/goals/application/GetLimitsUseCase.ts | 14 - .../goals/application/GetObstaclesUseCase.ts | 14 - .../goals/application/GetOutcomesUseCase.ts | 14 - .../goals/application/GetRationaleUseCase.ts | 35 - .../application/GetStakeHolderByIdUseCase.ts | 14 - .../application/GetStakeHoldersUseCase.ts | 14 - modules/goals/application/GoalInteractor.ts | 4 + modules/goals/application/LimitInteractor.ts | 4 + .../goals/application/ObstacleInteractor.ts | 4 + .../goals/application/OutcomeInteractor.ts | 4 + .../StakeholderCategoryInteractor.ts | 4 + .../application/StakeholderInteractor.ts | 4 + .../StakeholderSegmentationInteractor.ts | 4 + .../goals/application/UpdateLimitUseCase.ts | 22 - .../application/UpdateObstacleUseCase.ts | 22 - .../goals/application/UpdateOutcomeUseCase.ts | 24 - .../application/UpdateRationaleUseCase.ts | 100 - .../application/UpdateStakeHolderUseCase.ts | 23 - modules/goals/data/EpicRepository.ts | 16 - modules/goals/data/GoalRepository.ts | 18 +- modules/goals/data/GoalsRepository.ts | 16 - modules/goals/data/LimitRepository.ts | 19 +- modules/goals/data/ObstacleRepository.ts | 18 +- modules/goals/data/OutcomeRepository.ts | 18 +- .../data/StakeholderCategoryRepository.ts | 6 + modules/goals/data/StakeholderRepository.ts | 18 +- .../data/StakeholderSegmentationRepository.ts | 6 + modules/goals/domain/Epic.ts | 6 - {domain => modules/goals/domain}/Limit.ts | 2 +- modules/goals/domain/Stakeholder.ts | 40 +- modules/goals/domain/StakeholderCategory.ts | 14 + .../goals/domain/StakeholderSegmentation.ts | 14 + modules/goals/index.ts | 6 +- modules/goals/mappers/EpicToJsonMapper.ts | 16 - modules/goals/mappers/GoalToJsonMapper.ts | 16 - modules/goals/mappers/GoalsToJsonMapper.ts | 37 - modules/goals/mappers/LimitToJsonMapper.ts | 15 - modules/goals/mappers/ObstacleToJsonMapper.ts | 16 - modules/goals/mappers/OutcomeToJsonMapper.ts | 17 - .../goals/mappers/StakeholderToJsonMapper.ts | 28 - modules/goals/ui/pages/Epics.vue | 147 -- modules/goals/ui/pages/Index.vue | 40 +- modules/goals/ui/pages/Limitations.vue | 54 +- modules/goals/ui/pages/Obstacles.vue | 55 +- modules/goals/ui/pages/Outcomes.vue | 55 +- modules/goals/ui/pages/Rationale.vue | 93 +- modules/goals/ui/pages/Scenarios.vue | 161 ++ modules/goals/ui/pages/Stakeholders.vue | 152 +- .../application/CreatePersonUseCase.ts | 26 - .../application/CreateProjectUseCase.ts | 19 - .../application/DeletePersonUseCase.ts | 14 - .../application/GetPersonnelUseCase.ts | 14 - .../GetProjectBySolutionIdUseCase.ts | 16 - .../project/application/PersonInteractor.ts | 4 + .../application/UpdatePersonUseCase.ts | 26 - modules/project/data/PersonRepository.ts | 18 +- modules/project/data/ProjectRepository.ts | 16 - modules/project/domain/Person.ts | 5 +- modules/project/domain/Project.ts | 7 - modules/project/mappers/PersonToJsonMapper.ts | 31 - .../project/mappers/ProjectToJsonMapper.ts | 23 - modules/project/ui/pages/Index.vue | 38 +- modules/project/ui/pages/RolesPersonnel.vue | 76 +- .../application/CreateSolutionUseCase.ts | 26 - .../application/DeleteSolutionUseCase.ts | 19 - .../application/GetAllSolutionsUseCase.ts | 11 - .../application/GetSolutionByIdUseCase.ts | 12 - .../application/GetSolutionBySlugUseCase.ts | 11 - .../application/SolutionInteractor.ts | 4 + .../application/UpdateSolutionUseCase.ts | 20 - modules/solution/data/SolutionRepository.ts | 41 +- modules/solution/domain/Solution.ts | 20 +- .../solution/mappers/SolutionToJsonMapper.ts | 33 - .../ui/pages/solution/[solutionSlug].vue | 10 +- .../solution/ui/pages/solution/edit-entry.vue | 19 +- modules/solution/ui/pages/solution/index.vue | 18 +- .../solution/ui/pages/solution/new-entry.vue | 19 +- .../CreateSystemComponentUseCase.ts | 24 - .../system/application/CreateSystemUseCase.ts | 19 - .../DeleteSystemComponentUseCase.ts | 19 - .../FunctionalBehaviorInteractor.ts | 4 + .../FunctionalRequirementInteractor.ts | 45 - .../GetSystemBySolutionIdUseCase.ts | 16 - .../application/GetSystemComponentsUseCase.ts | 16 - .../NonFunctionalBehaviorInteractor.ts | 4 + .../NonFunctionalRequirementInteractor.ts | 45 - .../UpdateSystemComponentUseCase.ts | 22 - .../system/application/UseCaseInteractor.ts | 63 +- .../system/application/UserStoryInteractor.ts | 47 - .../data/FunctionalBehaviorRepository.ts | 8 + .../data/FunctionalRequirementRepository.ts | 16 - .../data/NonFunctionalBehaviorRepository.ts | 8 + .../NonFunctionalRequirementRepository.ts | 16 - .../system/data/SystemComponentRepository.ts | 16 - modules/system/data/SystemRepository.ts | 16 - modules/system/data/UseCaseRepository.ts | 18 +- modules/system/data/UserStoryRepository.ts | 16 - modules/system/domain/Behavior.ts | 11 +- ...alRequirement.ts => FunctionalBehavior.ts} | 2 +- .../system/domain/NonFunctionalBehavior.ts | 3 + .../system/domain/NonFunctionalRequirement.ts | 4 - modules/system/domain/System.ts | 9 - modules/system/domain/SystemComponent.ts | 13 - modules/system/domain/UseCase.ts | 11 +- .../FunctionalRequirementToJsonMapper.ts | 30 - .../NonFunctionalRequirementToJsonMapper.ts | 30 - .../system/mappers/ScenarioToJsonMapper.ts | 20 - .../mappers/SystemComponentToJsonMapper.ts | 23 - modules/system/mappers/SystemToJsonMapper.ts | 25 - modules/system/mappers/UseCaseToJsonMapper.ts | 36 - .../system/mappers/UserStoryToJsonMapper.ts | 22 - modules/system/ui/pages/Components.vue | 72 +- modules/system/ui/pages/Functionality.vue | 124 +- modules/system/ui/pages/Index.vue | 34 +- modules/system/ui/pages/Scenarios.vue | 179 +- nuxt.config.ts | 2 +- package-lock.json | 1643 +++++++++-------- package.json | 11 +- pages/db-debug.vue | 83 + pages/settings.vue | 8 +- 216 files changed, 2442 insertions(+), 4960 deletions(-) create mode 100644 application/ComponentInteractor.ts delete mode 100644 application/SlugRepository.ts create mode 100644 application/UserStoryInteractor.ts create mode 100644 data/ComponentRepository.ts create mode 100644 data/Migration.ts create mode 100644 data/MigrationManager.ts delete mode 100644 data/StorageRepository.ts create mode 100644 data/UserStoryRepository.ts create mode 100644 data/migrations/00001-InitDatabase.ts rename {modules/system/domain => domain}/Scenario.ts (88%) rename {modules/system/domain => domain}/UserStory.ts (53%) delete mode 100644 mappers/EntityToJsonMapper.ts delete mode 100644 mappers/PEGSToJsonMapper.ts delete mode 100644 mappers/RequirementToJsonMapper.ts create mode 100644 modules/environment/application/AssumptionInteractor.ts create mode 100644 modules/environment/application/ConstraintCategoryInteractor.ts create mode 100644 modules/environment/application/ConstraintInteractor.ts delete mode 100644 modules/environment/application/CreateAssumptionUseCase.ts delete mode 100644 modules/environment/application/CreateConstraintUseCase.ts delete mode 100644 modules/environment/application/CreateEffectUseCase.ts delete mode 100644 modules/environment/application/CreateEnvironmentComponentUseCase.ts delete mode 100644 modules/environment/application/CreateEnvironmentUseCase.ts delete mode 100644 modules/environment/application/CreateGlossaryTermUseCase.ts delete mode 100644 modules/environment/application/CreateInvariantUseCase.ts delete mode 100644 modules/environment/application/DeleteAssumptionUseCase.ts delete mode 100644 modules/environment/application/DeleteConstraintUseCase.ts delete mode 100644 modules/environment/application/DeleteEffectUseCase.ts delete mode 100644 modules/environment/application/DeleteEnvironmentComponentUseCase.ts delete mode 100644 modules/environment/application/DeleteGlossaryTermUseCase.ts delete mode 100644 modules/environment/application/DeleteInvariantUseCase.ts create mode 100644 modules/environment/application/EffectInteractor.ts delete mode 100644 modules/environment/application/GetAssumptionsUseCase.ts delete mode 100644 modules/environment/application/GetConstraintsUseCase.ts delete mode 100644 modules/environment/application/GetEffectsUseCase.ts delete mode 100644 modules/environment/application/GetEnvironmentBySolutionIdUseCase.ts delete mode 100644 modules/environment/application/GetEnvironmentComponentsUseCase.ts delete mode 100644 modules/environment/application/GetGlossaryTermsUseCase.ts delete mode 100644 modules/environment/application/GetInvariantsUseCase.ts create mode 100644 modules/environment/application/GlossaryTermInteractor.ts create mode 100644 modules/environment/application/InvariantInteractor.ts delete mode 100644 modules/environment/application/UpdateAssumptionUseCase.ts delete mode 100644 modules/environment/application/UpdateConstraintUseCase.ts delete mode 100644 modules/environment/application/UpdateEffectUseCase.ts delete mode 100644 modules/environment/application/UpdateEnvironmentComponentUseCase.ts delete mode 100644 modules/environment/application/UpdateGlossaryTermUseCase.ts delete mode 100644 modules/environment/application/UpdateInvariantUseCase.ts create mode 100644 modules/environment/data/ConstraintCategoryRepository.ts delete mode 100644 modules/environment/data/EnvironmentComponentRepository.ts delete mode 100644 modules/environment/data/EnvironmentRepository.ts create mode 100644 modules/environment/domain/ConstraintCategory.ts delete mode 100644 modules/environment/domain/Environment.ts delete mode 100644 modules/environment/domain/EnvironmentComponent.ts delete mode 100644 modules/environment/mappers/AssumptionToJsonMapper.ts delete mode 100644 modules/environment/mappers/ConstraintToJsonMapper.ts delete mode 100644 modules/environment/mappers/EffectToJsonMapper.ts delete mode 100644 modules/environment/mappers/EnvironmentComponentToJsonMapper.ts delete mode 100644 modules/environment/mappers/EnvironmentToJsonMapper.ts delete mode 100644 modules/environment/mappers/GlossaryTermToJsonMapper.ts delete mode 100644 modules/environment/mappers/InvariantToJsonMapper.ts delete mode 100644 modules/goals/application/CreateGoalsUseCase.ts delete mode 100644 modules/goals/application/CreateLimitUseCase.ts delete mode 100644 modules/goals/application/CreateMissionUseCase.ts delete mode 100644 modules/goals/application/CreateObstacleUseCase.ts delete mode 100644 modules/goals/application/CreateOutcomeUseCase.ts delete mode 100644 modules/goals/application/CreateStakeholderUseCase.ts delete mode 100644 modules/goals/application/DeleteLimitUseCase.ts delete mode 100644 modules/goals/application/DeleteObstacleUseCase.ts delete mode 100644 modules/goals/application/DeleteOutcomeUseCase.ts delete mode 100644 modules/goals/application/DeleteStakeholderUseCase.ts delete mode 100644 modules/goals/application/EpicInteractor.ts delete mode 100644 modules/goals/application/GetGoalsBySolutionIdUseCase.ts delete mode 100644 modules/goals/application/GetGoalsUseCase.ts delete mode 100644 modules/goals/application/GetLimitsUseCase.ts delete mode 100644 modules/goals/application/GetObstaclesUseCase.ts delete mode 100644 modules/goals/application/GetOutcomesUseCase.ts delete mode 100644 modules/goals/application/GetRationaleUseCase.ts delete mode 100644 modules/goals/application/GetStakeHolderByIdUseCase.ts delete mode 100644 modules/goals/application/GetStakeHoldersUseCase.ts create mode 100644 modules/goals/application/GoalInteractor.ts create mode 100644 modules/goals/application/LimitInteractor.ts create mode 100644 modules/goals/application/ObstacleInteractor.ts create mode 100644 modules/goals/application/OutcomeInteractor.ts create mode 100644 modules/goals/application/StakeholderCategoryInteractor.ts create mode 100644 modules/goals/application/StakeholderInteractor.ts create mode 100644 modules/goals/application/StakeholderSegmentationInteractor.ts delete mode 100644 modules/goals/application/UpdateLimitUseCase.ts delete mode 100644 modules/goals/application/UpdateObstacleUseCase.ts delete mode 100644 modules/goals/application/UpdateOutcomeUseCase.ts delete mode 100644 modules/goals/application/UpdateRationaleUseCase.ts delete mode 100644 modules/goals/application/UpdateStakeHolderUseCase.ts delete mode 100644 modules/goals/data/EpicRepository.ts delete mode 100644 modules/goals/data/GoalsRepository.ts create mode 100644 modules/goals/data/StakeholderCategoryRepository.ts create mode 100644 modules/goals/data/StakeholderSegmentationRepository.ts delete mode 100644 modules/goals/domain/Epic.ts rename {domain => modules/goals/domain}/Limit.ts (64%) create mode 100644 modules/goals/domain/StakeholderCategory.ts create mode 100644 modules/goals/domain/StakeholderSegmentation.ts delete mode 100644 modules/goals/mappers/EpicToJsonMapper.ts delete mode 100644 modules/goals/mappers/GoalToJsonMapper.ts delete mode 100644 modules/goals/mappers/GoalsToJsonMapper.ts delete mode 100644 modules/goals/mappers/LimitToJsonMapper.ts delete mode 100644 modules/goals/mappers/ObstacleToJsonMapper.ts delete mode 100644 modules/goals/mappers/OutcomeToJsonMapper.ts delete mode 100644 modules/goals/mappers/StakeholderToJsonMapper.ts delete mode 100644 modules/goals/ui/pages/Epics.vue create mode 100644 modules/goals/ui/pages/Scenarios.vue delete mode 100644 modules/project/application/CreatePersonUseCase.ts delete mode 100644 modules/project/application/CreateProjectUseCase.ts delete mode 100644 modules/project/application/DeletePersonUseCase.ts delete mode 100644 modules/project/application/GetPersonnelUseCase.ts delete mode 100644 modules/project/application/GetProjectBySolutionIdUseCase.ts create mode 100644 modules/project/application/PersonInteractor.ts delete mode 100644 modules/project/application/UpdatePersonUseCase.ts delete mode 100644 modules/project/data/ProjectRepository.ts delete mode 100644 modules/project/domain/Project.ts delete mode 100644 modules/project/mappers/PersonToJsonMapper.ts delete mode 100644 modules/project/mappers/ProjectToJsonMapper.ts delete mode 100644 modules/solution/application/CreateSolutionUseCase.ts delete mode 100644 modules/solution/application/DeleteSolutionUseCase.ts delete mode 100644 modules/solution/application/GetAllSolutionsUseCase.ts delete mode 100644 modules/solution/application/GetSolutionByIdUseCase.ts delete mode 100644 modules/solution/application/GetSolutionBySlugUseCase.ts create mode 100644 modules/solution/application/SolutionInteractor.ts delete mode 100644 modules/solution/application/UpdateSolutionUseCase.ts delete mode 100644 modules/solution/mappers/SolutionToJsonMapper.ts delete mode 100644 modules/system/application/CreateSystemComponentUseCase.ts delete mode 100644 modules/system/application/CreateSystemUseCase.ts delete mode 100644 modules/system/application/DeleteSystemComponentUseCase.ts create mode 100644 modules/system/application/FunctionalBehaviorInteractor.ts delete mode 100644 modules/system/application/FunctionalRequirementInteractor.ts delete mode 100644 modules/system/application/GetSystemBySolutionIdUseCase.ts delete mode 100644 modules/system/application/GetSystemComponentsUseCase.ts create mode 100644 modules/system/application/NonFunctionalBehaviorInteractor.ts delete mode 100644 modules/system/application/NonFunctionalRequirementInteractor.ts delete mode 100644 modules/system/application/UpdateSystemComponentUseCase.ts delete mode 100644 modules/system/application/UserStoryInteractor.ts create mode 100644 modules/system/data/FunctionalBehaviorRepository.ts delete mode 100644 modules/system/data/FunctionalRequirementRepository.ts create mode 100644 modules/system/data/NonFunctionalBehaviorRepository.ts delete mode 100644 modules/system/data/NonFunctionalRequirementRepository.ts delete mode 100644 modules/system/data/SystemComponentRepository.ts delete mode 100644 modules/system/data/SystemRepository.ts delete mode 100644 modules/system/data/UserStoryRepository.ts rename modules/system/domain/{FunctionalRequirement.ts => FunctionalBehavior.ts} (61%) create mode 100644 modules/system/domain/NonFunctionalBehavior.ts delete mode 100644 modules/system/domain/NonFunctionalRequirement.ts delete mode 100644 modules/system/domain/System.ts delete mode 100644 modules/system/domain/SystemComponent.ts delete mode 100644 modules/system/mappers/FunctionalRequirementToJsonMapper.ts delete mode 100644 modules/system/mappers/NonFunctionalRequirementToJsonMapper.ts delete mode 100644 modules/system/mappers/ScenarioToJsonMapper.ts delete mode 100644 modules/system/mappers/SystemComponentToJsonMapper.ts delete mode 100644 modules/system/mappers/SystemToJsonMapper.ts delete mode 100644 modules/system/mappers/UseCaseToJsonMapper.ts delete mode 100644 modules/system/mappers/UserStoryToJsonMapper.ts create mode 100644 pages/db-debug.vue diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 30566964..fbfd8a4e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,17 +1,16 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node { - "name": "Node.js & Python", + "name": "Node.js", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm", // Features to add to the dev container. More info: https://containers.dev/features. - "features": { - "ghcr.io/devcontainers/features/python:1": {} - }, + "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm install && npm install -g editorconfig", + "postCreateCommand": "npm install", + // Configure tool-specific properties. "customizations": { "vscode": { "extensions": [ @@ -22,8 +21,6 @@ ] } } - // Configure tool-specific properties. - // "customizations": {}, // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" } \ No newline at end of file diff --git a/app.config.ts b/app.config.ts index f192bbb5..d6968049 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,5 +1,4 @@ export default defineAppConfig({ darkMode: 'light', - serializationVersion: '0.5.0', connString: 'idb://cathedral' }) diff --git a/app.vue b/app.vue index a96702d9..5a6c7458 100644 --- a/app.vue +++ b/app.vue @@ -1,4 +1,6 @@ - + diff --git a/modules/environment/ui/pages/Effects.vue b/modules/environment/ui/pages/Effects.vue index 3e4462f5..4e757bb4 100644 --- a/modules/environment/ui/pages/Effects.vue +++ b/modules/environment/ui/pages/Effects.vue @@ -2,41 +2,22 @@ import { FilterMatchMode } from 'primevue/api'; import { emptyUuid, type Uuid } from '~/domain/Uuid'; import SolutionRepository from '~/modules/solution/data/SolutionRepository'; -import EnvironmentRepository from '../../data/EnvironmentRepository'; import EffectRepository from '../../data/EffectRepository'; -import GetSolutionBySlugUseCase from '~/modules/solution/application/GetSolutionBySlugUseCase'; -import GetEnvironmentBySolutionIdUseCase from '../../application/GetEnvironmentBySolutionIdUseCase'; -import GetEffectsUseCase from '../../application/GetEffectsUseCase'; -import CreateEffectUseCase from '../../application/CreateEffectUseCase'; -import UpdateEffectUseCase from '../../application/UpdateEffectUseCase'; -import DeleteEffectUseCase from '../../application/DeleteEffectUseCase'; import type Effect from '../../domain/Effect'; +import SolutionInteractor from '~/modules/solution/application/SolutionInteractor'; +import EffectInteractor from '../../application/EffectInteractor'; -useHead({ - title: 'Effects' -}) +useHead({ title: 'Effects' }) const router = useRouter(), route = useRoute(), slug = route.params.solutionSlug as string, - solutionRepository = new SolutionRepository(), - environmentRepository = new EnvironmentRepository(), - effectRepository = new EffectRepository(), - getSolutionBySlugUseCase = new GetSolutionBySlugUseCase(solutionRepository), - solution = await getSolutionBySlugUseCase.execute(slug), - getEnvironmentBySolutionIdUseCase = new GetEnvironmentBySolutionIdUseCase(environmentRepository), - environment = solution?.id && await getEnvironmentBySolutionIdUseCase.execute(solution.id), - getEffectsUseCase = new GetEffectsUseCase(effectRepository), - createEffectUseCase = new CreateEffectUseCase(environmentRepository, effectRepository), - updateEffectUseCase = new UpdateEffectUseCase(effectRepository), - deleteEffectUseCase = new DeleteEffectUseCase(environmentRepository, effectRepository); + solutionInteractor = new SolutionInteractor(new SolutionRepository()), + solution = (await solutionInteractor.getAll({ slug }))[0], + effectInteractor = new EffectInteractor(new EffectRepository()) -if (!solution) { +if (!solution) router.push({ name: 'Solutions' }); -} else { - if (!environment) - router.push({ name: 'Environment', params: { solutionSlug: slug } }); -} type EffectViewModel = Pick; @@ -44,7 +25,7 @@ const effects = ref([]), emptyEffect = { id: emptyUuid, name: '', statement: '' } onMounted(async () => { - effects.value = await getEffectsUseCase.execute(environment!.id) ?? [] + effects.value = await effectInteractor.getAll({ solutionId: solution!.id }) }) const filters = ref({ @@ -53,29 +34,31 @@ const filters = ref({ }); const onCreate = async (data: EffectViewModel) => { - const newId = await createEffectUseCase.execute({ - parentId: environment!.id, - solutionId: solution!.id, + const newId = await effectInteractor.create({ name: data.name, - statement: data.statement + statement: data.statement, + solutionId: solution!.id, + property: '' }) - effects.value = await getEffectsUseCase.execute(environment!.id) ?? [] + effects.value = await effectInteractor.getAll({ solutionId: solution!.id }) } const onUpdate = async (data: EffectViewModel) => { - await updateEffectUseCase.execute({ + await effectInteractor.update({ id: data.id, name: data.name, - statement: data.statement + statement: data.statement, + solutionId: solution!.id, + property: '' }) - effects.value = await getEffectsUseCase.execute(environment!.id) ?? [] + effects.value = await effectInteractor.getAll({ solutionId: solution!.id }) } const onDelete = async (id: Uuid) => { - effects.value = effects.value.filter(o => o.id !== id) - await deleteEffectUseCase.execute(id) + await effectInteractor.delete(id) + effects.value = await effectInteractor.getAll({ solutionId: solution!.id }) } diff --git a/modules/environment/ui/pages/Glossary.vue b/modules/environment/ui/pages/Glossary.vue index 013e5b7a..63828a9e 100644 --- a/modules/environment/ui/pages/Glossary.vue +++ b/modules/environment/ui/pages/Glossary.vue @@ -1,42 +1,24 @@ diff --git a/modules/environment/ui/pages/Index.vue b/modules/environment/ui/pages/Index.vue index 4e13abbf..a9e65ff5 100644 --- a/modules/environment/ui/pages/Index.vue +++ b/modules/environment/ui/pages/Index.vue @@ -1,44 +1,17 @@ diff --git a/modules/goals/application/CreateGoalsUseCase.ts b/modules/goals/application/CreateGoalsUseCase.ts deleted file mode 100644 index 5c6ad43f..00000000 --- a/modules/goals/application/CreateGoalsUseCase.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type Repository from "~/application/Repository"; -import UseCase from "~/application/UseCase"; -import type { Uuid } from "~/domain/Uuid"; -import Goals from "../domain/Goals"; - -export default class CreateGoalsUseCase extends UseCase { - constructor(readonly repository: Repository) { - super() - } - - async execute(solutionId: Uuid): Promise { - return await this.repository.add(new Goals({ - id: crypto.randomUUID(), - solutionId, - goals: [], - componentIds: [], - limitationIds: [], - obstacles: [], - outcomes: [], - stakeholders: [] - })) - } -} \ No newline at end of file diff --git a/modules/goals/application/CreateLimitUseCase.ts b/modules/goals/application/CreateLimitUseCase.ts deleted file mode 100644 index 2ee7733d..00000000 --- a/modules/goals/application/CreateLimitUseCase.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type Repository from "~/application/Repository"; -import UseCase from "~/application/UseCase"; -import type { Uuid } from "~/domain/Uuid"; -import type Goals from "../domain/Goals"; -import Limit from "~/domain/Limit"; - -type In = Pick - -export default class CreateLimitUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly limitRepository: Repository - ) { super() } - - async execute( - { parentId, solutionId, name, statement }: In - ): Promise { - const goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - const limitId = await this.limitRepository.add(new Limit({ - id: crypto.randomUUID(), - parentId, - solutionId, - name, - statement, - property: '' - })) - - goals.limitationIds.push(limitId) - - await this.goalsRepository.update(goals) - - return limitId - } -} \ No newline at end of file diff --git a/modules/goals/application/CreateMissionUseCase.ts b/modules/goals/application/CreateMissionUseCase.ts deleted file mode 100644 index 85f0ee79..00000000 --- a/modules/goals/application/CreateMissionUseCase.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type Repository from "~/application/Repository"; -import UseCase from "~/application/UseCase"; -import type Goals from "../domain/Goals"; -import Goal from "../domain/Goal"; - -type In = Pick - -export default class CreateMissionUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly goalRepository: Repository - ) { super() } - - async execute({ parentId, solutionId, statement }: In): Promise { - const goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - const missionId = await this.goalRepository.add(new Goal({ - id: crypto.randomUUID(), - parentId: parentId, - solutionId, - name: 'Mission', - statement, - property: '' - })) - - goals.goals.push(missionId) - - await this.goalsRepository.update(goals) - } -} \ No newline at end of file diff --git a/modules/goals/application/CreateObstacleUseCase.ts b/modules/goals/application/CreateObstacleUseCase.ts deleted file mode 100644 index 965a3ae6..00000000 --- a/modules/goals/application/CreateObstacleUseCase.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type Repository from "~/application/Repository"; -import UseCase from "~/application/UseCase"; -import type { Uuid } from "~/domain/Uuid"; -import type Goals from "../domain/Goals"; -import Obstacle from "../domain/Obstacle"; - -type In = Pick - -export default class CreateObstacleUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly obstacleRepository: Repository - ) { super() } - - async execute( - { parentId, solutionId, name, statement }: In - ): Promise { - const goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - const obstacleId = await this.obstacleRepository.add(new Obstacle({ - id: crypto.randomUUID(), - parentId, - solutionId, - name, - statement, - property: '' - })) - - goals.obstacles.push(obstacleId) - - await this.goalsRepository.update(goals) - - return obstacleId - } -} \ No newline at end of file diff --git a/modules/goals/application/CreateOutcomeUseCase.ts b/modules/goals/application/CreateOutcomeUseCase.ts deleted file mode 100644 index 402f8f4f..00000000 --- a/modules/goals/application/CreateOutcomeUseCase.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type Repository from "~/application/Repository"; -import UseCase from "~/application/UseCase"; -import type { Uuid } from "~/domain/Uuid"; -import type Goals from "../domain/Goals"; -import Outcome from "../domain/Outcome"; - -type In = Pick - -export default class CreateOutcomeUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly outcomeRepository: Repository, - ) { super() } - - async execute( - { parentId, solutionId, name, statement }: In - ): Promise { - const goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - const outcomeId = await this.outcomeRepository.add(new Outcome({ - id: crypto.randomUUID(), - parentId, - solutionId, - name, - statement, - property: '' - })) - - goals.outcomes.push(outcomeId) - - await this.goalsRepository.update(goals) - - return outcomeId - } -} \ No newline at end of file diff --git a/modules/goals/application/CreateStakeholderUseCase.ts b/modules/goals/application/CreateStakeholderUseCase.ts deleted file mode 100644 index 3358c25f..00000000 --- a/modules/goals/application/CreateStakeholderUseCase.ts +++ /dev/null @@ -1,41 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type { Uuid } from "~/domain/Uuid"; -import Stakeholder from "../domain/Stakeholder"; -import type Repository from "~/application/Repository"; -import type Goals from "../domain/Goals"; - -type In = Pick - -export default class CreateStakeholderUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly stakeholderRepository: Repository - ) { super() } - - async execute({ parentId, solutionId, ...props }: In): Promise { - let goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - const stakeholderId = await this.stakeholderRepository.add( - new Stakeholder({ - id: crypto.randomUUID(), - parentId, - solutionId, - name: props.name, - statement: props.statement, - availability: props.availability, - influence: props.influence, - segmentation: props.segmentation, - property: '' - }) - ) - - goals.stakeholders.push(stakeholderId) - - await this.goalsRepository.update(goals) - - return stakeholderId - } -} \ No newline at end of file diff --git a/modules/goals/application/DeleteLimitUseCase.ts b/modules/goals/application/DeleteLimitUseCase.ts deleted file mode 100644 index 6e720522..00000000 --- a/modules/goals/application/DeleteLimitUseCase.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type Repository from "~/application/Repository"; -import UseCase from "~/application/UseCase"; -import type Goals from "../domain/Goals"; -import type Limit from "~/domain/Limit"; - -type In = Pick - -export default class DeleteLimitUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly limitRepository: Repository - ) { super() } - - async execute({ parentId, id }: In): Promise { - const goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - goals.limitationIds = goals.limitationIds.filter(lid => lid !== id) - - await this.goalsRepository.update(goals) - await this.limitRepository.delete(id) - } -} \ No newline at end of file diff --git a/modules/goals/application/DeleteObstacleUseCase.ts b/modules/goals/application/DeleteObstacleUseCase.ts deleted file mode 100644 index 3e011d06..00000000 --- a/modules/goals/application/DeleteObstacleUseCase.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type Repository from "~/application/Repository"; -import UseCase from "~/application/UseCase"; -import type Goals from "../domain/Goals"; -import type Obstacle from "../domain/Obstacle"; - -type In = Pick - -export default class DeleteObstacleUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly obstacleRepository: Repository - ) { super() } - - async execute({ parentId, id }: In): Promise { - const goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - goals.obstacles = goals.obstacles.filter(uid => uid !== id) - - await this.goalsRepository.update(goals) - await this.obstacleRepository.delete(id) - } -} \ No newline at end of file diff --git a/modules/goals/application/DeleteOutcomeUseCase.ts b/modules/goals/application/DeleteOutcomeUseCase.ts deleted file mode 100644 index ac40cf7e..00000000 --- a/modules/goals/application/DeleteOutcomeUseCase.ts +++ /dev/null @@ -1,25 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type Outcome from "../domain/Outcome"; -import type Repository from "~/application/Repository"; -import type Goals from "../domain/Goals"; - -type In = Pick - -export default class DeleteOutcomeUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly outcomeRepository: Repository - ) { super() } - - async execute({ parentId, id }: In): Promise { - const goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - goals.outcomes = goals.outcomes.filter(oid => oid !== id) - - await this.goalsRepository.update(goals) - await this.outcomeRepository.delete(id) - } -} \ No newline at end of file diff --git a/modules/goals/application/DeleteStakeholderUseCase.ts b/modules/goals/application/DeleteStakeholderUseCase.ts deleted file mode 100644 index deaff2ba..00000000 --- a/modules/goals/application/DeleteStakeholderUseCase.ts +++ /dev/null @@ -1,25 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type Goals from "../domain/Goals"; -import type Repository from "~/application/Repository"; -import type Stakeholder from "../domain/Stakeholder"; - -type In = Pick - -export default class DeleteStakeholderUseCase extends UseCase { - constructor( - readonly goalsRepository: Repository, - readonly stakeholderRepository: Repository - ) { super() } - - async execute({ parentId, id }: In): Promise { - const goals = await this.goalsRepository.get(parentId) - - if (!goals) - throw new Error('Goals not found') - - goals.stakeholders = goals.stakeholders.filter(sid => sid !== id) - - await this.goalsRepository.update(goals) - await this.stakeholderRepository.delete(id) - } -} \ No newline at end of file diff --git a/modules/goals/application/EpicInteractor.ts b/modules/goals/application/EpicInteractor.ts deleted file mode 100644 index c43eb74e..00000000 --- a/modules/goals/application/EpicInteractor.ts +++ /dev/null @@ -1,47 +0,0 @@ -import Interactor from "~/application/Interactor" -import Epic from "../domain/Epic" -import type { Uuid } from "~/domain/Uuid" - -type In = Pick; - -export default class EpicInteractor extends Interactor { - async create({ parentId, solutionId, name, statement, primaryActorId }: Omit): Promise { - return await this.repository.add(new Epic({ - id: crypto.randomUUID(), - primaryActorId, - solutionId, - parentId, - name, - statement, - property: '' - })) - } - - async delete(id: Uuid): Promise { - await this.repository.delete(id) - } - - async getAll(solutionId: Uuid): Promise { - return await this.repository.getAll( - behavior => behavior.solutionId === solutionId - ) - } - - async getByParentId(parentId: Uuid): Promise { - return await this.repository.getAll( - behavior => behavior.parentId === parentId - ) - } - - async update({ id, name, statement, solutionId, parentId, primaryActorId }: In): Promise { - await this.repository.update(new Epic({ - id, - name, - statement, - solutionId, - parentId, - primaryActorId, - property: '' - })) - } -} \ No newline at end of file diff --git a/modules/goals/application/GetGoalsBySolutionIdUseCase.ts b/modules/goals/application/GetGoalsBySolutionIdUseCase.ts deleted file mode 100644 index f26525a6..00000000 --- a/modules/goals/application/GetGoalsBySolutionIdUseCase.ts +++ /dev/null @@ -1,16 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type Repository from "~/application/Repository"; -import type Goals from "../domain/Goals"; -import type { Uuid } from "~/domain/Uuid"; - -export default class GetGoalsBySolutionIdUseCase extends UseCase { - constructor(readonly repository: Repository) { - super() - } - - async execute(solutionId: Uuid): Promise { - const goals = await this.repository.getAll(g => g.solutionId === solutionId) - - return goals[0] - } -} \ No newline at end of file diff --git a/modules/goals/application/GetGoalsUseCase.ts b/modules/goals/application/GetGoalsUseCase.ts deleted file mode 100644 index e4126bd9..00000000 --- a/modules/goals/application/GetGoalsUseCase.ts +++ /dev/null @@ -1,14 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type Goals from "../domain/Goals"; -import type { Uuid } from "~/domain/Uuid"; -import type Repository from "~/application/Repository"; - -export default class GetGoalsUseCase extends UseCase { - constructor(readonly repository: Repository) { - super() - } - - async execute(goalsId: Uuid): Promise { - return await this.repository.get(goalsId) - } -} \ No newline at end of file diff --git a/modules/goals/application/GetLimitsUseCase.ts b/modules/goals/application/GetLimitsUseCase.ts deleted file mode 100644 index f076aa3b..00000000 --- a/modules/goals/application/GetLimitsUseCase.ts +++ /dev/null @@ -1,14 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type { Uuid } from "~/domain/Uuid"; -import type Repository from "~/application/Repository"; -import type Limit from "~/domain/Limit"; - -export default class GetLimitsUseCase extends UseCase { - constructor(readonly repository: Repository) { - super() - } - - async execute(goalsId: Uuid): Promise { - return await this.repository.getAll(o => o.parentId === goalsId) - } -} \ No newline at end of file diff --git a/modules/goals/application/GetObstaclesUseCase.ts b/modules/goals/application/GetObstaclesUseCase.ts deleted file mode 100644 index b01ddf5b..00000000 --- a/modules/goals/application/GetObstaclesUseCase.ts +++ /dev/null @@ -1,14 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type Obstacle from "../domain/Obstacle"; -import type { Uuid } from "~/domain/Uuid"; -import type Repository from "~/application/Repository"; - -export default class GetObstaclesUseCase extends UseCase { - constructor(readonly repository: Repository) { - super() - } - - async execute(goalsId: Uuid): Promise { - return await this.repository.getAll(o => o.parentId === goalsId) - } -} \ No newline at end of file diff --git a/modules/goals/application/GetOutcomesUseCase.ts b/modules/goals/application/GetOutcomesUseCase.ts deleted file mode 100644 index 281c733b..00000000 --- a/modules/goals/application/GetOutcomesUseCase.ts +++ /dev/null @@ -1,14 +0,0 @@ -import UseCase from "~/application/UseCase" -import type { Uuid } from "~/domain/Uuid" -import type Repository from "~/application/Repository" -import type Outcome from "../domain/Outcome" - -export default class GetOutcomesUseCase extends UseCase { - constructor(readonly repository: Repository) { - super() - } - - async execute(goalsId: Uuid): Promise { - return await this.repository.getAll((outcome: Outcome) => outcome.parentId === goalsId) - } -} \ No newline at end of file diff --git a/modules/goals/application/GetRationaleUseCase.ts b/modules/goals/application/GetRationaleUseCase.ts deleted file mode 100644 index 5d1da66c..00000000 --- a/modules/goals/application/GetRationaleUseCase.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type Repository from "~/application/Repository" -import type { Uuid } from "~/domain/Uuid" -import UseCase from "~/application/UseCase" -import type Goal from "../domain/Goal" - -type Out = { - vision: string, - mission: string, - situation: string, - objective: string -} - -export default class GetRationaleUseCase extends UseCase { - constructor( - readonly goalRepository: Repository - ) { super() } - - async execute(goalsId: Uuid): Promise { - const gr = this.goalRepository - - const [vision, mission, situation, objective] = await Promise.all([ - gr.getAll(g => g.parentId === goalsId && g.name === 'Vision'), - gr.getAll(g => g.parentId === goalsId && g.name === 'Mission'), - gr.getAll(g => g.parentId === goalsId && g.name === 'Situation'), - gr.getAll(g => g.parentId === goalsId && g.name === 'Objective') - ]) - - return { - vision: vision[0]?.statement || '', - mission: mission[0]?.statement || '', - situation: situation[0]?.statement || '', - objective: objective[0]?.statement || '' - } - } -} \ No newline at end of file diff --git a/modules/goals/application/GetStakeHolderByIdUseCase.ts b/modules/goals/application/GetStakeHolderByIdUseCase.ts deleted file mode 100644 index e569c9e1..00000000 --- a/modules/goals/application/GetStakeHolderByIdUseCase.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Uuid } from "~/domain/Uuid" -import type Stakeholder from "../domain/Stakeholder" -import type Repository from "~/application/Repository" -import UseCase from "~/application/UseCase" - -export default class GetStakeHolderByIdUseCase extends UseCase { - constructor(readonly repository: Repository) { - super() - } - - async execute(id: Uuid): Promise { - return await this.repository.get(id) - } -} \ No newline at end of file diff --git a/modules/goals/application/GetStakeHoldersUseCase.ts b/modules/goals/application/GetStakeHoldersUseCase.ts deleted file mode 100644 index b410bd0a..00000000 --- a/modules/goals/application/GetStakeHoldersUseCase.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Uuid } from "~/domain/Uuid" -import type Stakeholder from "../domain/Stakeholder" -import type Repository from "~/application/Repository" -import UseCase from "~/application/UseCase" - -export default class GetStakeHoldersUseCase extends UseCase { - constructor(readonly repository: Repository) { - super() - } - - async execute(goalsId: Uuid): Promise { - return await this.repository.getAll(s => s.parentId === goalsId) - } -} \ No newline at end of file diff --git a/modules/goals/application/GoalInteractor.ts b/modules/goals/application/GoalInteractor.ts new file mode 100644 index 00000000..1ca989c8 --- /dev/null +++ b/modules/goals/application/GoalInteractor.ts @@ -0,0 +1,4 @@ +import Interactor from "~/application/Interactor"; +import type Goal from "../domain/Goal"; + +export default class GoalInteractor extends Interactor { } \ No newline at end of file diff --git a/modules/goals/application/LimitInteractor.ts b/modules/goals/application/LimitInteractor.ts new file mode 100644 index 00000000..159b238f --- /dev/null +++ b/modules/goals/application/LimitInteractor.ts @@ -0,0 +1,4 @@ +import Interactor from "~/application/Interactor"; +import type Limit from "../domain/Limit"; + +export default class LimitInteractor extends Interactor { } \ No newline at end of file diff --git a/modules/goals/application/ObstacleInteractor.ts b/modules/goals/application/ObstacleInteractor.ts new file mode 100644 index 00000000..453c80c1 --- /dev/null +++ b/modules/goals/application/ObstacleInteractor.ts @@ -0,0 +1,4 @@ +import Interactor from "~/application/Interactor"; +import type Obstacle from "../domain/Obstacle"; + +export default class ObstacleInteractor extends Interactor { } \ No newline at end of file diff --git a/modules/goals/application/OutcomeInteractor.ts b/modules/goals/application/OutcomeInteractor.ts new file mode 100644 index 00000000..71ca40c1 --- /dev/null +++ b/modules/goals/application/OutcomeInteractor.ts @@ -0,0 +1,4 @@ +import Interactor from "~/application/Interactor"; +import type Outcome from "../domain/Outcome"; + +export default class OutcomeInteractor extends Interactor { } \ No newline at end of file diff --git a/modules/goals/application/StakeholderCategoryInteractor.ts b/modules/goals/application/StakeholderCategoryInteractor.ts new file mode 100644 index 00000000..8f1744b1 --- /dev/null +++ b/modules/goals/application/StakeholderCategoryInteractor.ts @@ -0,0 +1,4 @@ +import Interactor from "~/application/Interactor"; +import type StakeholderCategory from "../domain/StakeholderCategory"; + +export default class StakeholderCategoryInteractor extends Interactor { } \ No newline at end of file diff --git a/modules/goals/application/StakeholderInteractor.ts b/modules/goals/application/StakeholderInteractor.ts new file mode 100644 index 00000000..f98eeb21 --- /dev/null +++ b/modules/goals/application/StakeholderInteractor.ts @@ -0,0 +1,4 @@ +import Interactor from "~/application/Interactor"; +import type Stakeholder from "../domain/Stakeholder"; + +export default class StakeholderInteractor extends Interactor { } \ No newline at end of file diff --git a/modules/goals/application/StakeholderSegmentationInteractor.ts b/modules/goals/application/StakeholderSegmentationInteractor.ts new file mode 100644 index 00000000..3ab8242d --- /dev/null +++ b/modules/goals/application/StakeholderSegmentationInteractor.ts @@ -0,0 +1,4 @@ +import Interactor from "~/application/Interactor"; +import type StakeholderSegmentation from "../domain/StakeholderSegmentation"; + +export default class StakeholderSegmentationInteractor extends Interactor { } \ No newline at end of file diff --git a/modules/goals/application/UpdateLimitUseCase.ts b/modules/goals/application/UpdateLimitUseCase.ts deleted file mode 100644 index 124633e2..00000000 --- a/modules/goals/application/UpdateLimitUseCase.ts +++ /dev/null @@ -1,22 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type Repository from "~/application/Repository"; -import type Limit from "~/domain/Limit"; - -type In = Pick - -export default class UpdateLimitUseCase extends UseCase { - constructor(readonly repository: Repository) { - super(); - } - - async execute({ id, name, statement }: In): Promise { - const goalsLimit = await this.repository.get(id) - - if (!goalsLimit) - throw new Error('GoalsLimit not found') - - Object.assign(goalsLimit, { name, statement }) - - await this.repository.update(goalsLimit) - } -} \ No newline at end of file diff --git a/modules/goals/application/UpdateObstacleUseCase.ts b/modules/goals/application/UpdateObstacleUseCase.ts deleted file mode 100644 index f3b1d45e..00000000 --- a/modules/goals/application/UpdateObstacleUseCase.ts +++ /dev/null @@ -1,22 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type Repository from "~/application/Repository"; -import type Obstacle from "../domain/Obstacle"; - -type In = Pick - -export default class UpdateObstacleUseCase extends UseCase { - constructor(readonly repository: Repository) { - super(); - } - - async execute({ id, name, statement }: In): Promise { - const obstacle = await this.repository.get(id) - - if (!obstacle) - throw new Error('Obstacle not found') - - Object.assign(obstacle, { name, statement }) - - await this.repository.update(obstacle) - } -} \ No newline at end of file diff --git a/modules/goals/application/UpdateOutcomeUseCase.ts b/modules/goals/application/UpdateOutcomeUseCase.ts deleted file mode 100644 index 6760271c..00000000 --- a/modules/goals/application/UpdateOutcomeUseCase.ts +++ /dev/null @@ -1,24 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type Outcome from "../domain/Outcome"; -import type Repository from "~/application/Repository"; - -type In = Pick - -export default class UpdateOutcomeUseCase extends UseCase { - constructor( - readonly repository: Repository - ) { super() } - - async execute( - { id, name, statement }: In - ): Promise { - const outcome = await this.repository.get(id) - - if (!outcome) - throw new Error('Outcome not found') - - Object.assign(outcome, { name, statement }) - - await this.repository.update(outcome) - } -} \ No newline at end of file diff --git a/modules/goals/application/UpdateRationaleUseCase.ts b/modules/goals/application/UpdateRationaleUseCase.ts deleted file mode 100644 index 8a406f65..00000000 --- a/modules/goals/application/UpdateRationaleUseCase.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type Repository from "~/application/Repository"; -import UseCase from "~/application/UseCase"; -import type { Uuid } from "~/domain/Uuid"; -import Goal from "../domain/Goal"; - -type In = { - solutionId: Uuid, - goalsId: Uuid, - visionStatement: string, - missionStatement: string, - situationStatement: string, - objectiveStatement: string -} - -export default class UpdateRationaleUseCase extends UseCase { - constructor(readonly goalRepository: Repository) { - super() - } - - async execute( - { solutionId, goalsId, missionStatement, objectiveStatement, situationStatement, visionStatement }: In - ): Promise { - const gr = this.goalRepository - - const [vision, mission, situation, objective, outcomes] = await Promise.all([ - gr.getAll(g => g.parentId === goalsId && g.name === 'Vision'), - gr.getAll(g => g.parentId === goalsId && g.name === 'Mission'), - gr.getAll(g => g.parentId === goalsId && g.name === 'Situation'), - gr.getAll(g => g.parentId === goalsId && g.name === 'Objective'), - gr.getAll(g => g.parentId === goalsId && g.name === 'Outcomes') - ]) - - if (vision.length === 0) { - await gr.add(new Goal({ - id: crypto.randomUUID(), - parentId: goalsId, - solutionId, - name: 'Vision', - statement: visionStatement, - property: '' - })) - } else { - vision[0].statement = visionStatement - await gr.update(vision[0]) - } - - if (mission.length === 0) { - await gr.add(new Goal({ - id: crypto.randomUUID(), - parentId: goalsId, - solutionId, - name: 'Mission', - statement: missionStatement, - property: '' - })) - } else { - mission[0].statement = missionStatement - await gr.update(mission[0]) - } - - if (situation.length === 0) { - await gr.add(new Goal({ - id: crypto.randomUUID(), - parentId: goalsId, - solutionId, - name: 'Situation', - statement: situationStatement, - property: '' - })) - } else { - situation[0].statement = situationStatement - await gr.update(situation[0]) - } - - if (objective.length === 0) { - await gr.add(new Goal({ - id: crypto.randomUUID(), - parentId: goalsId, - solutionId, - name: 'Objective', - statement: objectiveStatement, - property: '' - })) - } else { - objective[0].statement = objectiveStatement - await gr.update(objective[0]) - } - - if (outcomes.length === 0) { - await gr.add(new Goal({ - id: crypto.randomUUID(), - parentId: goalsId, - solutionId, - name: 'Outcomes', - statement: '', - property: '' - })) - } - } -} \ No newline at end of file diff --git a/modules/goals/application/UpdateStakeHolderUseCase.ts b/modules/goals/application/UpdateStakeHolderUseCase.ts deleted file mode 100644 index a106c3e1..00000000 --- a/modules/goals/application/UpdateStakeHolderUseCase.ts +++ /dev/null @@ -1,23 +0,0 @@ -import UseCase from "~/application/UseCase"; -import type { Properties } from "~/domain/Properties"; -import type Stakeholder from "../domain/Stakeholder"; -import type Repository from "~/application/Repository"; - -type In = Properties> - -export default class UpdateStakeHolderUseCase extends UseCase { - constructor(readonly repository: Repository) { - super(); - } - - async execute({ id, ...props }: In): Promise { - const stakeholder = await this.repository.get(id) - - if (!stakeholder) - throw new Error('Stakeholder not found') - - Object.assign(stakeholder, props) - - await this.repository.update(stakeholder) - } -} \ No newline at end of file diff --git a/modules/goals/data/EpicRepository.ts b/modules/goals/data/EpicRepository.ts deleted file mode 100644 index 44cf39ce..00000000 --- a/modules/goals/data/EpicRepository.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Properties } from "~/domain/Properties"; -import StorageRepository from "~/data/StorageRepository.js"; -import type Epic from "../domain/Epic"; -import EpicToJsonMapper from "../mappers/EpicToJsonMapper"; - -const { serializationVersion } = useAppConfig() - -export default class EpicRepository extends StorageRepository { - constructor(properties: Properties> = {}) { - super({ - ...properties, - storageKey: 'epic', - mapper: new EpicToJsonMapper(serializationVersion) - }) - } -} \ No newline at end of file diff --git a/modules/goals/data/GoalRepository.ts b/modules/goals/data/GoalRepository.ts index 664fe240..13e37923 100644 --- a/modules/goals/data/GoalRepository.ts +++ b/modules/goals/data/GoalRepository.ts @@ -1,16 +1,6 @@ -import type { Properties } from "~/domain/Properties"; -import GoalToJsonMapper from "../mappers/GoalToJsonMapper"; -import StorageRepository from "~/data/StorageRepository"; -import type Goal from "../domain/Goal"; +import Goal from "../domain/Goal"; +import PGLiteRepository from "~/data/PGLiteRepository"; -const { serializationVersion } = useAppConfig() - -export default class GoalRepository extends StorageRepository { - constructor(properties: Properties> = {}) { - super({ - ...properties, - storageKey: 'goal', - mapper: new GoalToJsonMapper(serializationVersion) - }) - } +export default class GoalRepository extends PGLiteRepository { + constructor() { super('cathedral.goal', Goal) } } \ No newline at end of file diff --git a/modules/goals/data/GoalsRepository.ts b/modules/goals/data/GoalsRepository.ts deleted file mode 100644 index 5cf849d1..00000000 --- a/modules/goals/data/GoalsRepository.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type Goals from "../domain/Goals"; -import type { Properties } from "~/domain/Properties"; -import GoalsToJsonMapper from "../mappers/GoalsToJsonMapper"; -import StorageRepository from "~/data/StorageRepository.js"; - -const { serializationVersion } = useAppConfig() - -export default class GoalsRepository extends StorageRepository { - constructor(properties: Properties> = {}) { - super({ - ...properties, - storageKey: 'goals', - mapper: new GoalsToJsonMapper(serializationVersion) - }) - } -} \ No newline at end of file diff --git a/modules/goals/data/LimitRepository.ts b/modules/goals/data/LimitRepository.ts index 19b76184..01bef26e 100644 --- a/modules/goals/data/LimitRepository.ts +++ b/modules/goals/data/LimitRepository.ts @@ -1,16 +1,7 @@ -import type { Properties } from "~/domain/Properties"; -import StorageRepository from "~/data/StorageRepository"; -import type Goal from "../domain/Goal"; -import LimitToJsonMapper from "../mappers/LimitToJsonMapper"; +import PGLiteRepository from "~/data/PGLiteRepository"; +import Limit from "../domain/Limit"; -const { serializationVersion } = useAppConfig() - -export default class LimitRepository extends StorageRepository { - constructor(properties: Properties> = {}) { - super({ - ...properties, - storageKey: 'limit', - mapper: new LimitToJsonMapper(serializationVersion) - }) - } +export default class LimitRepository extends PGLiteRepository { + // "limit" is a reserved word in SQL, so we need to use quotes to escape it + constructor() { super(`cathedral."limit"`, Limit) } } \ No newline at end of file diff --git a/modules/goals/data/ObstacleRepository.ts b/modules/goals/data/ObstacleRepository.ts index 8afc87a3..09c34394 100644 --- a/modules/goals/data/ObstacleRepository.ts +++ b/modules/goals/data/ObstacleRepository.ts @@ -1,16 +1,6 @@ -import type { Properties } from "~/domain/Properties"; -import StorageRepository from "~/data/StorageRepository.js"; -import type Obstacle from "../domain/Obstacle"; -import ObstacleToJsonMapper from "../mappers/ObstacleToJsonMapper"; +import Obstacle from "../domain/Obstacle"; +import PGLiteRepository from "~/data/PGLiteRepository"; -const { serializationVersion } = useAppConfig() - -export default class ObstacleRepository extends StorageRepository { - constructor(properties: Properties> = {}) { - super({ - ...properties, - storageKey: 'obstacle', - mapper: new ObstacleToJsonMapper(serializationVersion) - }) - } +export default class ObstacleRepository extends PGLiteRepository { + constructor() { super('cathedral.obstacle', Obstacle) } } \ No newline at end of file diff --git a/modules/goals/data/OutcomeRepository.ts b/modules/goals/data/OutcomeRepository.ts index c569c26a..ed0d31aa 100644 --- a/modules/goals/data/OutcomeRepository.ts +++ b/modules/goals/data/OutcomeRepository.ts @@ -1,16 +1,6 @@ -import type { Properties } from "~/domain/Properties"; -import StorageRepository from "~/data/StorageRepository.js"; -import type Outcome from "../domain/Outcome"; -import OutcomeToJsonMapper from "../mappers/OutcomeToJsonMapper"; +import Outcome from "../domain/Outcome"; +import PGLiteRepository from "~/data/PGLiteRepository"; -const { serializationVersion } = useAppConfig() - -export default class OutcomeRepository extends StorageRepository { - constructor(properties: Properties> = {}) { - super({ - ...properties, - storageKey: 'outcome', - mapper: new OutcomeToJsonMapper(serializationVersion) - }) - } +export default class OutcomeRepository extends PGLiteRepository { + constructor() { super('cathedral.outcome', Outcome) } } \ No newline at end of file diff --git a/modules/goals/data/StakeholderCategoryRepository.ts b/modules/goals/data/StakeholderCategoryRepository.ts new file mode 100644 index 00000000..3aa076b4 --- /dev/null +++ b/modules/goals/data/StakeholderCategoryRepository.ts @@ -0,0 +1,6 @@ +import PGLiteRepository from "~/data/PGLiteRepository"; +import StakeholderCategory from "../domain/StakeholderCategory"; + +export default class StakeholderCategoryRepository extends PGLiteRepository { + constructor() { super('cathedral.stakeholder_category', StakeholderCategory) } +} \ No newline at end of file diff --git a/modules/goals/data/StakeholderRepository.ts b/modules/goals/data/StakeholderRepository.ts index eac661a6..6ba6756f 100644 --- a/modules/goals/data/StakeholderRepository.ts +++ b/modules/goals/data/StakeholderRepository.ts @@ -1,16 +1,6 @@ -import type { Properties } from "~/domain/Properties"; -import StorageRepository from "~/data/StorageRepository.js"; -import type Stakeholder from "../domain/Stakeholder"; -import StakeholderToJsonMapper from "../mappers/StakeholderToJsonMapper"; +import PGLiteRepository from "~/data/PGLiteRepository"; +import Stakeholder from "../domain/Stakeholder"; -const { serializationVersion } = useAppConfig() - -export default class StakeholderRepository extends StorageRepository { - constructor(properties: Properties> = {}) { - super({ - ...properties, - storageKey: 'stakeholder', - mapper: new StakeholderToJsonMapper(serializationVersion) - }) - } +export default class StakeholderRepository extends PGLiteRepository { + constructor() { super('cathedral.stakeholder', Stakeholder) } } \ No newline at end of file diff --git a/modules/goals/data/StakeholderSegmentationRepository.ts b/modules/goals/data/StakeholderSegmentationRepository.ts new file mode 100644 index 00000000..eec37e72 --- /dev/null +++ b/modules/goals/data/StakeholderSegmentationRepository.ts @@ -0,0 +1,6 @@ +import PGLiteRepository from "~/data/PGLiteRepository"; +import StakeholderSegmentation from "../domain/StakeholderSegmentation"; + +export default class StakeholderSegmentationRepository extends PGLiteRepository { + constructor() { super('cathedral.stakeholder_segmentation', StakeholderSegmentation) } +} \ No newline at end of file diff --git a/modules/goals/domain/Epic.ts b/modules/goals/domain/Epic.ts deleted file mode 100644 index e12154f7..00000000 --- a/modules/goals/domain/Epic.ts +++ /dev/null @@ -1,6 +0,0 @@ -import Scenario from "../../system/domain/Scenario"; - -/** - * An Epic is a collection of User Stories directed towards a common goal. - */ -export default class Epic extends Scenario { } \ No newline at end of file diff --git a/domain/Limit.ts b/modules/goals/domain/Limit.ts similarity index 64% rename from domain/Limit.ts rename to modules/goals/domain/Limit.ts index 0239ce71..3c2d1d19 100644 --- a/domain/Limit.ts +++ b/modules/goals/domain/Limit.ts @@ -1,4 +1,4 @@ -import Requirement from "./Requirement"; +import Requirement from "../../../domain/Requirement"; /** * Exclusion from scope of requirements diff --git a/modules/goals/domain/Stakeholder.ts b/modules/goals/domain/Stakeholder.ts index 17bc2577..33f1e75e 100644 --- a/modules/goals/domain/Stakeholder.ts +++ b/modules/goals/domain/Stakeholder.ts @@ -1,28 +1,11 @@ -import Actor from "~/domain/Actor"; +import Component from "~/domain/Component"; import type { Properties } from "~/domain/Properties"; - -/** - * The segmentation of a stakeholder according to their relationship with the organization - */ -export enum StakeholderSegmentation { - Client = 'Client', - Vendor = 'Vendor' -} - -/** - * The category of a stakeholder according to their level of influence and availability - */ -export enum StakeholderCategory { - KeyStakeholder = 'Key Stakeholder', - ShadowInfluencer = 'Shadow Influencer', - FellowTraveler = 'Fellow Traveler', - Observer = 'Observer' -} +import type { Uuid } from "~/domain/Uuid"; /** * A human actor who may affect or be affected by a project or its associated system */ -export default class Stakeholder extends Actor { +export default class Stakeholder extends Component { static readonly INFLUENCE_MIN = 0 static readonly INFLUENCE_MAX = 100 static readonly AVAILABILITY_MIN = 0 @@ -31,12 +14,13 @@ export default class Stakeholder extends Actor { private _influence!: number private _availability!: number - segmentation!: StakeholderSegmentation + segmentationId!: Uuid + categoryId!: Uuid - constructor({ influence, availability, segmentation, ...rest }: Properties>) { + constructor({ influence, availability, segmentationId, categoryId, ...rest }: Properties) { super(rest) - Object.assign(this, { influence, availability, segmentation }) + Object.assign(this, { influence, availability, segmentationId, categoryId }) } get availability(): number { @@ -48,16 +32,6 @@ export default class Stakeholder extends Actor { this._availability = value } - get category(): StakeholderCategory { - const { KeyStakeholder, ShadowInfluencer, FellowTraveler, Observer } = StakeholderCategory, - { influence, availability } = this; - - return influence >= 75 && availability >= 75 ? KeyStakeholder - : influence >= 75 && availability < 75 ? ShadowInfluencer - : influence < 75 && availability >= 75 ? FellowTraveler - : Observer; - } - get influence(): number { return this._influence } diff --git a/modules/goals/domain/StakeholderCategory.ts b/modules/goals/domain/StakeholderCategory.ts new file mode 100644 index 00000000..782eeeed --- /dev/null +++ b/modules/goals/domain/StakeholderCategory.ts @@ -0,0 +1,14 @@ +import Entity from "~/domain/Entity" +import type { Properties } from "~/domain/Properties" + +/** + * The category of a stakeholder according to their level of influence and availability + */ +export default class StakeholderCategory extends Entity { + name: string + + constructor({ name, ...rest }: Properties) { + super(rest) + this.name = name + } +} diff --git a/modules/goals/domain/StakeholderSegmentation.ts b/modules/goals/domain/StakeholderSegmentation.ts new file mode 100644 index 00000000..02602b79 --- /dev/null +++ b/modules/goals/domain/StakeholderSegmentation.ts @@ -0,0 +1,14 @@ +import type { Properties } from "~/domain/Properties" +import Entity from "~/domain/Entity" + +/** + * The segmentation of a stakeholder according to their relationship with the organization + */ +export default class StakeholderSegmentation extends Entity { + name: string + + constructor({ name, ...rest }: Properties) { + super(rest) + this.name = name + } +} diff --git a/modules/goals/index.ts b/modules/goals/index.ts index 855cf2f4..bbd01d6a 100644 --- a/modules/goals/index.ts +++ b/modules/goals/index.ts @@ -21,9 +21,9 @@ export default defineNuxtModule({ path: '/solution/:solutionSlug/goals/stakeholders', file: resolve('./ui/pages/Stakeholders.vue') }, { - name: 'Epics', - path: '/solution/:solutionSlug/goals/epics', - file: resolve('./ui/pages/Epics.vue') + name: 'Goal Scenarios', + path: '/solution/:solutionSlug/goals/scenarios', + file: resolve('./ui/pages/Scenarios.vue') }, { name: 'Obstacles', path: '/solution/:solutionSlug/goals/obstacles', diff --git a/modules/goals/mappers/EpicToJsonMapper.ts b/modules/goals/mappers/EpicToJsonMapper.ts deleted file mode 100644 index efd0a328..00000000 --- a/modules/goals/mappers/EpicToJsonMapper.ts +++ /dev/null @@ -1,16 +0,0 @@ -import ScenarioToJsonMapper, { type ScenarioJson } from "~/modules/system/mappers/ScenarioToJsonMapper"; -import Epic from "../domain/Epic"; - -export interface EpicJson extends ScenarioJson { } - -export default class EpicToJsonMapper extends ScenarioToJsonMapper { - mapFrom(target: EpicJson): Epic { - return new Epic({ ...target }) - } - - mapTo(source: Epic): EpicJson { - return { - ...super.mapTo(source as any), - } - } -} \ No newline at end of file diff --git a/modules/goals/mappers/GoalToJsonMapper.ts b/modules/goals/mappers/GoalToJsonMapper.ts deleted file mode 100644 index 67855aa1..00000000 --- a/modules/goals/mappers/GoalToJsonMapper.ts +++ /dev/null @@ -1,16 +0,0 @@ -import Goal from "../domain/Goal"; -import RequirementToJsonMapper, { type RequirementJson } from "~/mappers/RequirementToJsonMapper"; - -export interface GoalJson extends RequirementJson { } - -export default class GoalToJsonMapper extends RequirementToJsonMapper { - override mapFrom(target: GoalJson): Goal { - return new Goal(target); - } - - override mapTo(source: Goal): GoalJson { - return { - ...super.mapTo(source), - }; - } -} \ No newline at end of file diff --git a/modules/goals/mappers/GoalsToJsonMapper.ts b/modules/goals/mappers/GoalsToJsonMapper.ts deleted file mode 100644 index e8405b64..00000000 --- a/modules/goals/mappers/GoalsToJsonMapper.ts +++ /dev/null @@ -1,37 +0,0 @@ -import PEGSToJsonMapper, { type PEGSJson } from "~/mappers/PEGSToJsonMapper"; -import Goals from "../domain/Goals"; -import type { Uuid } from "~/domain/Uuid"; - -export interface GoalsJson extends PEGSJson { - goals: Uuid[] - obstacles: Uuid[] - outcomes: Uuid[] - stakeholders: Uuid[] -} - -export default class GoalsToJsonMapper extends PEGSToJsonMapper { - override mapFrom(target: GoalsJson): Goals { - const pegs = super.mapFrom(target) - - return new Goals({ - id: pegs.id, - limitationIds: pegs.limitationIds, - outcomes: target.outcomes, - solutionId: pegs.solutionId, - componentIds: pegs.componentIds, - goals: target.goals, - obstacles: target.obstacles, - stakeholders: target.stakeholders - }); - } - - override mapTo(source: Goals): GoalsJson { - return { - ...super.mapTo(source as any), - goals: source.goals, - obstacles: source.obstacles, - outcomes: source.outcomes, - stakeholders: source.stakeholders - }; - } -} \ No newline at end of file diff --git a/modules/goals/mappers/LimitToJsonMapper.ts b/modules/goals/mappers/LimitToJsonMapper.ts deleted file mode 100644 index f9c1121d..00000000 --- a/modules/goals/mappers/LimitToJsonMapper.ts +++ /dev/null @@ -1,15 +0,0 @@ -import RequirementToJsonMapper, { type RequirementJson } from "~/mappers/RequirementToJsonMapper"; -import SemVer from "~/domain/SemVer"; -import Limit from "~/domain/Limit"; - -export interface LimitJson extends RequirementJson { } - -export default class LimitToJsonMapper extends RequirementToJsonMapper { - mapFrom(target: LimitJson): Limit { - return new Limit(target) - } - - mapTo(source: Limit): LimitJson { - return { ...super.mapTo(source as any) } - } -} \ No newline at end of file diff --git a/modules/goals/mappers/ObstacleToJsonMapper.ts b/modules/goals/mappers/ObstacleToJsonMapper.ts deleted file mode 100644 index 386c7c50..00000000 --- a/modules/goals/mappers/ObstacleToJsonMapper.ts +++ /dev/null @@ -1,16 +0,0 @@ -import GoalToJsonMapper, { type GoalJson } from "./GoalToJsonMapper"; -import Obstacle from "../domain/Obstacle"; - -export interface ObstacleJson extends GoalJson { } - -export default class ObstacleToJsonMapper extends GoalToJsonMapper { - override mapFrom(target: ObstacleJson): Obstacle { - return new Obstacle(target); - } - - override mapTo(source: Obstacle): ObstacleJson { - return { - ...super.mapTo(source as any) - }; - } -} \ No newline at end of file diff --git a/modules/goals/mappers/OutcomeToJsonMapper.ts b/modules/goals/mappers/OutcomeToJsonMapper.ts deleted file mode 100644 index 19bcaade..00000000 --- a/modules/goals/mappers/OutcomeToJsonMapper.ts +++ /dev/null @@ -1,17 +0,0 @@ -import Outcome from "../domain/Outcome"; -import SemVer from "~/domain/SemVer"; -import GoalToJsonMapper, { type GoalJson } from "./GoalToJsonMapper"; - -export interface OutcomeJson extends GoalJson { } - -export default class OutcomeToJsonMapper extends GoalToJsonMapper { - override mapFrom(target: OutcomeJson): Outcome { - return new Outcome(target); - } - - override mapTo(source: Outcome): OutcomeJson { - return { - ...super.mapTo(source as any) - }; - } -} \ No newline at end of file diff --git a/modules/goals/mappers/StakeholderToJsonMapper.ts b/modules/goals/mappers/StakeholderToJsonMapper.ts deleted file mode 100644 index 7248de5b..00000000 --- a/modules/goals/mappers/StakeholderToJsonMapper.ts +++ /dev/null @@ -1,28 +0,0 @@ -import RequirementToJsonMapper, { type RequirementJson } from "~/mappers/RequirementToJsonMapper"; -import Stakeholder, { StakeholderSegmentation } from "../domain/Stakeholder"; - -export interface StakeholderJson extends RequirementJson { - availability: number - influence: number - segmentation: string -} - -export default class StakeholderToJsonMapper extends RequirementToJsonMapper { - override mapFrom(target: StakeholderJson): Stakeholder { - return new Stakeholder({ - ...target, - segmentation: target.segmentation as StakeholderSegmentation, - }) - } - - override mapTo(source: Stakeholder): StakeholderJson { - const requirement = super.mapTo(source) - - return { - ...requirement, - availability: source.availability, - influence: source.influence, - segmentation: source.segmentation - } - } -} \ No newline at end of file diff --git a/modules/goals/ui/pages/Epics.vue b/modules/goals/ui/pages/Epics.vue deleted file mode 100644 index d64093f4..00000000 --- a/modules/goals/ui/pages/Epics.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - \ No newline at end of file diff --git a/modules/goals/ui/pages/Index.vue b/modules/goals/ui/pages/Index.vue index 335a7a82..f744c646 100644 --- a/modules/goals/ui/pages/Index.vue +++ b/modules/goals/ui/pages/Index.vue @@ -1,51 +1,23 @@