Q107: a task approval covers the content it was given; edits need a fresh one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c695fdb0f6
commit
4765683b86
12 files changed
+114
-52
No files matched your search
@@ -23,7 +23,12 @@ interface TaskRow {
|
||||
export class TaskMutations {
|
||||
private readonly audit: AuditService;
|
||||
|
||||
constructor(private readonly db: DatabaseSync, private readonly createTask: (input: CreateTaskInput) => string) {
|
||||
constructor(
|
||||
private readonly db: DatabaseSync,
|
||||
private readonly createTask: (input: CreateTaskInput) => string,
|
||||
/** Asks for a fresh approval when an edit changed content an approval covered. */
|
||||
private readonly requestApproval: (orgId: string, taskId: string) => void,
|
||||
) {
|
||||
this.audit = new AuditService(db);
|
||||
}
|
||||
|
||||
@@ -48,6 +53,7 @@ export class TaskMutations {
|
||||
where id = ? and org_id = ?
|
||||
`).run(input.title.trim(), input.description.trim(), input.assigneeAgentId, input.risk, input.priority, input.parentTaskId, now, input.taskId, input.orgId);
|
||||
if (result.changes === 0) throw new Error("Task was not found.");
|
||||
this.requestApproval(input.orgId, input.taskId);
|
||||
this.audit.record({
|
||||
orgId: input.orgId,
|
||||
entityType: "task",
|
||||
|
||||
Reference in new issue
Block a user