Skip to content

Commit d3c76f0

Browse files
committed
Rename deck to inspection area
1 parent 038f29f commit d3c76f0

File tree

69 files changed

+3821
-849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3821
-849
lines changed

backend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ The access matrix looks like this:
315315
| | **Read Only** | **User** | **Admin** |
316316
| -------------------------- | ------------- | -------- | --------- |
317317
| Area | Read | Read | CRUD |
318-
| Deck | Read | Read | CRUD |
318+
| InspectionArea | Read | Read | CRUD |
319319
| Plant | Read | Read | CRUD |
320320
| Installation | Read | Read | CRUD |
321321
| MissionLoader | Read | Read | CRUD |

backend/api.test/Client/AreaTests.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,20 @@ public async Task AreaTest()
8282
Name = testPlant
8383
};
8484

85-
string testDeck = "testDeckAreaTest";
86-
var deckQuery = new CreateDeckQuery
85+
string testInspectionArea = "testInspectionAreaAreaTest";
86+
var inspectionAreaQuery = new CreateInspectionAreaQuery
8787
{
8888
InstallationCode = testInstallation,
8989
PlantCode = testPlant,
90-
Name = testDeck
90+
Name = testInspectionArea
9191
};
9292

9393
string testArea = "testAreaAreaTest";
9494
var areaQuery = new CreateAreaQuery
9595
{
9696
InstallationCode = testInstallation,
9797
PlantCode = testPlant,
98-
DeckName = testDeck,
98+
InspectionAreaName = testInspectionArea,
9999
AreaName = testArea,
100100
DefaultLocalizationPose = testPose
101101
};
@@ -112,8 +112,8 @@ public async Task AreaTest()
112112
"application/json"
113113
);
114114

115-
var deckContent = new StringContent(
116-
JsonSerializer.Serialize(deckQuery),
115+
var inspectionAreaContent = new StringContent(
116+
JsonSerializer.Serialize(inspectionAreaQuery),
117117
null,
118118
"application/json"
119119
);
@@ -129,15 +129,15 @@ public async Task AreaTest()
129129
var installationResponse = await _client.PostAsync(installationUrl, installationContent);
130130
string plantUrl = "/plants";
131131
var plantResponse = await _client.PostAsync(plantUrl, plantContent);
132-
string deckUrl = "/decks";
133-
var deckResponse = await _client.PostAsync(deckUrl, deckContent);
132+
string inspectionAreaUrl = "/inspectionAreas";
133+
var inspectionAreaResponse = await _client.PostAsync(inspectionAreaUrl, inspectionAreaContent);
134134
string areaUrl = "/areas";
135135
var areaResponse = await _client.PostAsync(areaUrl, areaContent);
136136

137137
// Assert
138138
Assert.True(installationResponse.IsSuccessStatusCode);
139139
Assert.True(plantResponse.IsSuccessStatusCode);
140-
Assert.True(deckResponse.IsSuccessStatusCode);
140+
Assert.True(inspectionAreaResponse.IsSuccessStatusCode);
141141
Assert.True(areaResponse.IsSuccessStatusCode);
142142
var area = await areaResponse.Content.ReadFromJsonAsync<AreaResponse>(_serializerOptions);
143143
Assert.NotNull(area);
@@ -149,7 +149,7 @@ public async Task MissionIsCreatedInInspectionArea()
149149
// Arrange - Initialise area
150150
var installation = await _databaseUtilities.ReadOrNewInstallation();
151151
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
152-
var deck = await _databaseUtilities.ReadOrNewDeck(installation.InstallationCode, plant.PlantCode);
152+
var inspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(installation.InstallationCode, plant.PlantCode);
153153

154154
// Arrange - Robot
155155
var robot = await _databaseUtilities.NewRobot(RobotStatus.Available, installation);
@@ -178,7 +178,7 @@ public async Task MissionIsCreatedInInspectionArea()
178178
RobotId = robotId,
179179
DesiredStartTime = DateTime.UtcNow,
180180
InstallationCode = installation.InstallationCode,
181-
InspectionAreaName = deck.Name,
181+
InspectionAreaName = inspectionArea.Name,
182182
Name = testMissionName,
183183
Tasks = tasks
184184
};
@@ -197,8 +197,8 @@ public async Task MissionIsCreatedInInspectionArea()
197197
var mission = await missionResponse.Content.ReadFromJsonAsync<MissionRun>(_serializerOptions);
198198
Assert.NotNull(mission);
199199
Assert.NotNull(mission.MissionId);
200-
string inspectionAreaUrl = "/decks";
201-
var inspectionareaMissionsResponse = await _client.GetAsync(inspectionAreaUrl + $"/{deck.Id}/mission-definitions");
200+
string inspectionAreaUrl = "/inspectionAreas";
201+
var inspectionareaMissionsResponse = await _client.GetAsync(inspectionAreaUrl + $"/{inspectionArea.Id}/mission-definitions");
202202

203203
// Assert
204204
Assert.True(inspectionareaMissionsResponse.IsSuccessStatusCode);
@@ -228,16 +228,16 @@ public async Task EmergencyDockTest()
228228
}
229229

230230
[Fact]
231-
public async Task UpdateDefaultLocalizationPoseOnDeck()
231+
public async Task UpdateDefaultLocalizationPoseOnInspectionArea()
232232
{
233233
// Arrange
234234
var installation = await _databaseUtilities.ReadOrNewInstallation();
235235
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
236-
var deck = await _databaseUtilities.ReadOrNewDeck(installation.InstallationCode, plant.PlantCode);
236+
var inspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(installation.InstallationCode, plant.PlantCode);
237237

238-
string deckId = deck.Id;
238+
string inspectionAreaId = inspectionArea.Id;
239239

240-
string url = $"/decks/{deckId}/update-default-localization-pose";
240+
string url = $"/inspectionAreas/{inspectionAreaId}/update-default-localization-pose";
241241
var query = new CreateDefaultLocalizationPose
242242
{
243243
Pose = new Pose
@@ -266,13 +266,13 @@ public async Task UpdateDefaultLocalizationPoseOnDeck()
266266
// Act
267267
var putResponse = await _client.PutAsync(url, content);
268268
Assert.True(putResponse.IsSuccessStatusCode);
269-
var putDeck = await putResponse.Content.ReadFromJsonAsync<DeckResponse>(_serializerOptions);
269+
var putInspectionArea = await putResponse.Content.ReadFromJsonAsync<InspectionAreaResponse>(_serializerOptions);
270270

271271
// Assert
272-
Assert.NotNull(putDeck);
273-
Assert.NotNull(putDeck.DefaultLocalizationPose);
274-
Assert.True(putDeck.DefaultLocalizationPose.Position.Z.Equals(query.Pose.Position.Z));
275-
Assert.True(putDeck.DefaultLocalizationPose.Orientation.W.Equals(query.Pose.Orientation.W));
272+
Assert.NotNull(putInspectionArea);
273+
Assert.NotNull(putInspectionArea.DefaultLocalizationPose);
274+
Assert.True(putInspectionArea.DefaultLocalizationPose.Position.Z.Equals(query.Pose.Position.Z));
275+
Assert.True(putInspectionArea.DefaultLocalizationPose.Orientation.W.Equals(query.Pose.Orientation.W));
276276
}
277277
}
278278
}

backend/api.test/Client/MissionTests.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ public async Task AddNonDuplicateAreasToDb()
159159
// Arrange
160160
var installation = await _databaseUtilities.ReadOrNewInstallation();
161161
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
162-
var deck = await _databaseUtilities.ReadOrNewDeck(installation.InstallationCode, plant.PlantCode);
163-
var _ = await _databaseUtilities.ReadOrNewArea(installation.InstallationCode, plant.PlantCode, deck.Name);
162+
var inspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(installation.InstallationCode, plant.PlantCode);
163+
var _ = await _databaseUtilities.ReadOrNewArea(installation.InstallationCode, plant.PlantCode, inspectionArea.Name);
164164

165165
var testPose = new Pose
166166
{
@@ -182,7 +182,7 @@ public async Task AddNonDuplicateAreasToDb()
182182
{
183183
InstallationCode = installation.InstallationCode,
184184
PlantCode = plant.PlantCode,
185-
DeckName = deck.Name,
185+
InspectionAreaName = inspectionArea.Name,
186186
AreaName = "AddNonDuplicateAreasToDb_Area",
187187
DefaultLocalizationPose = testPose
188188
};
@@ -206,8 +206,8 @@ public async Task AddDuplicateAreasToDb_Fails()
206206
// Arrange
207207
var installation = await _databaseUtilities.ReadOrNewInstallation();
208208
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
209-
var deck = await _databaseUtilities.ReadOrNewDeck(installation.InstallationCode, plant.PlantCode);
210-
var area = await _databaseUtilities.ReadOrNewArea(installation.InstallationCode, plant.PlantCode, deck.Name);
209+
var inspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(installation.InstallationCode, plant.PlantCode);
210+
var area = await _databaseUtilities.ReadOrNewArea(installation.InstallationCode, plant.PlantCode, inspectionArea.Name);
211211

212212
var testPose = new Pose
213213
{
@@ -229,7 +229,7 @@ public async Task AddDuplicateAreasToDb_Fails()
229229
{
230230
InstallationCode = installation.InstallationCode,
231231
PlantCode = plant.PlantCode,
232-
DeckName = deck.Name,
232+
InspectionAreaName = inspectionArea.Name,
233233
AreaName = area.Name,
234234
DefaultLocalizationPose = testPose
235235
};
@@ -267,7 +267,7 @@ public async Task ScheduleDuplicateCustomMissionDefinitions()
267267
// Arrange
268268
var installation = await _databaseUtilities.ReadOrNewInstallation();
269269
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
270-
var deck = await _databaseUtilities.ReadOrNewDeck(installation.InstallationCode, plant.PlantCode);
270+
var inspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(installation.InstallationCode, plant.PlantCode);
271271

272272
string testMissionName = "testMissionScheduleDuplicateCustomMissionDefinitions";
273273

@@ -280,7 +280,7 @@ public async Task ScheduleDuplicateCustomMissionDefinitions()
280280
{
281281
RobotId = robotId,
282282
InstallationCode = installation.InstallationCode,
283-
InspectionAreaName = deck.Name,
283+
InspectionAreaName = inspectionArea.Name,
284284
DesiredStartTime = DateTime.SpecifyKind(new DateTime(3050, 1, 1), DateTimeKind.Utc),
285285
InspectionFrequency = new TimeSpan(14, 0, 0, 0),
286286
Name = testMissionName,
@@ -342,7 +342,7 @@ public async Task GetNextRun()
342342
// Arrange - Initialise area
343343
var installation = await _databaseUtilities.ReadOrNewInstallation();
344344
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
345-
var deck = await _databaseUtilities.ReadOrNewDeck(installation.InstallationCode, plant.PlantCode);
345+
var inspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(installation.InstallationCode, plant.PlantCode);
346346

347347
// Arrange - Robot
348348
var robot = await _databaseUtilities.NewRobot(RobotStatus.Available, installation);
@@ -354,7 +354,7 @@ public async Task GetNextRun()
354354
{
355355
RobotId = robotId,
356356
InstallationCode = installation.InstallationCode,
357-
InspectionAreaName = deck.Name,
357+
InspectionAreaName = inspectionArea.Name,
358358
DesiredStartTime = DateTime.SpecifyKind(new DateTime(3050, 1, 1), DateTimeKind.Utc),
359359
InspectionFrequency = new TimeSpan(14, 0, 0, 0),
360360
Name = testMissionName,
@@ -448,8 +448,8 @@ public async Task ScheduleDuplicatMissionDefinitions()
448448
// Arrange - Initialise area
449449
var installation = await _databaseUtilities.ReadOrNewInstallation();
450450
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
451-
var deck = await _databaseUtilities.ReadOrNewDeck(installation.InstallationCode, plant.PlantCode);
452-
var area = await _databaseUtilities.ReadOrNewArea(installation.InstallationCode, plant.PlantCode, deck.Name);
451+
var inspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(installation.InstallationCode, plant.PlantCode);
452+
var area = await _databaseUtilities.ReadOrNewArea(installation.InstallationCode, plant.PlantCode, inspectionArea.Name);
453453

454454
// Arrange - Robot
455455
var robot = await _databaseUtilities.NewRobot(RobotStatus.Available, installation);
@@ -499,7 +499,7 @@ public async Task MissionDoesNotStartIfRobotIsNotInSameInstallationAsMission()
499499
// Arrange - Initialise area
500500
var installation = await _databaseUtilities.ReadOrNewInstallation();
501501
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
502-
var deck = await _databaseUtilities.ReadOrNewDeck(installation.InstallationCode, plant.PlantCode);
502+
var inspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(installation.InstallationCode, plant.PlantCode);
503503

504504
string testMissionName = "testMissionDoesNotStartIfRobotIsNotInSameInstallationAsMission";
505505

@@ -516,7 +516,7 @@ public async Task MissionDoesNotStartIfRobotIsNotInSameInstallationAsMission()
516516
{
517517
RobotId = robotId,
518518
InstallationCode = installation.InstallationCode,
519-
InspectionAreaName = deck.Name,
519+
InspectionAreaName = inspectionArea.Name,
520520
DesiredStartTime = DateTime.SpecifyKind(new DateTime(3050, 1, 1), DateTimeKind.Utc),
521521
InspectionFrequency = new TimeSpan(14, 0, 0, 0),
522522
Name = testMissionName,
@@ -556,30 +556,30 @@ public async Task MissionDoesNotStartIfRobotIsNotInSameInstallationAsMission()
556556
}
557557

558558
[Fact]
559-
public async Task MissionFailsIfRobotIsNotInSameDeckAsMission()
559+
public async Task MissionFailsIfRobotIsNotInSameInspectionAreaAsMission()
560560
{
561561
// Arrange - Initialise area
562562
var installation = await _databaseUtilities.ReadOrNewInstallation();
563563
var plant = await _databaseUtilities.ReadOrNewPlant(installation.InstallationCode);
564564

565-
string deckName1 = "deckMissionFailsIfRobotIsNotInSameDeckAsMission1";
566-
var deck1 = await _databaseUtilities.NewDeck(installation.InstallationCode, plant.PlantCode, deckName1);
565+
string inspectionAreaName1 = "inspectionAreaMissionFailsIfRobotIsNotInSameInspectionAreaAsMission1";
566+
var inspectionArea1 = await _databaseUtilities.NewInspectionArea(installation.InstallationCode, plant.PlantCode, inspectionAreaName1);
567567

568-
string deckName2 = "deckMissionFailsIfRobotIsNotInSameDeckAsMission2";
569-
var deck2 = await _databaseUtilities.NewDeck(installation.InstallationCode, plant.PlantCode, deckName2);
568+
string inspectionAreaName2 = "inspectionAreaMissionFailsIfRobotIsNotInSameInspectionAreaAsMission2";
569+
var inspectionArea2 = await _databaseUtilities.NewInspectionArea(installation.InstallationCode, plant.PlantCode, inspectionAreaName2);
570570

571-
string testMissionName = "testMissionFailsIfRobotIsNotInSameDeckAsMission";
571+
string testMissionName = "testMissionFailsIfRobotIsNotInSameInspectionAreaAsMission";
572572

573573
// Arrange - Robot
574-
var robot = await _databaseUtilities.NewRobot(RobotStatus.Available, installation, deck1);
574+
var robot = await _databaseUtilities.NewRobot(RobotStatus.Available, installation, inspectionArea1);
575575
string robotId = robot.Id;
576576

577577
// Arrange - Mission Run Query
578578
var query = new CustomMissionQuery
579579
{
580580
RobotId = robotId,
581581
InstallationCode = installation.InstallationCode,
582-
InspectionAreaName = deck2.Name,
582+
InspectionAreaName = inspectionArea2.Name,
583583
DesiredStartTime = DateTime.SpecifyKind(new DateTime(3050, 1, 1), DateTimeKind.Utc),
584584
InspectionFrequency = new TimeSpan(14, 0, 0, 0),
585585
Name = testMissionName,

backend/api.test/Client/RobotTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public async Task RobotIsNotCreatedWithAreaNotInInstallation()
9595

9696
var wrongInstallation = await _databaseUtilities.NewInstallation("wrongInstallation");
9797
var wrongPlant = await _databaseUtilities.ReadOrNewPlant(wrongInstallation.InstallationCode);
98-
var wrongDeck = await _databaseUtilities.ReadOrNewDeck(wrongInstallation.InstallationCode, wrongPlant.PlantCode);
98+
var wrongInspectionArea = await _databaseUtilities.ReadOrNewInspectionArea(wrongInstallation.InstallationCode, wrongPlant.PlantCode);
9999

100100
// Arrange - Create robot
101101
var robotQuery = new CreateRobotQuery
@@ -108,7 +108,7 @@ public async Task RobotIsNotCreatedWithAreaNotInInstallation()
108108
Host = "localhost",
109109
Port = 3000,
110110
CurrentInstallationCode = installation.InstallationCode,
111-
CurrentInspectionAreaName = wrongDeck.Name,
111+
CurrentInspectionAreaName = wrongInspectionArea.Name,
112112
};
113113

114114
string robotUrl = "/robots";
@@ -124,7 +124,7 @@ public async Task RobotIsNotCreatedWithAreaNotInInstallation()
124124
}
125125
catch (DbUpdateException ex)
126126
{
127-
Assert.True(ex.Message == $"Could not create new robot in database as inspection area '{wrongDeck.Name}' does not exist in installation {installation.InstallationCode}");
127+
Assert.True(ex.Message == $"Could not create new robot in database as inspection area '{wrongInspectionArea.Name}' does not exist in installation {installation.InstallationCode}");
128128
}
129129
}
130130
}

0 commit comments

Comments
 (0)