/**
 * Account and Transaction API SpecificationLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { lazy, object, Schema } from '../schema';
import { Amount, amountSchema } from './amount';
import {
  CreditDebitIndicatorEnum,
  creditDebitIndicatorEnumSchema,
} from './creditDebitIndicatorEnum';
import {
  StatementAmountTypeEnum,
  statementAmountTypeEnumSchema,
} from './statementAmountTypeEnum';

/** Set of elements used to provide details of a generic amount for the statement resource. */
export interface StatementAmount {
  /** Amount of money of the cash balance. */
  amount: Amount;
  /** Indicates whether the balance is a credit or a debit balance. Usage: A zero balance is considered to be a credit balance. */
  creditDebitIndicator: CreditDebitIndicatorEnum;
  /** Amount type, in a coded form. */
  type: StatementAmountTypeEnum;
}

export const statementAmountSchema: Schema<StatementAmount> = object({
  amount: ['Amount', lazy(() => amountSchema)],
  creditDebitIndicator: [
    'CreditDebitIndicator',
    creditDebitIndicatorEnumSchema,
  ],
  type: ['Type', statementAmountTypeEnumSchema],
});
