/**
 * Account information PNZ-API-CentreLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { lazy, object, Schema, string } from '../schema';
import { CreditorAccount1, creditorAccount1Schema } from './creditorAccount1';
import { CreditorAgent1, creditorAgent1Schema } from './creditorAgent1';
import { InstructedAmount, instructedAmountSchema } from './instructedAmount';
import { Reference, referenceSchema } from './reference';

export interface ScheduledPayment {
  accountId: string;
  scheduledType: string;
  instructedAmount: InstructedAmount;
  scheduledPaymentDateTime: string;
  scheduledPaymentId: string;
  reference: Reference;
  creditorAccount: CreditorAccount1;
  creditorAgent: CreditorAgent1;
}

export const scheduledPaymentSchema: Schema<ScheduledPayment> = object({
  accountId: ['AccountId', string()],
  scheduledType: ['ScheduledType', string()],
  instructedAmount: ['InstructedAmount', lazy(() => instructedAmountSchema)],
  scheduledPaymentDateTime: ['ScheduledPaymentDateTime', string()],
  scheduledPaymentId: ['ScheduledPaymentId', string()],
  reference: ['Reference', lazy(() => referenceSchema)],
  creditorAccount: ['CreditorAccount', lazy(() => creditorAccount1Schema)],
  creditorAgent: ['CreditorAgent', lazy(() => creditorAgent1Schema)],
});
