atlp-rwanda/hackers-ec-Fe

View on GitHub
src/validations/OTP.validation.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { z } from 'zod';

export const OTPSchema = z.object({
    otp: z.string().refine((value) => /^\d{6}$/.test(value), {
        message: 'OTP must be a 6-digit number',
    }),
});

export type OTPSchemaType = z.infer<typeof OTPSchema>;