Skip to content

Commit

Permalink
do not rollback on node moved on previous connected segment
Browse files Browse the repository at this point in the history
  • Loading branch information
runeanielsen committed Aug 5, 2020
1 parent ed4299c commit b868081
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using System.Linq;
using OpenFTTH.GDBIntegrator.RouteNetwork;
using OpenFTTH.GDBIntegrator.Integrator.Notifications;
using OpenFTTH.GDBIntegrator.Config;
Expand Down Expand Up @@ -37,8 +38,11 @@ public async Task<INotification> CreateUpdatedEvent(RouteNode before, RouteNode

await _geoDatabase.UpdateRouteNodeShadowTable(after);

var intersectingRouteSegments = await _geoDatabase.GetIntersectingRouteSegments(after);
var previousIntersectingRouteSegments = await _geoDatabase.GetIntersectingRouteSegments(before.Coord);
var intersectingRouteSegments = (await _geoDatabase.GetIntersectingRouteSegments(after))
.Where(x => !previousIntersectingRouteSegments.Any(y => y.Mrid == x.Mrid)).ToList();
var intersectingRouteNodes = await _geoDatabase.GetIntersectingRouteNodes(after);

if (intersectingRouteSegments.Count > 0 || intersectingRouteNodes.Count > 0)
return new RollbackInvalidRouteNodeOperation(before);

Expand Down

0 comments on commit b868081

Please sign in to comment.