import { v4 } from "uuid";
import { getOrganisationStore } from "./store.js";
export async function setOrganisation(data) {
    const store = getOrganisationStore();
    const organisationId = data.organisationId || v4();
    const updatedAt = new Date().toISOString();
    const createdAt = data.createdAt || updatedAt;
    const organisation = {
        approved: false,
        approvedAt: undefined,
        approvedByUserId: undefined,
        ...data,
        organisationId,
        createdAt,
        updatedAt,
    };
    await store.set(organisationId, organisation);
    return organisation;
}
//# sourceMappingURL=set-organisation.js.map