import { IdentityClient } from "@/enums";
import { Card, Customer } from "@/models";
import { Money } from "../Money";

export class UserCheckRequest {
  constructor(public Username: string) {}
}

export class LogoutRequest {
  ClientId = IdentityClient.ClientId;
  ClientSecret = IdentityClient.ClientSecret;

  constructor(
    public Username: string,
    public RefreshToken: string,
    public Authorization?: string
  ) {}
}

export class TokenRequest {
  ClientId = IdentityClient.ClientId;
  ClientSecret = IdentityClient.ClientSecret;

  constructor(public RefreshToken: string) {}
}

export interface TokenResponse {
  token: string;
  refreshToken: string;
}

export class CreateUserRequest {
  ClientId = IdentityClient.ClientId;
  ClientSecret = IdentityClient.ClientSecret;

  constructor(
    public Username: string,
    public Password: string,
    public OtpToken: string
  ) {}
}
export class UserLoginRequest {
  ClientId = IdentityClient.ClientId;
  ClientSecret = IdentityClient.ClientSecret;

  constructor(public Username: string, public Password: string) {}
}
export class GetUserRequest {
  ClientId = IdentityClient.ClientId;
  ClientSecret = IdentityClient.ClientSecret;

  constructor(public GetNewToken: boolean = true) {}
}

export interface UserLoginResponse {
  user: User;
  taxNumber?: string;
  amount?: number;
}

export interface UserWithTaxNumberResponse {
  user: User;
  taxNumber: string;
}

export interface User {
  token: string;
  refreshToken: string;
  userName: string;
  referralUrl: string;
  flags: number;
  customer: Customer;
  cards: Card[];
  balance: Money;
  email: string;
  defaultCardType: number;
  imageUrl: string;
  passwordChangeRequired: boolean;
  userTags: string[];
  playerToken: string;
  unreadMessagesCount: number;
}
