(opts: DoneOptions)
| 33 | }; |
| 34 | |
| 35 | export async function done(opts: DoneOptions): Promise<WlResult<DoneOutcome>> { |
| 36 | try { |
| 37 | const stmts = submitCompletionDML({ |
| 38 | completionId: opts.completionId, |
| 39 | wantedId: opts.wantedId, |
| 40 | rigHandle: opts.ctx.rigHandle, |
| 41 | evidence: opts.evidence, |
| 42 | hopUri: opts.hopUri, |
| 43 | }); |
| 44 | const outcome = await applyMutation({ |
| 45 | ctx: opts.ctx, |
| 46 | wantedId: opts.wantedId, |
| 47 | targetStatus: 'in_review', |
| 48 | statements: stmts, |
| 49 | commitMessage: `wl done: ${opts.wantedId}`, |
| 50 | }); |
| 51 | return { ok: true, data: { ...outcome, completionId: opts.completionId } }; |
| 52 | } catch (err) { |
| 53 | if (err instanceof WlError) return { ok: false, error: err }; |
| 54 | return { ok: false, error: new WlError('done failed', 'internal', err) }; |
| 55 | } |
| 56 | } |
no test coverage detected