Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions lambda_function.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -71,25 +71,13 @@ def create_participant_object(participant_data):
if participant_data.get("time_checkin")
else None
),
checkin_latitude=(
float(participant_data.get("checkin_latitude"))
if participant_data.get("checkin_latitude")
else None
),
checkin_longitude=(
float(participant_data.get("checkin_longitude"))
if participant_data.get("checkin_longitude")
else None
),
)

# Create Participant object
participant = Participant(
first_name=participant_data.get("first_name"),
last_name=participant_data.get("last_name"),
email=participant_data.get("email"),
phone=participant_data.get("phone"),
cpf=participant_data.get("cpf", ""),
certificate=certificate,
event=event,
)
Expand Down
2 changes: 0 additions & 2 deletions models/event.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,5 +9,3 @@ class Event(BaseModel):
product_name: str
date: datetime
time_checkin: Optional[datetime] = None
checkin_latitude: Optional[float] = None
checkin_longitude: Optional[float] = None
2 changes: 0 additions & 2 deletions models/participant.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,6 @@ class Participant(BaseModel):
first_name: str
last_name: str
email: EmailStr
phone: str
cpf: str
validation_code: Optional[str] = Field(
default_factory=lambda: "".join(random.choices(string.hexdigits, k=9)),
init=False,
Expand Down
12 changes: 0 additions & 12 deletions tests/test_certified_builder.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,8 +27,6 @@ def mock_event():
product_name="Evento de Teste",
date=datetime.strptime("2025-03-26 20:55:25", "%Y-%m-%d %H:%M:%S"),
time_checkin=datetime.strptime("2025-03-26 20:55:44", "%Y-%m-%d %H:%M:%S"),
checkin_latitude=-27.5460492,
checkin_longitude=-48.6227075,
)


Expand All@@ -38,8 +36,6 @@ def mock_participant(mock_certificate, mock_event):
first_name="Jardel",
last_name="Godinho",
email="jardelgodinho@gmail.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)
Expand DownExpand Up@@ -451,8 +447,6 @@ def test_build_certificates_with_multiple_participants_same_resources(
first_name="Maria",
last_name="Silva",
email="maria@example.com",
phone="(48) 99999-9999",
cpf="111.111.111-11",
certificate=mock_participant.certificate,
event=mock_participant.event,
)
Expand DownExpand Up@@ -507,8 +501,6 @@ def test_build_certificates_with_different_backgrounds(
first_name="João",
last_name="Santos",
email="joao@example.com",
phone="(48) 88888-8888",
cpf="222.222.222-22",
certificate=second_certificate,
event=mock_participant.event,
)
Expand DownExpand Up@@ -627,16 +619,12 @@ def test_generate_certificate_with_long_name(
product_name="Evento Teste",
date=datetime.now(),
time_checkin=datetime.now(),
checkin_latitude=0.0,
checkin_longitude=0.0,
)

long_name_participant = Participant(
first_name="João Pedro",
last_name="da Silva Santos Oliveira",
email="joao@example.com",
phone="(48) 99999-9999",
cpf="123.456.789-00",
certificate=mock_certificate,
event=mock_event,
)
Expand Down
28 changes: 0 additions & 28 deletions tests/test_participant.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,8 +23,6 @@ def mock_event():
product_name="Evento de Teste",
date=datetime.strptime("2025-03-26 20:55:25", "%Y-%m-%d %H:%M:%S"),
time_checkin=datetime.strptime("2025-03-26 20:55:44", "%Y-%m-%d %H:%M:%S"),
checkin_latitude=-27.5460492,
checkin_longitude=-48.6227075,
)


Expand All@@ -33,17 +31,13 @@ def test_participant_initialization(mock_certificate, mock_event):
first_name="Jardel",
last_name="Godinho",
email="jardelgodinho@gmail.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)

assert participant.first_name == "Jardel"
assert participant.last_name == "Godinho"
assert participant.email == "jardelgodinho@gmail.com"
assert participant.phone == "(48) 98866-7447"
assert participant.cpf == "000.000.000-00"
assert participant.certificate == mock_certificate
assert participant.event == mock_event
assert len(participant.validation_code) == 9
Expand All@@ -54,8 +48,6 @@ def test_name_completed(mock_certificate, mock_event):
first_name="Jardel",
last_name="Godinho",
email="jardelgodinho@gmail.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)
Expand All@@ -67,8 +59,6 @@ def test_formated_validation_code(mock_certificate, mock_event):
first_name="Jardel",
last_name="Godinho",
email="jardelgodinho@gmail.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)
Expand All@@ -83,8 +73,6 @@ def test_create_name_certificate(mock_certificate, mock_event):
first_name="Jardel",
last_name="Godinho",
email="jardelgodinho@gmail.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)
Expand All@@ -101,8 +89,6 @@ def test_invalid_email(mock_certificate, mock_event):
first_name="Jardel",
last_name="Godinho",
email="invalid-email",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)
Expand All@@ -114,8 +100,6 @@ def test_missing_required_field(mock_certificate, mock_event):
Participant(
first_name="Jardel",
email="jardelgodinho@gmail.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)
Expand All@@ -126,8 +110,6 @@ def test_name_completed_with_multiple_names(mock_certificate, mock_event):
first_name="Jardel Silva",
last_name="Godinho Santos",
email="jardelgodinho@gmail.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)
Expand All@@ -145,16 +127,12 @@ def test_sanitize_filename_special_characters(mock_certificate):
product_name="87º Python Floripa × CODECON @ UNICESUSC",
date=datetime.strptime("2025-03-26 20:55:25", "%Y-%m-%d %H:%M:%S"),
time_checkin=datetime.strptime("2025-03-26 20:55:44", "%Y-%m-%d %H:%M:%S"),
checkin_latitude=-27.5460492,
checkin_longitude=-48.6227075,
)

participant = Participant(
first_name="Rodrigo",
last_name="Farah",
email="rodrigo@example.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=event_with_special_chars,
)
Expand All@@ -180,16 +158,12 @@ def test_create_name_certificate_with_special_characters(mock_certificate):
product_name="87º Python Floripa × CODECON @ UNICESUSC",
date=datetime.strptime("2025-06-19 11:15:31", "%Y-%m-%d %H:%M:%S"),
time_checkin=datetime.strptime("2025-06-19 11:15:31", "%Y-%m-%d %H:%M:%S"),
checkin_latitude=-27.5460492,
checkin_longitude=-48.6227075,
)

participant = Participant(
first_name="Rodrigo",
last_name="Farah",
email="rodrigo.farah@example.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=event_with_special_chars,
)
Expand DownExpand Up@@ -221,8 +195,6 @@ def test_sanitize_filename_edge_cases(mock_certificate, mock_event):
first_name="Test",
last_name="User",
email="test@example.com",
phone="(48) 98866-7447",
cpf="000.000.000-00",
certificate=mock_certificate,
event=mock_event,
)
Expand Down
Loading