(auth: AuthContext | null, id: string)
| 192 | } |
| 193 | |
| 194 | async delete(auth: AuthContext | null, id: string): Promise<void> { |
| 195 | const existing = await this.findOwnedScheduleOrThrow(id, auth); |
| 196 | await this.workflowsService.ensureWorkflowAdminAccess(existing.workflowId, auth); |
| 197 | const temporalScheduleId = existing.temporalScheduleId ?? existing.id; |
| 198 | if (temporalScheduleId) { |
| 199 | await this.temporalService.deleteSchedule(temporalScheduleId).catch((error) => { |
| 200 | this.logger.warn( |
| 201 | `Failed to delete Temporal schedule ${temporalScheduleId}: ${ |
| 202 | error instanceof Error ? error.message : String(error) |
| 203 | }`, |
| 204 | ); |
| 205 | }); |
| 206 | } |
| 207 | await this.repository.delete(existing.id, { organizationId: existing.organizationId }); |
| 208 | } |
| 209 | |
| 210 | async pause(auth: AuthContext | null, id: string): Promise<WorkflowSchedule> { |
| 211 | const existing = await this.findOwnedScheduleOrThrow(id, auth); |
no test coverage detected