export default async function editInventory(db, id, data) {
  const editedInventory = {
    updatedAt: new Date(),
    ...data,
  };
  if (data.locationId) {
    editedInventory.location = db.document("locations", data === null || data === void 0 ? void 0 : data.locationId);
  }
  if (data.equipmentId) {
    editedInventory.equipment = db.document("equipment", data === null || data === void 0 ? void 0 : data.equipmentId);
  }
  return db.update("inventories", id, editedInventory);
}
