update to python fastpi

This commit is contained in:
Iliyan Angelov
2025-11-16 15:59:05 +02:00
parent 93d4c1df80
commit 98ccd5b6ff
4464 changed files with 773233 additions and 13740 deletions

View File

@@ -0,0 +1,95 @@
import * as yup from 'yup';
/**
* Login Validation Schema
*/
export const loginSchema = yup.object().shape({
email: yup
.string()
.required('Email is required')
.email('Invalid email')
.trim(),
password: yup
.string()
.required('Password is required')
.min(8, 'Password must be at least 8 characters'),
rememberMe: yup
.boolean()
.optional(),
});
/**
* Register Validation Schema
*/
export const registerSchema = yup.object().shape({
name: yup
.string()
.required('Full name is required')
.min(2, 'Full name must be at least 2 characters')
.max(50, 'Full name must not exceed 50 characters')
.trim(),
email: yup
.string()
.required('Email is required')
.email('Invalid email')
.trim(),
password: yup
.string()
.required('Password is required')
.min(8, 'Password must be at least 8 characters')
.matches(
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])/,
'Password must contain uppercase, lowercase, ' +
'number and special character'
),
confirmPassword: yup
.string()
.required('Please confirm password')
.oneOf([yup.ref('password')], 'Passwords do not match'),
phone: yup
.string()
.optional()
.matches(
/^[0-9]{10,11}$/,
'Invalid phone number'
),
});
/**
* Forgot Password Validation Schema
*/
export const forgotPasswordSchema = yup.object().shape({
email: yup
.string()
.required('Email is required')
.email('Invalid email')
.trim(),
});
/**
* Reset Password Validation Schema
*/
export const resetPasswordSchema = yup.object().shape({
password: yup
.string()
.required('New password is required')
.min(8, 'Password must be at least 8 characters')
.matches(
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])/,
'Password must contain uppercase, lowercase, ' +
'number and special character'
),
confirmPassword: yup
.string()
.required('Please confirm password')
.oneOf([yup.ref('password')], 'Passwords do not match'),
});
// Types
export type LoginFormData = yup.InferType<typeof loginSchema>;
export type RegisterFormData =
yup.InferType<typeof registerSchema>;
export type ForgotPasswordFormData =
yup.InferType<typeof forgotPasswordSchema>;
export type ResetPasswordFormData =
yup.InferType<typeof resetPasswordSchema>;