import 'package:bloc/bloc.dart';

part 'auth_state.dart';

class AuthCubit extends Cubit<AuthState> {
  AuthCubit() : super(AuthInitial());

  String _timeStamp = "";
  String _timeDue = "";

  String get timeStamp => _timeStamp;
  String get timeDue => _timeDue;

  Future<void> sendOTP(String phoneNumber) async {
    emit(AuthLoading());
    
    await Future.delayed(const Duration(seconds: 1));
    
    _timeStamp = DateTime.now().millisecondsSinceEpoch.toString();
    _timeDue = DateTime.now().add(const Duration(minutes: 2)).millisecondsSinceEpoch.toString();
    
    emit(AuthSuccess(phoneNumber: phoneNumber, timeStamp: _timeStamp, timeDue: _timeDue));
  }

  void verifyOTP(String otpCode) {}
}