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

/**
 * Schema for BonusCardDTO
 * Represents bonus card information with proper type matching
 *
 * Note: cardProvider is a number in the API, and dates are returned as strings
 */
export const BonusCardSchema = z
  .object({
    bonusValue: z.number().describe('Bonus value').optional(),
    cardNumber: z.string().describe('Card number').optional(),
    cardProvider: z.number().describe('Card provider').optional(),
    isLocked: z.boolean().describe('Whether locked').optional(),
    isPaymentEnabled: z.boolean().describe('Whether paymentEnabled').optional(),
    markedAsLost: z.string().describe('Marked as lost').optional(),
    suspensionComment: z.string().describe('Suspension comment').optional(),
    validFrom: z.string().describe('Validity start date').optional(),
    validThrough: z.string().describe('Valid through').optional(),
  })
  .extend(EntitySchema.shape);
