Files
PaperClipAI/server/src/services/native-environment-settlement-notifications.ts
T
2026-10-31 14:31:31 -05:00

12 lines
834 B
TypeScript

import { notifyNativeHarnessBackupExpiration } from "./native-harness-backup-expiration-notifications.js";
import { notifySkillVersionRetention } from "./skill-version-retention-notifications.js";
import { DELIVERY_QUEUES, notifyDeliveryWork } from "./delivery-work-notifications.js";
export type NativeEnvironmentSettlementScope = { companyId: string; runId?: string; issueId?: string; leaseId?: string };
export async function notifyNativeEnvironmentSettlement(tx: object, scope?: NativeEnvironmentSettlementScope) {
await notifyNativeHarnessBackupExpiration(tx, scope);
if (scope) await notifySkillVersionRetention(tx, scope.companyId);
await notifyDeliveryWork(tx, DELIVERY_QUEUES.nativeEnvironmentSettlement,
scope ? JSON.stringify({ companyId: scope.companyId, runId: scope.runId, issueId: scope.issueId }) : "*");
}