import { getChangeStore } from "./store.js";
import { v4 } from "uuid";
export async function setChange(data) {
    const updatedAt = new Date().toISOString();
    const changeId = data.changeId || v4();
    const status = data.status || "pending";
    const document = {
        createdAt: data.createdAt || updatedAt,
        changeId,
        ...data,
        status,
        updatedAt,
    };
    const store = await getChangeStore(document);
    await store.set(data.changeId, document);
    return document;
}
//# sourceMappingURL=set-change.js.map