@DataClass()
class User {
@KeyPath()
@Validate(v => v.length > 0, 'ID cannot be empty')
id: string;
@Validate(v => v.includes('@'), 'Invalid email')
@Index({ unique: true })
email: string;
@Validate(v => v >= 0 && v <= 150, 'Age must be 0-150')
age: number;
}