Kontakte - Telefonnummern und E-Mail-Adressen Bearbeiten ist drin
Dieser Commit ist enthalten in:
@@ -114,6 +114,27 @@ class LeadService:
|
||||
|
||||
return detail
|
||||
|
||||
def update_contact_detail(self, detail_id: UUID, detail_value: str,
|
||||
detail_label: str = None, user: str = None) -> Dict[str, Any]:
|
||||
"""Update a contact detail (phone/email)"""
|
||||
if not detail_value or len(detail_value.strip()) == 0:
|
||||
raise ValueError("Detail value cannot be empty")
|
||||
|
||||
# Get current detail to check type
|
||||
current_detail = self.repo.get_contact_detail_by_id(detail_id)
|
||||
if not current_detail:
|
||||
raise ValueError("Contact detail not found")
|
||||
|
||||
# Validation based on type
|
||||
if current_detail['detail_type'] == 'email' and '@' not in detail_value:
|
||||
raise ValueError("Invalid email format")
|
||||
|
||||
detail = self.repo.update_contact_detail(
|
||||
detail_id, detail_value.strip(), detail_label
|
||||
)
|
||||
|
||||
return detail
|
||||
|
||||
def delete_contact_detail(self, detail_id: UUID, user: str) -> bool:
|
||||
"""Delete a contact detail (phone/email)"""
|
||||
success = self.repo.delete_contact_detail(detail_id)
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren