exec method

Future<void> exec(
  1. {required String rehabilitationId,
  2. required String endReasonText}
)

リハビリテーションを終了する。

指定されたリハビリテーションIDに基づいて、サーバー上のリハビリテーションを終了します。

Parameters:

  • rehabilitationId : 終了するリハビリテーションのID
  • endReasonText : リハビリテーションを終了する理由のテキスト

Return: Future が返されます。このFutureは、操作が完了すると完了します。

使用するリポジトリ:

  • RehabilitationRepository : リハビリテーションのデータ操作を管理するリポジトリ 使用するAPI:
  • RehabilitationApi.updateRehabilitationEnd : リハビリテーションの終了を行うAPI

Implementation

Future<void> exec({
  required String rehabilitationId,
  required String endReasonText,
}) async {
  try {
    await _rehabilitationRepository.endRehabilitation(
      rehabilitationId: rehabilitationId,
      endReasonText: endReasonText,
    );
  } on RepositoryException catch (error, stackTrace) {
    throw _errorHandler.handleRepositoryError(error, stackTrace);
  } catch (error, stackTrace) {
    throw _errorHandler.handleUnknownError(error, stackTrace);
  }
}