Actualiza la gestión de teléfonos en ServicioAT - #82
Open
EstebanSM85 wants to merge 2 commits into
Open
Conversation
- Se añade lógica para actualizar automáticamente los teléfonos del servicio al cambiar el cliente, siempre que no se hayan modificado manualmente. - Se implementan pruebas para verificar el comportamiento de actualización de teléfonos al cambiar de cliente, incluyendo la preservación de números manualmente modificados. Archivos modificados: - ServicioAT.php - ServicioAtTest.php
daniel89fg
requested changes
Aug 6, 2026
| // si cambiamos el cliente y los teléfonos no se han modificado manualmente, | ||
| // los actualizamos con los del nuevo cliente | ||
| $oldCustomer = $this->getCustomer($this->getOriginal('codcliente') ?? ''); | ||
| if ($this->telefono1 == $oldCustomer->telefono1 && $this->telefono2 == $oldCustomer->telefono2) { |
Member
There was a problem hiding this comment.
esto debería ser un OR no un AND, ya que puede cambiar el teléfono 1 pero no el 2, si alguno de los dos cambia actualizamos los 2, o haces dos comprobaciones diferentes
Contributor
Author
There was a problem hiding this comment.
He separado las comprobaciones de telefono 1 y 2 para asi cubrir todos los casos:
Modificas solo teléfono 1 → al cambiar de cliente, teléfono 1 se mantiene (tu valor manual), teléfono 2 se actualiza al del nuevo cliente.
Modificas teléfono 1 y teléfono 2 → ninguno cambia, se preservan ambos valores manuales.
Modificas solo teléfono 2 → teléfono 2 se mantiene, teléfono 1 se actualiza al del nuevo cliente.
Si no modificas ninguno → ambos se actualizan al nuevo cliente.
- Modifica la función de cambio de cliente para que solo actualice el teléfono 2 si no ha sido modificado manualmente. - Añade una nueva prueba en ServicioAtTest para verificar el comportamiento esperado al cambiar de cliente con teléfonos distintos. Archivos modificados: - ServicioAT.php - ServicioAtTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.