export default async function addDot(db, data) {
  const id = db.getDocumentId();
  const docData = {
    ...data,
    id,
    job: ((data === null || data === void 0 ? void 0 : data.jobId) && db.document("jobs", data.jobId)) || null,
    site: (data.siteId && db.document("sites", data.siteId)) || null,
    material: (data.materialId && db.document("materials", data.materialId)) || null,
    createdAt: new Date(),
  };
  await db.add("dots", docData, id);
  return docData;
}
