diff --git a/schema.graphqls b/schema.graphqls index d114e1a..54a2de4 100644 --- a/schema.graphqls +++ b/schema.graphqls @@ -18,10 +18,8 @@ type System { } type Region { - latitude: Float! - longitude: Float! - latitudeDelta: Float! - longitudeDelta: Float! + topLeft: Coordinates! + bottomRight: Coordinates! } type ParkingSystem { diff --git a/src/entities/SharedEntities.ts b/src/entities/SharedEntities.ts index e24f31a..af7b090 100644 --- a/src/entities/SharedEntities.ts +++ b/src/entities/SharedEntities.ts @@ -12,9 +12,7 @@ export interface ICoordinates { } export interface IRegion { - latitude: number; - longitude: number; - latitudeDelta: number; - longitudeDelta: number; + topLeft: ICoordinates; + bottomRight: ICoordinates; } diff --git a/src/index.ts b/src/index.ts index 24bfeb3..d709b1d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -26,10 +26,8 @@ const supportedSystems: InterchangeSystemBuilderArguments[] = [ useSelfUpdatingEtas: true, shuttleStopArrivalDegreeDelta: 0.001, initialRegion: { - latitude: 33.7937, - longitude: -117.8531, - latitudeDelta: 0.01, - longitudeDelta: 0.01, + topLeft: { latitude: 33.7987, longitude: -117.8581 }, + bottomRight: { latitude: 33.7887, longitude: -117.8481 }, }, } ] diff --git a/src/resolvers/__tests__/SystemResolverTests.test.ts b/src/resolvers/__tests__/SystemResolverTests.test.ts index a345469..502ed92 100644 --- a/src/resolvers/__tests__/SystemResolverTests.test.ts +++ b/src/resolvers/__tests__/SystemResolverTests.test.ts @@ -40,10 +40,14 @@ describe("SystemResolvers", () => { query GetSystemInitialRegion($systemId: ID!) { system(id: $systemId) { initialRegion { - latitude - longitude - latitudeDelta - longitudeDelta + topLeft { + latitude + longitude + } + bottomRight { + latitude + longitude + } } } } @@ -56,10 +60,8 @@ describe("SystemResolvers", () => { expect(response.body.singleResult.errors).toBeUndefined(); const initialRegion = (response.body.singleResult.data as any).system.initialRegion; expect(initialRegion).toEqual({ - latitude: 33.7937, - longitude: -117.8531, - latitudeDelta: 0.01, - longitudeDelta: 0.01, + topLeft: { latitude: 33.7987, longitude: -117.8581 }, + bottomRight: { latitude: 33.7887, longitude: -117.8481 }, }); }); }); diff --git a/testHelpers/apolloTestServerHelpers.ts b/testHelpers/apolloTestServerHelpers.ts index e8d721c..4d0e8ad 100644 --- a/testHelpers/apolloTestServerHelpers.ts +++ b/testHelpers/apolloTestServerHelpers.ts @@ -27,10 +27,8 @@ const systemInfoForTesting: InterchangeSystemBuilderArguments = { useSelfUpdatingEtas: false, shuttleStopArrivalDegreeDelta: 0.001, initialRegion: { - latitude: 33.7937, - longitude: -117.8531, - latitudeDelta: 0.01, - longitudeDelta: 0.01, + topLeft: { latitude: 33.7987, longitude: -117.8581 }, + bottomRight: { latitude: 33.7887, longitude: -117.8481 }, }, };