-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modify the solution to not catch the client's exception in the use ca…
…se, but in the console app's command
- Loading branch information
Showing
12 changed files
with
84 additions
and
54 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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,2 +1,3 @@ | ||
export * from './push-delete-requests-options.builder'; | ||
export * from './trigger-deletion-execution-options.builder'; | ||
export * from './deletion-execution-trigger-result.builder'; |
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
File renamed without changes.
File renamed without changes.
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,2 +1,4 @@ | ||
export * from './push-delete-requests-options.interface'; | ||
export * from './trigger-deletion-execution-options.interface'; | ||
export * from './deletion-execution-trigger-status.enum'; | ||
export * from './deletion-execution-trigger-result'; |
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,3 +1,2 @@ | ||
export * from './batch-deletion-summary-detail.builder'; | ||
export * from './batch-deletion-summary.builder'; | ||
export * from './deletion-execution-trigger-result.builder'; |
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
15 changes: 2 additions & 13 deletions
15
apps/server/src/modules/deletion/uc/deletion-execution.uc.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,22 +1,11 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { DeletionClient } from '../client'; | ||
import { DeletionExecutionTriggerResult } from './interface'; | ||
import { DeletionExecutionTriggerResultBuilder } from './builder'; | ||
|
||
@Injectable() | ||
export class DeletionExecutionUc { | ||
constructor(private readonly deletionClient: DeletionClient) {} | ||
|
||
async triggerDeletionExecution(limit?: number): Promise<DeletionExecutionTriggerResult> { | ||
// Try to trigger the deletion execution(s) via Deletion API client, | ||
// return successful status in case of a success, otherwise return | ||
// a result with a failure status and a proper error message. | ||
try { | ||
await this.deletionClient.executeDeletions(limit); | ||
|
||
return DeletionExecutionTriggerResultBuilder.buildSuccess(); | ||
} catch (err) { | ||
return DeletionExecutionTriggerResultBuilder.buildFailure(err as Error); | ||
} | ||
async triggerDeletionExecution(limit?: number): Promise<void> { | ||
await this.deletionClient.executeDeletions(limit); | ||
} | ||
} |
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,6 +1,4 @@ | ||
export * from './batch-deletion-summary-overall-status.enum'; | ||
export * from './batch-deletion-summary-detail.interface'; | ||
export * from './batch-deletion-summary.interface'; | ||
export * from './deletion-execution-trigger-status.enum'; | ||
export * from './deletion-execution-trigger-result'; | ||
export * from './interfaces'; |