(id: string, auth?: AuthContext | null)
| 358 | } |
| 359 | |
| 360 | async findById(id: string, auth?: AuthContext | null): Promise<ServiceWorkflowResponse> { |
| 361 | const organizationId = this.requireOrganizationId(auth); |
| 362 | const record = await this.repository.findById(id, { organizationId }); |
| 363 | if (!record) { |
| 364 | throw new NotFoundException(`Workflow ${id} not found`); |
| 365 | } |
| 366 | const version = await this.versionRepository.findLatestByWorkflowId(id, { organizationId }); |
| 367 | return this.buildWorkflowResponse(record, version ?? null); |
| 368 | } |
| 369 | |
| 370 | private buildWorkflowResponse( |
| 371 | record: WorkflowRecord, |
no test coverage detected