import 'package:json_annotation/json_annotation.dart';

import 'package:pshared/models/confirmation_target.dart';
import 'package:pshared/api/requests/tokens/session_identifier.dart';

part 'login_confirmation.g.dart';


@JsonSerializable(explicitToJson: true)
class LoginConfirmationRequest {
  final ConfirmationTarget target;
  final String? destination;

  const LoginConfirmationRequest({
    this.target = ConfirmationTarget.login,
    this.destination,
  });

  factory LoginConfirmationRequest.fromJson(Map<String, dynamic> json) => _$LoginConfirmationRequestFromJson(json);
  Map<String, dynamic> toJson() => _$LoginConfirmationRequestToJson(this);
}

@JsonSerializable(explicitToJson: true)
class LoginConfirmationVerifyRequest {
  final ConfirmationTarget target;
  final String code;
  final String? destination;
  final SessionIdentifierDto sessionIdentifier;

  const LoginConfirmationVerifyRequest({
    this.target = ConfirmationTarget.login,
    required this.code,
    this.destination,
    required this.sessionIdentifier,
  });

  factory LoginConfirmationVerifyRequest.fromJson(Map<String, dynamic> json) => _$LoginConfirmationVerifyRequestFromJson(json);
  Map<String, dynamic> toJson() => _$LoginConfirmationVerifyRequestToJson(this);
}
