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

import { lazy, number, object, optional, Schema, string } from '../schema';
import { Amount, amountSchema } from './amount';
import { Fee, feeSchema } from './fee';

export interface Offer {
  accountId: string;
  offerId: string;
  offerType: string;
  description: string;
  startDateTime: string;
  endDateTime: string;
  amount?: Amount;
  fee?: Fee;
  value?: number;
  term?: string;
  rate?: string;
}

export const offerSchema: Schema<Offer> = object({
  accountId: ['AccountId', string()],
  offerId: ['OfferId', string()],
  offerType: ['OfferType', string()],
  description: ['Description', string()],
  startDateTime: ['StartDateTime', string()],
  endDateTime: ['EndDateTime', string()],
  amount: ['Amount', optional(lazy(() => amountSchema))],
  fee: ['Fee', optional(lazy(() => feeSchema))],
  value: ['Value', optional(number())],
  term: ['Term', optional(string())],
  rate: ['Rate', optional(string())],
});
