/**
 * Shell Card Management APIsLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { nullable, number, object, optional, Schema } from '../schema';

export interface UsageRestrictionsCard {
  /**
   * Maximum spend value (amount) allowed per day.
   * Optional
   * It allows null in the input field. If Values is passed as null, apply the card type limit. However, if the card type limit is NULL for the same field then No limit will be applied in Gateway.
   */
  dailySpend?: number | null;
  /**
   * Maximum spend value (amount) allowed per week.
   * Optional
   */
  weeklySpend?: number | null;
  /**
   * Maximum spend value (amount) allowed per month.
   * Optional
   */
  monthlySpend?: number | null;
  /**
   * Maximum spend value (amount) allowed per transaction.
   * Optional
   */
  perTransactionSpend?: number | null;
  /**
   * Maximum spend value (amount) allowed per annum.
   * Optional
   */
  annualSpend?: number | null;
  /**
   * Maximum spend value (amount) allowed in card’s life time.
   * Optional
   */
  lifeTimeSpend?: number | null;
  /**
   * Maximum volume (quantity) allowed per day.
   * Optional
   */
  dailyVolume?: number | null;
  /**
   * Maximum volume (quantity) allowed per week.
   * Optional
   */
  weeklyVolume?: number | null;
  /**
   * Maximum volume (quantity) allowed per month.
   * Optional
   */
  monthlyVolume?: number | null;
  /**
   * Maximum volume (quantity) allowed per transaction.
   * Optional
   */
  perTransactionVolume?: number;
  /**
   * Maximum volume (quantity) allowed per annum.
   * Optional
   */
  annualVolume?: number | null;
  /**
   * Maximum volume (quantity) allowed in card’s life time.
   * Optional
   */
  lifeTimeVolume?: number;
  /**
   * Maximum number of transactions allowed per day.
   * Optional
   */
  dailyTransactionCount?: number | null;
  /**
   * Maximum number of transactions allowed per week.
   * Optional
   */
  weeklyTransactionCount?: number | null;
  /**
   * Maximum number of transactions allowed per month.
   * Optional.
   */
  monthlyTransactionCount?: number | null;
  /** Maximum number of transactions allowed per annum. */
  annualTransactionCount?: number | null;
  /**
   * Maximum number of transactions allowed in card’s lifetime.
   * Optional
   */
  lifeTimeTransactionCount?: number | null;
}

export const usageRestrictionsCardSchema: Schema<UsageRestrictionsCard> = object(
  {
    dailySpend: ['DailySpend', optional(nullable(number()))],
    weeklySpend: ['WeeklySpend', optional(nullable(number()))],
    monthlySpend: ['MonthlySpend', optional(nullable(number()))],
    perTransactionSpend: ['PerTransactionSpend', optional(nullable(number()))],
    annualSpend: ['AnnualSpend', optional(nullable(number()))],
    lifeTimeSpend: ['LifeTimeSpend', optional(nullable(number()))],
    dailyVolume: ['DailyVolume', optional(nullable(number()))],
    weeklyVolume: ['WeeklyVolume', optional(nullable(number()))],
    monthlyVolume: ['MonthlyVolume', optional(nullable(number()))],
    perTransactionVolume: ['PerTransactionVolume', optional(number())],
    annualVolume: ['AnnualVolume', optional(nullable(number()))],
    lifeTimeVolume: ['LifeTimeVolume', optional(number())],
    dailyTransactionCount: [
      'DailyTransactionCount',
      optional(nullable(number())),
    ],
    weeklyTransactionCount: [
      'WeeklyTransactionCount',
      optional(nullable(number())),
    ],
    monthlyTransactionCount: [
      'MonthlyTransactionCount',
      optional(nullable(number())),
    ],
    annualTransactionCount: [
      'AnnualTransactionCount',
      optional(nullable(number())),
    ],
    lifeTimeTransactionCount: [
      'LifeTimeTransactionCount',
      optional(nullable(number())),
    ],
  }
);
