import { z } from 'zod'

export const UserSchema = z.object({
  id: z.string(),
  email: z.string().email(),
  firstName: z.string().min(1),
  lastName: z.string().min(1),
  role: z.enum(['admin', 'trainer', 'client']),
  createdAt: z.date(),
  updatedAt: z.date(),
})

export const ClientSchema = z.object({
  id: z.string(),
  userId: z.string(),
  membershipType: z.enum(['basic', 'premium', 'vip']),
  membershipStatus: z.enum(['active', 'inactive', 'suspended']),
  joinDate: z.date(),
  lastVisit: z.date().optional(),
  emergencyContact: z.object({
    name: z.string(),
    phone: z.string(),
    relationship: z.string(),
  }),
})

export const PaymentSchema = z.object({
  id: z.string(),
  clientId: z.string(),
  amount: z.number().positive(),
  currency: z.string(),
  status: z.enum(['pending', 'completed', 'failed', 'refunded']),
  paymentMethod: z.enum(['cash', 'card', 'bank_transfer']),
  dueDate: z.date(),
  paidAt: z.date().optional(),
  description: z.string(),
})

export const AttendanceSchema = z.object({
  id: z.string(),
  clientId: z.string(),
  checkInTime: z.date(),
  checkOutTime: z.date().optional(),
  type: z.enum(['gym', 'class', 'personal_training']),
  notes: z.string().optional(),
})