import { LimitCardType, LimitType, ActionTypes, CardTypes } from "../../enums";
import { Amount, Currency } from "../Money";

export class CheckLimitRequest {
  type?: LimitType;
  cardType?: LimitCardType;
  amount?: Amount;
  serviceId?: number;
  iban?: string;
  isStandingOrder?: boolean;

  constructor(data: {
    type?: number;
    cardType?: number;
    amount?: Amount;
    serviceId?: number;
    iban?: string;
    isStandingOrder?: boolean;
  }) {
    this.type = data.type;
    this.cardType = data.cardType;
    this.amount = data.amount;
    this.serviceId = data.serviceId;
    this.iban = data.iban;
    this.isStandingOrder = data.isStandingOrder;
  }
}

export class FetchFeeRequest {
  ActionType?: ActionTypes;
  SenderCardType?: CardTypes;
  ReceiverCardType?: CardTypes;
  Amount?: Amount;
  SenderBankCode?: number;
  ReceiverBankCode?: number;
  Type?: LimitType;
  ServiceId?: number;
  ExternalIdentifier?: string;
  ReceiverCardId?: string;
  SenderCardId?: string;
  "Amount.Amount": number;
  "Amount.CurrencyCode": Currency;

  constructor(data: {
    ActionType?: ActionTypes;
    SenderCardType?: CardTypes;
    ReceiverCardType?: CardTypes;
    Amount?: Amount;
    SenderBankCode?: number;
    ReceiverBankCode?: number;
    Type?: LimitType;
    ServiceId?: number;
    ExternalIdentifier?: string;
    ReceiverCardId?: string;
    SenderCardId?: string;
    "Amount.Amount": number;
    "Amount.CurrencyCode": Currency;
  }) {
    this.ActionType = data.ActionType;
    this.SenderCardType = data.SenderCardType;
    this.ReceiverCardType = data.ReceiverCardType;
    this.Amount = data.Amount;
    this.SenderBankCode = data.SenderBankCode;
    this.ReceiverBankCode = data.ReceiverBankCode;
    this.Type = data.Type;
    this.ServiceId = data.ServiceId;
    this.ExternalIdentifier = data.ExternalIdentifier;
    this.ReceiverCardId = data.ReceiverCardId;
    this.SenderCardId = data.SenderCardId;
    this["Amount.Amount"] = data["Amount.Amount"];
    this["Amount.CurrencyCode"] = data["Amount.CurrencyCode"];
  }
}
