diff --git a/projects/valtimo/document/src/lib/models/index.ts b/projects/valtimo/document/src/lib/models/index.ts index 646cc567d..3d37f9d94 100644 --- a/projects/valtimo/document/src/lib/models/index.ts +++ b/projects/valtimo/document/src/lib/models/index.ts @@ -20,3 +20,4 @@ export * from './audit.model'; export * from './advanced-document-search-request'; export * from './document-search-request'; export * from './internal-case-status.model'; +export * from './process-document-definition-search.model'; diff --git a/projects/valtimo/document/src/lib/models/process-document-definition-search.model.ts b/projects/valtimo/document/src/lib/models/process-document-definition-search.model.ts new file mode 100644 index 000000000..bb4a60473 --- /dev/null +++ b/projects/valtimo/document/src/lib/models/process-document-definition-search.model.ts @@ -0,0 +1,4 @@ +export interface ProcessDocumentDefinitionSearch { + startableByUser?: boolean; + canInitializeDocument?: boolean; +} \ No newline at end of file diff --git a/projects/valtimo/document/src/lib/services/document.service.ts b/projects/valtimo/document/src/lib/services/document.service.ts index 31a609901..542321042 100644 --- a/projects/valtimo/document/src/lib/services/document.service.ts +++ b/projects/valtimo/document/src/lib/services/document.service.ts @@ -52,6 +52,7 @@ import { Page, ProcessDocumentDefinition, ProcessDocumentDefinitionRequest, + ProcessDocumentDefinitionSearch, ProcessDocumentInstance, SpecifiedDocuments, TemplatePayload, @@ -306,6 +307,20 @@ export class DocumentService { ); } + public findProcessDocumentDefinitionsForDocument( + documentId: string, + searchRequest: ProcessDocumentDefinitionSearch + ): Observable { + const params = new HttpParams({ + fromObject: searchRequest as any, + }); + console.log({params}); + return this.http.get( + `${this.valtimoEndpointUri}v2/process-document/definition/document/${documentId}`, + {params} + ); + } + public findProcessDocumentDefinitionsByVersion( documentDefinitionName: string, version: number diff --git a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.ts b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.ts index 7185b5f1d..c734fc3bb 100644 --- a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.ts +++ b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.ts @@ -312,7 +312,7 @@ export class DossierDetailComponent public getAllAssociatedProcessDefinitions(): void { this.documentService - .findProcessDocumentDefinitionsByStartableByUser(this.documentDefinitionName, true) + .findProcessDocumentDefinitionsForDocument(this.documentId, {startableByUser: true}) .subscribe((processDocumentDefinitions: ProcessDocumentDefinition[]) => { this.processDocumentDefinitions = processDocumentDefinitions;