Commit a1ab1144 authored by Noel Alonso's avatar Noel Alonso
Browse files

Si existe el item, lo trata como una edición

parent 425dc82c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -51,8 +51,9 @@ public class PersistenceAggregate extends Aggregate {
		String id = cmd.getPersistence().getId();

		if (exist(id)) {
			logger.info("Descartando selección " + id + ". Ya está registrado.");
			return null; // Se lanza excepción en el origen no aquí
			Event state = getStateFromHistory(id);
			loadFromHistory(state);
			checkState(id, state.getType());
		}

		this.setAggregateId(id);
+3 −2
Original line number Diff line number Diff line
@@ -51,8 +51,9 @@ public class SelectionAggregate extends Aggregate {
		String id = cmd.getSelection().getId();

		if (exist(id)) {
			logger.info("Descartando selección " + id + ". Ya está registrado.");
			return null; // Se lanza excepción en el origen no aquí
			Event state = getStateFromHistory(id);
			loadFromHistory(state);
			checkState(id, state.getType());
		}

		this.setAggregateId(id);