diff --git a/libs/red-domain/src/lib/files/file.model.ts b/libs/red-domain/src/lib/files/file.model.ts index 897c8f64c..c7c2f02ab 100644 --- a/libs/red-domain/src/lib/files/file.model.ts +++ b/libs/red-domain/src/lib/files/file.model.ts @@ -37,7 +37,7 @@ export class File implements IFile, IListable { readonly lastUpdated?: string; readonly lastUploaded?: string; readonly legalBasisVersion?: number; - readonly numberOfAnalyses?: number; + readonly numberOfAnalyses: number; readonly numberOfPages?: number; readonly rulesVersion?: number; readonly status: FileStatus; @@ -110,7 +110,7 @@ export class File implements IFile, IListable { this.isUnderReview = this.status === FileStatuses.UNDER_REVIEW; this.isUnderApproval = this.status === FileStatuses.UNDER_APPROVAL; this.canBeApproved = !this.analysisRequired && !this.hasSuggestions; - this.canBeOpened = !this.isError && !this.isPending; + this.canBeOpened = !this.isError && !this.isPending && this.numberOfAnalyses > 0; this.isWorkable = !this.isProcessing && this.canBeOpened; this.canBeOCRed = !this.excluded && !this.lastOCRTime && ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(this.status); diff --git a/libs/red-domain/src/lib/files/file.ts b/libs/red-domain/src/lib/files/file.ts index 6b35bbea9..f3ddd649b 100644 --- a/libs/red-domain/src/lib/files/file.ts +++ b/libs/red-domain/src/lib/files/file.ts @@ -117,7 +117,7 @@ export interface IFile { /** * The number of times the file has been analyzed. */ - readonly numberOfAnalyses?: number; + readonly numberOfAnalyses: number; /** * The number of pages of the file. */