import 'package:krow_core/core.dart';
import 'package:krow_domain/krow_domain.dart';
import '../repositories/availability_repository.dart';

/// Use case to update the availability configuration for a specific day.
class UpdateDayAvailabilityUseCase extends UseCase<UpdateDayAvailabilityParams, DayAvailability> {
  final AvailabilityRepository repository;

  UpdateDayAvailabilityUseCase(this.repository);

  @override
  Future<DayAvailability> call(UpdateDayAvailabilityParams params) {
    return repository.updateDayAvailability(params.availability);
  }
}

/// Parameters for [UpdateDayAvailabilityUseCase].
class UpdateDayAvailabilityParams extends UseCaseArgument {
  final DayAvailability availability;

  const UpdateDayAvailabilityParams(this.availability);

  @override
  List<Object?> get props => [availability];
}
