enum CommitmentType { TASK, SESSION, HABIT }

CommitmentType getCommitmentType(String? name) {
  for (CommitmentType value in CommitmentType.values) {
    if (value.name == name) {
      return value;
    }
  }
  return CommitmentType.TASK;
}
