import { EntitySchema, PaymentTypeSchema } from '@isa/common/data-access';
import { z } from 'zod';

export const DisplayOrderPaymentSchema = z
  .object({
    paymentActionRequired: z.boolean().describe('Payment action required'),
    paymentType: PaymentTypeSchema.describe('Payment type'),
    paymentNumber: z.string().describe('Payment number').optional(),
    paymentComment: z.string().describe('Payment comment').optional(),
    total: z.number().describe('Total amount'),
    subtotal: z.number().describe('Subtotal').optional(),
    shipping: z.number().describe('Shipping').optional(),
    tax: z.number().describe('Tax amount').optional(),
    currency: z.string().describe('Currency code').optional(),
    dateOfPayment: z.string().describe('Date of payment').optional(),
    completed: z.string().describe('Completed').optional(),
    cancelled: z.string().describe('Cancelled').optional(),
  })
  .extend(EntitySchema.shape);

export type DisplayOrderPayment = z.infer<typeof DisplayOrderPaymentSchema>;
