import { objectId } from '@jig-software/zod-bson';
import { z } from 'zod';

export const MfaSessionStatusEnum = z.enum(['Pending', 'Accepted', 'Rejected']);
export type MfaSessionStatusEnum = z.infer<typeof MfaSessionStatusEnum>;

export const MfaSession = z.object({
  _id: objectId(),
  token: z.string(),
  otp: z.string(),
  status: MfaSessionStatusEnum,
  sessionId: z.string(),
  requestedBy: z.string(),
  connectingIp: z.string(),
  expiredAt: z.date(),
  userAgent: z.string(),
});
export type MfaSession = z.infer<typeof MfaSession>;
