This branch snapshots the in-progress desktop workspace so GitHub-hosted Windows and Linux runners can package the same source tree that already passes local verification on macOS. Constraint: Local Apple Silicon Docker/Wine packaging crashes before Windows artifacts are produced Rejected: Publish from the incomplete base repo state | remote typecheck failed because current source additions were missing Confidence: medium Scope-risk: broad Directive: Treat this branch as a build snapshot only; do not merge it without reviewing the unrelated workspace changes it contains Tested: local typecheck, lint, workspace typecheck, unit tests, integration tests, e2e smoke, macOS signed release upload Not-tested: Native Windows/Linux artifacts before this CI run
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import type { AppDatabase } from "./database";
|
|
import { shouldAutoApprove } from "./execution-policy";
|
|
|
|
export function shouldAutoApproveApproval(
|
|
db: AppDatabase,
|
|
companyId: string,
|
|
approvalType: string,
|
|
): boolean {
|
|
return shouldAutoApprove(db, companyId, approvalType);
|
|
}
|
|
|
|
export function resolveApprovalDecision({
|
|
db,
|
|
handleApprovalResolved,
|
|
companyId,
|
|
approvalId,
|
|
state,
|
|
decisionNote,
|
|
detail,
|
|
actor = "board",
|
|
}: {
|
|
db: AppDatabase;
|
|
handleApprovalResolved: (approvalId: string, companyId: string, decision: string) => void;
|
|
companyId: string;
|
|
approvalId: string;
|
|
state: "approved" | "rejected" | "revision_requested";
|
|
decisionNote?: string;
|
|
detail?: string | null;
|
|
actor?: string;
|
|
}) {
|
|
db.decideApproval({
|
|
companyId,
|
|
approvalId,
|
|
state,
|
|
decisionNote: decisionNote ?? "",
|
|
});
|
|
db.addActivity({
|
|
companyId,
|
|
actor,
|
|
action: `approval.${state}`,
|
|
entityType: "approval",
|
|
entityId: approvalId,
|
|
detail: detail ?? decisionNote ?? "",
|
|
});
|
|
handleApprovalResolved(approvalId, companyId, state);
|
|
}
|