fix(api): make task updates transactional
This commit is contained in:
1 parent
19f8494d09
commit
7a1dd647aa
8 files changed
+584
-178
No files matched your search
@@ -5,6 +5,7 @@ import { buildTaskQueryMethods } from "./task-queries";
|
||||
import { buildTaskSessionMethods } from "./task-sessions-crud";
|
||||
import { buildTaskStatusMethods } from "./tasks-status";
|
||||
import { buildTasksPhaseMethods } from "./tasks-phase";
|
||||
import { buildTaskUpdateMethods } from "./tasks-update";
|
||||
|
||||
export function buildTaskMethods(
|
||||
getDb: () => DatabaseSync,
|
||||
@@ -13,6 +14,17 @@ export function buildTaskMethods(
|
||||
deps: {
|
||||
addComment: (input: { companyId: string; taskId: string; authorAgentId: string | null; authorName: string; body: string }) => void;
|
||||
addActivity: (input: { companyId: string; actor: string; action: string; entityType: string; entityId: string; detail: string }) => void;
|
||||
requestApproval: (input: {
|
||||
companyId: string;
|
||||
relatedTaskId?: string | null;
|
||||
requestedByAgentId?: string | null;
|
||||
relatedAgentId?: string | null;
|
||||
type: string;
|
||||
payloadSummary: string;
|
||||
impactSummary: string;
|
||||
payloadJson?: string | null;
|
||||
}) => string;
|
||||
setHeartbeat: (agentId: string, enabled: boolean, intervalSec: number) => void;
|
||||
},
|
||||
) {
|
||||
return {
|
||||
@@ -20,6 +32,7 @@ export function buildTaskMethods(
|
||||
...buildTaskQueryMethods(getDb, readAll, transaction),
|
||||
...buildTaskSessionMethods(getDb, readAll, transaction),
|
||||
...buildTaskStatusMethods(getDb, readAll, transaction, deps),
|
||||
...buildTaskUpdateMethods(getDb, readAll, transaction, deps),
|
||||
...buildTasksPhaseMethods(getDb),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user