Impl simple email and phone number validation

This commit is contained in:
Nitwix
2025-04-12 14:53:33 +02:00
parent 5a039d1a9a
commit c6a648a063
4 changed files with 24 additions and 6 deletions

View File

@ -1,6 +1,6 @@
from typing import Literal, Optional, Self
from pydantic import BaseModel, ConfigDict, EmailStr, Field, model_validator
from pydantic_extra_types.phone_numbers import PhoneNumber
class FromAccount(BaseModel):
"""
@ -32,5 +32,5 @@ class FromAccount(BaseModel):
country: str = Field(min_length=1)
name: str = Field(min_length=1)
phone_number: str = Field(min_length=6)
phone_number: PhoneNumber
email: EmailStr

View File

@ -1,2 +1,7 @@
# TODO
# account.reference_currency corresponds to passport.country
# account.reference_currency corresponds to passport.country
# account.country ~ passport.country
# account.city is in account.country