-
Notifications
You must be signed in to change notification settings - Fork 12
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 #4 from conceptadev/tnramalho-feature/report-module
report module adjustments
- Loading branch information
Showing
25 changed files
with
165 additions
and
154 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/nestjs-report/src/__fixtures__/file/file-entity.fixture.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
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
2 changes: 1 addition & 1 deletion
2
packages/nestjs-report/src/__fixtures__/report/report-entity.fixture.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
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 was deleted.
Oops, something went wrong.
16 changes: 7 additions & 9 deletions
16
packages/nestjs-report/src/exceptions/report-create.exception.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
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
17 changes: 9 additions & 8 deletions
17
packages/nestjs-report/src/exceptions/report-generator-service-not-found.exception.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,26 +1,27 @@ | ||
import { HttpStatus } from '@nestjs/common'; | ||
import { RuntimeException } from '@concepta/nestjs-exception'; | ||
import { | ||
RuntimeException, | ||
RuntimeExceptionOptions, | ||
} from '@concepta/nestjs-exception'; | ||
|
||
export class ReportGeneratorServiceNotFoundException extends RuntimeException { | ||
context: RuntimeException['context'] & { | ||
generatorServiceName: string; | ||
}; | ||
|
||
constructor( | ||
assignmentName: string, | ||
message = 'Report generator service %s was not registered to be used.', | ||
) { | ||
constructor(generatorServiceName: string, options?: RuntimeExceptionOptions) { | ||
super({ | ||
message, | ||
messageParams: [assignmentName], | ||
message: 'Report generator service %s was not registered to be used.', | ||
messageParams: [generatorServiceName], | ||
httpStatus: HttpStatus.NOT_FOUND, | ||
...options, | ||
}); | ||
|
||
this.errorCode = 'REPORT_GENERATOR_SERVICE_NOT_FOUND_ERROR'; | ||
|
||
this.context = { | ||
...super.context, | ||
generatorServiceName: assignmentName, | ||
generatorServiceName, | ||
}; | ||
} | ||
} |
10 changes: 7 additions & 3 deletions
10
packages/nestjs-report/src/exceptions/report-id-missing.exception.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
14 changes: 7 additions & 7 deletions
14
packages/nestjs-report/src/exceptions/report-query.exception.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
10 changes: 7 additions & 3 deletions
10
packages/nestjs-report/src/exceptions/report-timeout.exception.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
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
6 changes: 3 additions & 3 deletions
6
packages/nestjs-report/src/interfaces/report-generator-result.interface.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,5 +1,5 @@ | ||
import { ReportEntityInterface } from './report-entity.interface'; | ||
import { ReportInterface } from '@concepta/ts-common'; | ||
|
||
export interface ReportGeneratorResultInterface | ||
extends Pick<ReportEntityInterface, 'id' | 'status' | 'file'>, | ||
Partial<Pick<ReportEntityInterface, 'errorMessage'>> {} | ||
extends Pick<ReportInterface, 'id' | 'status' | 'file'>, | ||
Partial<Pick<ReportInterface, 'errorMessage'>> {} |
8 changes: 3 additions & 5 deletions
8
packages/nestjs-report/src/interfaces/report-service.interface.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,11 +1,9 @@ | ||
import { ReportEntityInterface } from './report-entity.interface'; | ||
import { DoneCallback } from '../report.types'; | ||
import { ReportCreateDto } from '../dto/report-create.dto'; | ||
import { ReportInterface } from '@concepta/ts-common'; | ||
|
||
export interface ReportServiceInterface { | ||
generate(report: ReportCreateDto): Promise<ReportEntityInterface>; | ||
fetch( | ||
report: Pick<ReportEntityInterface, 'id'>, | ||
): Promise<ReportEntityInterface>; | ||
generate(report: ReportCreateDto): Promise<ReportInterface>; | ||
fetch(report: Pick<ReportInterface, 'id'>): Promise<ReportInterface>; | ||
done: DoneCallback; | ||
} |
12 changes: 3 additions & 9 deletions
12
packages/nestjs-report/src/interfaces/report-strategy-service.interface.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,13 +1,7 @@ | ||
import { ReportEntityInterface } from './report-entity.interface'; | ||
import { ReportInterface } from '@concepta/ts-common'; | ||
import { ReportGeneratorResultInterface } from './report-generator-result.interface'; | ||
import { ReportGeneratorServiceInterface } from './report-generator-service.interface'; | ||
|
||
export interface ReportStrategyServiceInterface { | ||
generate( | ||
report: ReportEntityInterface, | ||
): Promise<ReportGeneratorResultInterface>; | ||
getDownloadUrl(report: ReportEntityInterface): Promise<string>; | ||
resolveGeneratorService( | ||
report: ReportEntityInterface, | ||
): ReportGeneratorServiceInterface; | ||
generate(report: ReportInterface): Promise<ReportGeneratorResultInterface>; | ||
getDownloadUrl(report: ReportInterface): Promise<string>; | ||
} |
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
Oops, something went wrong.