import 'package:krow_core/core.dart';
import 'package:krow_domain/krow_domain.dart';
import '../arguments/sign_up_with_email_arguments.dart';
import '../repositories/auth_repository_interface.dart';

/// Use case for registering a new client user.
///
/// This use case handles the creation of a new client account using
/// email, password, and company details.
class SignUpWithEmailUseCase
    implements UseCase<SignUpWithEmailArguments, User> {
  final AuthRepositoryInterface _repository;

  const SignUpWithEmailUseCase(this._repository);

  /// Executes the sign-up operation.
  @override
  Future<User> call(SignUpWithEmailArguments params) {
    return _repository.signUpWithEmail(
      companyName: params.companyName,
      email: params.email,
      password: params.password,
    );
  }
}
