(auth: AuthContext | null, id: string)
| 208 | } |
| 209 | |
| 210 | async pause(auth: AuthContext | null, id: string): Promise<WorkflowSchedule> { |
| 211 | const existing = await this.findOwnedScheduleOrThrow(id, auth); |
| 212 | await this.workflowsService.ensureWorkflowAdminAccess(existing.workflowId, auth); |
| 213 | const temporalScheduleId = existing.temporalScheduleId ?? existing.id; |
| 214 | if (temporalScheduleId) { |
| 215 | await this.temporalService.pauseSchedule(temporalScheduleId); |
| 216 | } |
| 217 | const updated = await this.repository.update( |
| 218 | existing.id, |
| 219 | { status: 'paused' }, |
| 220 | { organizationId: existing.organizationId }, |
| 221 | ); |
| 222 | return this.mapRecord(updated ?? existing); |
| 223 | } |
| 224 | |
| 225 | async resume(auth: AuthContext | null, id: string): Promise<WorkflowSchedule> { |
| 226 | const existing = await this.findOwnedScheduleOrThrow(id, auth); |
no test coverage detected