import { PAYMENTS_TYPE } from "../constants/app";

export type PaymentsMethod = {
  code: string;
  createdAt: string;
  deletedAt: string;
  displayOrder: number;
  id: number;
  isActive: boolean;
  isDeleted: boolean;
  isVariable: boolean;
  name: string;
  provider: string;
  updatedAt: string;
  paymentFees: Fee[];
};

type Fee = {
  amount: string;
  feeCategory: string;
  name: string;
  id: number;
  type: string;
  value: string;
};

export type Asset = {
  code: string;
  symbol: string;
  displayOrder: number;
  balance: number;
  paymentMethodId: number;
  id: number;
  isVariable: boolean;
  name: string;
  options: Option[];
};

export type Option = {
  id: number;
  name: string;
  symbol: string;
  isActive: boolean;
  minPercentage: number;
  commissions: Commission;
  balance: number;
  restricted: {
    status: boolean;
    msg: string;
  };
} & {
  currentPercentage?: number;
};

export type Commission = {
  base: {
    cv: number;
    vp: number;
  };
  option: {
    cv: number;
    vp: number;
  };
  totalCV: number;
  totalVP: number;
};

export type PaymentType = (typeof PAYMENTS_TYPE)[keyof typeof PAYMENTS_TYPE];
