import 'package:flutter/foundation.dart';
import 'package:injectable/injectable.dart';
import 'package:krow/features/clock_manual/data/clock_manual_api_provider.dart';
import 'package:krow/features/clock_manual/domain/clock_manual_repository.dart';

@Singleton(as: ClockManualRepository)
class ClockManualRepositoryImpl implements ClockManualRepository {
  final ClockManualApiProvider apiProvider;

  ClockManualRepositoryImpl({required this.apiProvider});

  @override
  Future<void> trackClientClockin(String positionStaffId) async {
    try {
      await apiProvider.trackClientClockin(positionStaffId);
    } catch (exception) {
      debugPrint(exception.toString());
      rethrow;
    }
  }

  @override
  Future<void> trackClientClockout(String positionStaffId) async {
    try {
      await apiProvider.trackClientClockout(positionStaffId);
    } catch (exception) {
      debugPrint(exception.toString());
      rethrow;
    }
  }

  @override
  Future<void> cancelClockin(String positionStaffId) async{
    try {
      await apiProvider.cancelClockin(positionStaffId);
    } catch (exception) {
      debugPrint(exception.toString());
      rethrow;
    }
  }


}
