-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1100 from Vizzuality/feat/MARXAN-1594-add-endpoin…
…t-for-running-a-legacy-project-import feat : add endpoint for running a legacy project import
- Loading branch information
Showing
8 changed files
with
153 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
...ps/api/src/modules/legacy-project-import/application/run-legacy-project-import.command.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
import { forbiddenError } from '@marxan-api/modules/access-control'; | ||
import { ResourceId } from '@marxan/cloning/domain'; | ||
import { UserId } from '@marxan/domain-ids'; | ||
import { Command } from '@nestjs-architects/typed-cqrs'; | ||
import { Either } from 'fp-ts/lib/Either'; | ||
import { GenerateLegacyProjectImportPiecesErrors } from '../domain/legacy-project-import/legacy-project-import'; | ||
import { RunLegacyProjectImportErrors } from '../domain/legacy-project-import/legacy-project-import'; | ||
import { | ||
LegacyProjectImportRepositoryFindErrors, | ||
LegacyProjectImportRepositorySaveErrors, | ||
} from '../domain/legacy-project-import/legacy-project-import.repository'; | ||
|
||
export type RunLegacyProjectImportError = | ||
| GenerateLegacyProjectImportPiecesErrors | ||
| RunLegacyProjectImportErrors | ||
| LegacyProjectImportRepositorySaveErrors | ||
| LegacyProjectImportRepositoryFindErrors; | ||
| LegacyProjectImportRepositoryFindErrors | ||
| typeof forbiddenError; | ||
|
||
export type RunLegacyProjectImportResponse = Either< | ||
RunLegacyProjectImportError, | ||
true | ||
>; | ||
|
||
export class RunLegacyProjectImport extends Command<RunLegacyProjectImportResponse> { | ||
constructor(public readonly projectId: ResourceId) { | ||
constructor( | ||
public readonly projectId: ResourceId, | ||
public readonly userId: UserId, | ||
) { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters