-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the maintenance record management class
- Loading branch information
1 parent
4085eda
commit b29a503
Showing
10 changed files
with
1,189 additions
and
612 deletions.
There are no files selected for viewing
301 changes: 301 additions & 0 deletions
301
src/DroneFlightLog.Data.Tests/MaintenanceRecordManagerTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace DroneFlightLog.Data.Entities | ||
{ | ||
public enum MaintenanceRecordType | ||
{ | ||
Maintenance, | ||
Modification | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/DroneFlightLog.Data/Exceptions/MaintenanceRecordNotFoundException.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace DroneFlightLog.Data.Exceptions | ||
{ | ||
[ExcludeFromCodeCoverage] | ||
public class MaintenanceRecordNotFoundException : Exception | ||
{ | ||
public MaintenanceRecordNotFoundException() | ||
{ | ||
} | ||
|
||
public MaintenanceRecordNotFoundException(string message) : base(message) | ||
{ | ||
} | ||
|
||
public MaintenanceRecordNotFoundException(string message, Exception inner) : base(message, inner) | ||
{ | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
19 changes: 19 additions & 0 deletions
19
src/DroneFlightLog.Data/Interfaces/IMaintenanceRecordManager.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using DroneFlightLog.Data.Entities; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace DroneFlightLog.Data.Interfaces | ||
{ | ||
public interface IMaintenanceRecordManager | ||
{ | ||
MaintenanceRecord AddMaintenanceRecord(int maintainerId, int droneId, MaintenanceRecordType type, DateTime completed, string description, string notes); | ||
Task<MaintenanceRecord> AddMaintenanceRecordAsync(int maintainerId, int droneId, MaintenanceRecordType type, DateTime completed, string description, string notes); | ||
IEnumerable<MaintenanceRecord> FindMaintenanceRecords(int? maintainerId, int? droneId, DateTime? start, DateTime? end, int pageNumber, int pageSize); | ||
IAsyncEnumerable<MaintenanceRecord> FindMaintenanceRecordsAsync(int? maintainerId, int? droneId, DateTime? start, DateTime? end, int pageNumber, int pageSize); | ||
MaintenanceRecord GetMaintenanceRecord(int id); | ||
Task<MaintenanceRecord> GetMaintenanceRecordAsync(int id); | ||
MaintenanceRecord UpdateMaintenanceRecord(int id, int maintainerId, int droneId, MaintenanceRecordType type, DateTime completed, string description, string notes); | ||
Task<MaintenanceRecord> UpdateMaintenanceRecordAsync(int id, int maintainerId, int droneId, MaintenanceRecordType type, DateTime completed, string description, string notes); | ||
} | ||
} |
Oops, something went wrong.