SharezoneApp / sharezone-app

Sharezone is a collaborative school organization app for iOS, Android, macOS and web with +500,000 downloads. Built with Flutter & Firebase.
https://sharezone.net
European Union Public License 1.2
254 stars 46 forks source link

Add deleting custom grade types. #1597

Closed Jonas-Sander closed 1 month ago

Jonas-Sander commented 1 month ago

Add GradeService.deleteCustomGradeType:

  /// Deletes a custom grade type and removes it from all weight maps.
  ///
  /// A custom grade type can only be deleted if it is not assigned to any grade
  /// or as the final grade type of any term, otherwise a
  /// [GradeTypeStillAssignedException] is thrown.
  ///
  /// Throws [GradeTypeNotFoundException] if the grade type with the given [id]
  /// does not exist.
  ///
  /// Throws [ArgumentError] if the grade type with the given [id] is a
  /// predefined grade type.
  void deleteCustomGradeType(GradeTypeId id) {

Fixes #1532

github-actions[bot] commented 1 month ago

Visit the preview URL for this PR (updated for commit d035e9f):

https://sharezone-test--pr1597-delete-custom-grade-xufzkkiw.web.app

(expires Mon, 06 May 2024 15:21:55 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4cb3ae61e1e018abfd9841fd3239f5b49ccc034b