import { IdentityClient, ResetPasswordInfo } from "../../enums";

export class PasswordInfoRequest {
  constructor(public UserName: string) {}
}

export interface PasswordInfoResponse {
  type: ResetPasswordInfo;
}

export class PasswordCheckRequest {
  constructor(public password: string) {}
}

export class PasswordChangeRequest {
  clientId = IdentityClient.ClientId;
  clientSecret = IdentityClient.ClientSecret;

  constructor(public password: string) {}
}

export class PasswordInfoCheckRequest {
  passportSeries: string;
  passportNumber: string;
  userName: string;
  cardMask: string;
  cardExpiryMonth: string;
  cardExpiryYear: string;
  birthDate: number;

  constructor(data: {
    passportSeries?: string;
    passportNumber?: string;
    userName?: string;
    cardMask?: string;
    cardExpiryMonth?: string;
    cardExpiryYear?: string;
    birthDate?: number;
  }) {
    this.passportSeries = data.passportSeries;
    this.passportNumber = data.passportNumber;
    this.userName = data.userName;
    this.cardMask = data.cardMask;
    this.cardExpiryMonth = data.cardExpiryMonth;
    this.cardExpiryYear = data.cardExpiryYear;
    this.birthDate = data.birthDate;
  }
}

export class PasswordResetRequest {
  passportSeries: string;
  passportNumber: string;
  userName: string;
  cardMask: string;
  cardExpiryMonth: string;
  cardExpiryYear: string;
  birthDate: number;
  password: string;
  otpToken: string;

  clientId = IdentityClient.ClientId;
  clientSecret = IdentityClient.ClientSecret;

  constructor(data: {
    passportSeries?: string;
    passportNumber?: string;
    userName?: string;
    cardMask?: string;
    cardExpiryMonth?: string;
    cardExpiryYear?: string;
    birthDate?: number;
    password?: string;
    otpToken?: string;
  }) {
    this.passportSeries = data.passportSeries;
    this.passportNumber = data.passportNumber;
    this.userName = data.userName;
    this.cardMask = data.cardMask;
    this.cardExpiryMonth = data.cardExpiryMonth;
    this.cardExpiryYear = data.cardExpiryYear;
    this.birthDate = data.birthDate;
    this.password = data.password;
    this.otpToken = data.otpToken;
  }
}
